# slow segment-editor's grow-from-seeds initialization for liver segmentation

**URL:** <https://discourse.slicer.org/t/slow-segment-editors-grow-from-seeds-initialization-for-liver-segmentation/22479>\
**Category:** Support\
**Tags:** segmentation\
**Created:** [March 12, 2022, 10:08pm UTC](https://discourse.slicer.org/t/slow-segment-editors-grow-from-seeds-initialization-for-liver-segmentation/22479 "2022-03-12T22:08:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hju](https://avatars.discourse-cdn.com/v4/letter/h/bbe5ce/32.png) [@hju](https://discourse.slicer.org/u/hju)\
**Post date:** [March 12, 2022, 10:08pm UTC](https://discourse.slicer.org/t/slow-segment-editors-grow-from-seeds-initialization-for-liver-segmentation/22479/1 "2022-03-12T22:08:29Z")

</div>

Operating system: Windows 10  
Slicer version: 4.13.0-2021-12-21, 4.11.20210226  
Expected behavior: faster performance  
Actual behavior:  
I’m trying to use Segment Editor’s Grow-From-Seeds to segment liver on abdominal CT. I found the initialization step can take 4-5min, for both stable and preview release Windows versions, which is longer than I expected. I saw it took around 1 min when others doing similar operations on similar images on **Linux**.

Could you test it on your side if you have access to a Windows machine? Is the grow-from-seeds always slower with Windows version? Any tips to improve the performance? Thanks!

I recorded a short video to show what I did

> **[slicer-20220312\_105538-Meeting Recording.mp4](https://drive.google.com/file/d/1XguFomtvGMqvZanI5-q2PKBagBZH3pGl/view?usp=sharing)**
>
> Google Drive file.

The image I used in the video

> **[liver\_102.nii.gz](https://drive.google.com/file/d/1Y2ZOU9rFMhyZ4_jKWJ2oIPIuqCC6ndYX/view?usp=sharing)**
>
> Google Drive file.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 12, 2022, 11:28pm UTC](https://discourse.slicer.org/t/slow-segment-editors-grow-from-seeds-initialization-for-liver-segmentation/22479/2 "2022-03-12T23:28:19Z")

</div>

I was able to reproduce the slow (4-minute) “Grow from seeds” initialization on this image. **By somewhat optimizing the image for liver segmentation, I reduced the computation time to 5 seconds!**

- This image has “float” voxels, which makes computation slower. **Use the “Cast scalar volume” to convert it to “short” type**. CT images are usually are natively stored in “short” voxel type, so no information is lost - if any - should be negligible.
- The image is fairly high resolution (0.7mm voxel size). This resolution is important for segmenting small and thin structures, but unnecessary for a large, bulky structure such as the liver. **Use Crop volume module to crop the the image size to the minimum necessary size (about 1cm margin around the liver) to save memory, set Spacing scale to 2.0x (or even 3.0x), and enable “Isotropic spacing”** (this image is already close to isotropic, but since we resample it anyway, we can easily make it completely isotropic).

---

<div class="post-metadata">

**Author:** ![hju](https://avatars.discourse-cdn.com/v4/letter/h/bbe5ce/32.png) [@hju](https://discourse.slicer.org/u/hju)\
**Post date:** [March 13, 2022, 11:40pm UTC](https://discourse.slicer.org/t/slow-segment-editors-grow-from-seeds-initialization-for-liver-segmentation/22479/3 "2022-03-13T23:40:54Z")

</div>

@lassoan Thanks a lot!  
It works for me! Around 5 seconds!

One question: Does painting more seeds always lead to slower `initialization`?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 14, 2022, 2:30am UTC](https://discourse.slicer.org/t/slow-segment-editors-grow-from-seeds-initialization-for-liver-segmentation/22479/4 "2022-03-14T02:30:00Z")

</div>

Amount of seeds does not matter, just the bounding box of the painted regions. Grow from seeds only fills within the region where the seeds are defined in (extended by some margin) and the larger the region the longer the computation takes.

---

<div class="post-metadata">

**Author:** ![hju](https://avatars.discourse-cdn.com/v4/letter/h/bbe5ce/32.png) [@hju](https://discourse.slicer.org/u/hju)\
**Post date:** [March 14, 2022, 2:46am UTC](https://discourse.slicer.org/t/slow-segment-editors-grow-from-seeds-initialization-for-liver-segmentation/22479/5 "2022-03-14T02:46:12Z")

</div>

Many thanks! 😃 @lassoan
