# How to get airways using LungCTAnalyzer

**URL:** <https://discourse.slicer.org/t/how-to-get-airways-using-lungctanalyzer/24102>\
**Category:** Support\
**Tags:** lungctanalyzer\
**Created:** [June 29, 2022, 12:52pm UTC](https://discourse.slicer.org/t/how-to-get-airways-using-lungctanalyzer/24102 "2022-06-29T12:52:44Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![ekmungi](https://avatars.discourse-cdn.com/v4/letter/e/e480ec/32.png) [@ekmungi](https://discourse.slicer.org/u/ekmungi)\
**Post date:** [June 29, 2022, 12:52pm UTC](https://discourse.slicer.org/t/how-to-get-airways-using-lungctanalyzer/24102/1 "2022-06-29T12:52:44Z")

</div>

This question is a continuation to an [issue](https://github.com/rbumm/SlicerLungCTAnalyzer/issues/34) I posted on github. I am posting follow-up here.

I performed the steps as suggested. However, as can be seen in the second picture. Somehow the lung lobes and airways are being mixed up.

 ![Screenshot_20220629_115204](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/4/b4c14360738dde652727b605c5c6a9e17fe842ce.jpeg)

 ![Screenshot_20220629_115900](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/1/41131c921a654f6800122dd00c9910b59451efb1.jpeg)

The ONLY blue colored segmentation includes both Lung lobes + Airways + Bronchus – As seen in the picture below.

 ![Screenshot_20220629_120816](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/a/2ac95612c603fb72e7942427327b92b1e350c7ad.jpeg)

However when I deselect the segmentation labeled as airway, this is what I see

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

Thanks for any help

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [June 29, 2022, 1:31pm UTC](https://discourse.slicer.org/t/how-to-get-airways-using-lungctanalyzer/24102/2 "2022-06-29T13:31:27Z")

</div>

That data is incorrectly formatted (the body is upside down). This should never happen for dicom data or any data that’s been consistently processed. Check the pipeline from scanner to slicer to correct any processing steps that might have introduced this issue. We take coordinate system issues very seriously so if your research indicates there might be a bug in Slicer please report all the details so it can be investigated.

---

<div class="post-metadata">

**Author:** ![ekmungi](https://avatars.discourse-cdn.com/v4/letter/e/e480ec/32.png) [@ekmungi](https://discourse.slicer.org/u/ekmungi)\
**Post date:** [June 30, 2022, 8:58am UTC](https://discourse.slicer.org/t/how-to-get-airways-using-lungctanalyzer/24102/3 "2022-06-30T08:58:20Z")

</div>

Thanks for the comment @pieper. I received this data this way from my collaborating physician. I will check back with them.

But do you think this is causing the segmentation issues I described in my original post?

---

<div class="post-metadata">

**Author:** ![ekmungi](https://avatars.discourse-cdn.com/v4/letter/e/e480ec/32.png) [@ekmungi](https://discourse.slicer.org/u/ekmungi)\
**Post date:** [June 30, 2022, 9:06am UTC](https://discourse.slicer.org/t/how-to-get-airways-using-lungctanalyzer/24102/4 "2022-06-30T09:06:21Z")

</div>

**Update** :

I have 3 other datasets and I am having the same issue described in the original post. I could really use some help 🙂 Thank you.

---

<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:** [June 30, 2022, 9:51am UTC](https://discourse.slicer.org/t/how-to-get-airways-using-lungctanalyzer/24102/5 "2022-06-30T09:51:09Z")

</div>

Hi,

This looks like a big “leak” from the airway segmentation. From your screenshot, it appears that your threshold sliders are all out of range.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/b/7bc5063dab17344f370e1b77c927035f6898656e.jpeg)

- set your upper lung threshold to -400 (should be almost always ok)
- set your upper airway threshold to -800 (play with that between -900 and -700, see toolext help when you move your mouse over the slider)

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/9/a9d8391ba039d47bcb4f67552150a64044effc57.png)

If you have a large trachea, set airway segmentation → “low detail”  
With a normal trachea, set → medium detail" or even “high detail”.

We are working to get those fine-tuning parameters better preset, but once you find good thresholds for your scanner you should be ok.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [June 30, 2022, 1:16pm UTC](https://discourse.slicer.org/t/how-to-get-airways-using-lungctanalyzer/24102/6 "2022-06-30T13:16:24Z")

</div>

> [@ekmungi](#):
>
> But do you think this is causing the segmentation issues I described in my original post?

I think yes, the segmentation relies on the orientation being standard; maybe not but I think so. You can use the Transforms module to rotate (or maybe flip) the data and then harden it before running the algorithm. Together with the updates to the thresholds you should be okay.

---

<div class="post-metadata">

**Author:** ![ekmungi](https://avatars.discourse-cdn.com/v4/letter/e/e480ec/32.png) [@ekmungi](https://discourse.slicer.org/u/ekmungi)\
**Post date:** [June 30, 2022, 5:36pm UTC](https://discourse.slicer.org/t/how-to-get-airways-using-lungctanalyzer/24102/7 "2022-06-30T17:36:18Z")

</div>

Thanks for the feedback @rbumm. I tried the complete range you suggested, but unfortunately, that did not work. I can see the airways are being segmented. However, they are still combined with the Pleura.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/e/6e1925df8628b5e9921abb1790f82a75bbb7af68.jpeg)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/0/a037b840e313841c1e6f9e470738b76e76b1537a.jpeg)

I tried the segmentation editor option (as explained in this [video](https://www.youtube.com/watch?v=tJMGe3FMTk0)). It works but the segmentation quality is not so good. I can see the airways are being segmented nicely, but as you said there is a leak. But not sure how to find this out 😕.

I haven’t tried the suggestion given by Steve yet.

---

<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:** [June 30, 2022, 6:41pm UTC](https://discourse.slicer.org/t/how-to-get-airways-using-lungctanalyzer/24102/8 "2022-06-30T18:41:41Z")

</div>

Sorry but I think I read a name on the dataset you provided above …  
Maybe you better delete that post?

Then do the following:  
Download Slicer´s lung demo dataset

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

and run the latest version of Lung CT Segmenter on this.  
Use these settings:

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/5/3557d0e49d83dc8cdec41408237a667733606338.png)

Will work 😉  
Then identify the difference between your patient volume and the demo dataset.  
Good luck !

---

<div class="post-metadata">

**Author:** ![ekmungi](https://avatars.discourse-cdn.com/v4/letter/e/e480ec/32.png) [@ekmungi](https://discourse.slicer.org/u/ekmungi)\
**Post date:** [July 20, 2022, 3:57am UTC](https://discourse.slicer.org/t/how-to-get-airways-using-lungctanalyzer/24102/9 "2022-07-20T03:57:16Z")

</div>

Thanks @rbumm. Apologies for the delay in my reply. I can confirm that the sample dataset works. However, on the data I collected, it still has this issue.

I tried using the seed-based segmentation shown in this example([Airway segmentation from CT in 1 minute using 3D Slicer - YouTube](https://youtu.be/tJMGe3FMTk0)). It works without segmenting the lung as part of the airway; however I am not happy with the details in the segmentation.

Any suggestions on how to proceed? Do you have any suggestions on alternate tools that I can try to segment my data?

Thanks!

---

<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:** [July 20, 2022, 5:20am UTC](https://discourse.slicer.org/t/how-to-get-airways-using-lungctanalyzer/24102/10 "2022-07-20T05:20:22Z")

</div>

Could you share one of your non-working data sets on google drive or dropbox?

---

<div class="post-metadata">

**Author:** ![D\_Dand](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/d_dand/32/69093_2.png) [@D\_Dand](https://discourse.slicer.org/u/D_Dand)\
**Post date:** [February 6, 2024, 5:05pm UTC](https://discourse.slicer.org/t/how-to-get-airways-using-lungctanalyzer/24102/11 "2024-02-06T17:05:50Z")

</div>

Thank you for your advice. I wonder if lung CT segmented can segment the upper airway?

---

<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:** [February 6, 2024, 6:07pm UTC](https://discourse.slicer.org/t/how-to-get-airways-using-lungctanalyzer/24102/12 "2024-02-06T18:07:00Z")

</div>

Depends a little bit on your dataset. You may experience leaks from nose and mouse if they are connected with air around the patient in your CT. You could still handle this issue by postprocessing.

---

<div class="post-metadata">

**Author:** ![D\_Dand](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/d_dand/32/69093_2.png) [@D\_Dand](https://discourse.slicer.org/u/D_Dand)\
**Post date:** [February 6, 2024, 7:28pm UTC](https://discourse.slicer.org/t/how-to-get-airways-using-lungctanalyzer/24102/13 "2024-02-06T19:28:29Z")

</div>

Would you mind specifying what postprocessing step is? I had this issue when I tried with the upper airway. And is it possible to reconstruct the entire human airway (from the bronchi to the nasal cavity)? Would you suggest an efficient process?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/1/31e875fbe12987ae9fe96e34e8c23097e334c385.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/e/2e8427112cf7d29c1969860ce3b82c196b559bfd.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/4/b48fb4c24fa17ecaecef69453c7b0b1a5eff14c6.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:** [February 9, 2024, 1:51pm UTC](https://discourse.slicer.org/t/how-to-get-airways-using-lungctanalyzer/24102/14 "2024-02-09T13:51:11Z")

</div>

I would go into the Segment Editor → Islands effect and select check “Remove selected island”, then click on the blue air around your segmentation.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/1/b1c52cfff3a5faeaf5190606ec98ea0e32dfdcf8.jpeg)

and check out what remains.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/9/f9ae836c0a7952cf1328ca783eba450b9b2d9dc5.jpeg)

---

<div class="post-metadata">

**Author:** ![D\_Dand](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/d_dand/32/69093_2.png) [@D\_Dand](https://discourse.slicer.org/u/D_Dand)\
**Post date:** [February 12, 2024, 10:56pm UTC](https://discourse.slicer.org/t/how-to-get-airways-using-lungctanalyzer/24102/15 "2024-02-12T22:56:39Z")

</div>

Very helpful! Thank you!
