# How to reduce lung segmentation time?

**URL:** <https://discourse.slicer.org/t/how-to-reduce-lung-segmentation-time/31799>\
**Category:** Support\
**Tags:** lungctanalyzer\
**Created:** [September 20, 2023, 10:30am UTC](https://discourse.slicer.org/t/how-to-reduce-lung-segmentation-time/31799 "2023-09-20T10:30:04Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikiN](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@mikiN](https://discourse.slicer.org/u/mikiN)\
**Post date:** [September 20, 2023, 10:30am UTC](https://discourse.slicer.org/t/how-to-reduce-lung-segmentation-time/31799/1 "2023-09-20T10:30:04Z")

</div>

When using the AI function of CTlungsegmentation (lungmask R231CovidWeb), segmentation takes more than 3 minutes. The spec of the PC used is RTX3050ti 4GB. What can I improve?

---

<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:** [September 20, 2023, 12:48pm UTC](https://discourse.slicer.org/t/how-to-reduce-lung-segmentation-time/31799/2 "2023-09-20T12:48:14Z")

</div>

3 minutes is a really good considering the time and effort you would need to do the work manually and this short computation time is most often acceptable even in intraprocedural workflows. There are [_much_ faster GPUs available](https://gpu.userbenchmark.com/Compare/Nvidia-RTX-4090-vs-Nvidia-RTX-3050-Ti-Laptop/4136vsm1559532), so a trivial option for making segmentation faster is to upgrade your hardware.

---

<div class="post-metadata">

**Author:** ![cong\_lu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cong_lu/32/68041_2.png) [@cong\_lu](https://discourse.slicer.org/u/cong_lu)\
**Post date:** [October 27, 2023, 12:05am UTC](https://discourse.slicer.org/t/how-to-reduce-lung-segmentation-time/31799/3 "2023-10-27T00:05:00Z")

</div>

Hello, I’m wondering how to use the AI function, lungmask R231CovidWeb, in 3D Slicer? I didn’t find the extension.

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [October 27, 2023, 4:08am UTC](https://discourse.slicer.org/t/how-to-reduce-lung-segmentation-time/31799/4 "2023-10-27T04:08:26Z")

</div>

Please install the Lung CT Analyzer extension. Lung CT Segmenter is part of it and this includes support for lungmask R231CovidWeb.

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/f/cf2eae9ca94f20999b3c05191bb548ba3d0ff016.png)

---

<div class="post-metadata">

**Author:** ![cong\_lu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cong_lu/32/68041_2.png) [@cong\_lu](https://discourse.slicer.org/u/cong_lu)\
**Post date:** [October 27, 2023, 4:54pm UTC](https://discourse.slicer.org/t/how-to-reduce-lung-segmentation-time/31799/5 "2023-10-27T16:54:40Z")

</div>

Dear rbumn,  
Thank you for your reply. However, I use the version 5.4 but there might be something wrong with my Lung CT Segmenter. Please check the attached screenshot. I didn’t see “very low detail” or “lungmask R231CovidWeb” in your screenshot. Also there is no reaction after clicking the “Start”.  
Thanks.

 ![Screenshot 2023-10-27 at 12.50.18 PM](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/d/cd57da00e6cb573fc9211c505a510a4d14178b4c.jpeg)

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [October 27, 2023, 5:25pm UTC](https://discourse.slicer.org/t/how-to-reduce-lung-segmentation-time/31799/6 "2023-10-27T17:25:04Z")

</div>

Sorry for the problem.  
Please install the TotalSegmentator extension, restart 3D Slicer, and try the Segmenter again.  
I will push an update soon to avoid this error.

---

<div class="post-metadata">

**Author:** ![cong\_lu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cong_lu/32/68041_2.png) [@cong\_lu](https://discourse.slicer.org/u/cong_lu)\
**Post date:** [October 27, 2023, 5:33pm UTC](https://discourse.slicer.org/t/how-to-reduce-lung-segmentation-time/31799/7 "2023-10-27T17:33:22Z")

</div>

Thanks rbumm.  
I followed your instruction but still not working.

 ![Screenshot 2023-10-27 at 1.32.40 PM](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/8/18b527616f866311caef6297ee91416200269c75.jpeg)

here is my installed extension.

 ![Screenshot 2023-10-27 at 1.29.44 PM](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/a/faf222c4571c51e5facefc858822ba8ad75dd5a4.jpeg)

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [October 27, 2023, 5:58pm UTC](https://discourse.slicer.org/t/how-to-reduce-lung-segmentation-time/31799/8 "2023-10-27T17:58:02Z")

</div>

That selection of extensions looks good, where is 3D Slicer installed? Could that be an access problem where certain rights are missing when you run Slicer ? I see that Lung CT Segmenter is not initialized correctly.  
Could you post the content of the Python interactor during startup ?

---

<div class="post-metadata">

**Author:** ![cong\_lu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cong_lu/32/68041_2.png) [@cong\_lu](https://discourse.slicer.org/u/cong_lu)\
**Post date:** [October 27, 2023, 6:16pm UTC](https://discourse.slicer.org/t/how-to-reduce-lung-segmentation-time/31799/9 "2023-10-27T18:16:58Z")

</div>

I’m currently using MacBook air with M2 chip, the macos is 13.2.1. I installed 3D Slicer at Application.

 ![Screenshot 2023-10-27 at 2.12.59 PM](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/1/e1b971ed2e11f6568dcfcd1f18504e308799b9ab.jpeg)

PS: I’ve also tried a Windows PC today, with freshly installed 3D and extension, which was facing same problem.

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [October 27, 2023, 6:27pm UTC](https://discourse.slicer.org/t/how-to-reduce-lung-segmentation-time/31799/10 "2023-10-27T18:27:46Z")

</div>

Please update Lung CT Analyzer tomorrow, select the ct chest sample volume and report back with the same display. Make sure your computer has access to the internet.

---

<div class="post-metadata">

**Author:** ![cong\_lu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cong_lu/32/68041_2.png) [@cong\_lu](https://discourse.slicer.org/u/cong_lu)\
**Post date:** [October 30, 2023, 5:50pm UTC](https://discourse.slicer.org/t/how-to-reduce-lung-segmentation-time/31799/11 "2023-10-30T17:50:18Z")

</div>

Dear rbumm,  
After update Lung Ct Analyzer to latest version, It works well with the Chest sample data.  
Thanks for your support!
