# Slicer Density Lung Segmentation

**URL:** https://discourse.slicer.org/t/slicer-density-lung-segmentation/22751
**Category:** Development
**Tags:** feature
**Created:** [March 29, 2022, 3:59pm UTC](https://discourse.slicer.org/t/slicer-density-lung-segmentation/22751 "2022-03-29T15:59:04Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![PaoloZaffino](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/paolozaffino/32/81052_2.png) [@PaoloZaffino](https://discourse.slicer.org/u/PaoloZaffino)
#### Post date: [March 29, 2022, 3:59pm UTC](https://discourse.slicer.org/t/slicer-density-lung-segmentation/22751/1 "2022-03-29T15:59:04Z")

</div>

Dear all,  
I would like to inform you that Slicer has a new extension: [Slicer Density Lung Segmentation](https://github.com/pzaffino/SlicerDensityLungSegmentation).  
In this extension, we provide a tool to classify lung tissue density on CT images.  
Its first use is for images of patients diagnosed with pneumonia (such as COVID19), where the algorithm is able to label voxels as “air”, “healthy parenchyma”, “ground glass”, “consolidation” and “thick tissue”.  
A couple of clicks are sufficient to automatically get such a piece of precious information…give it a shot!  
The rationale behind this extension, as well as a link to a free COVID-19 CT dataset, can be found [here](https://www.mdpi.com/2306-5354/8/2/26).

Do not hesitate to ask for further information or to improve the code (feedback are always welcomed)!

> **[GitHub - pzaffino/SlicerDensityLungSegmentation: Extension for 3D Slicer that...](https://github.com/pzaffino/SlicerDensityLungSegmentation)**
>
> Extension for 3D Slicer that labels lung tissue according to density - GitHub - pzaffino/SlicerDensityLungSegmentation: Extension for 3D Slicer that labels lung tissue according to density

---

<div class="post-metadata">

### Author: ![xackey](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/xackey/32/10860_2.png) [@xackey](https://discourse.slicer.org/u/xackey)
#### Post date: [April 7, 2023, 5:03am UTC](https://discourse.slicer.org/t/slicer-density-lung-segmentation/22751/2 "2023-04-07T05:03:29Z")

</div>

Excellent extension!  
I want to operate this extension with python interactor.  
Could you tell me how to write python code?

---

<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: [April 11, 2023, 4:59am UTC](https://discourse.slicer.org/t/slicer-density-lung-segmentation/22751/3 "2023-04-11T04:59:22Z")

</div>

See how it is used in Python scripts in the module’s GUI:

> <https://github.com/pzaffino/SlicerDensityLungSegmentation/blob/cd207ded376cdac2e8bc9c3850fe3cac55024887/LungCTGMMSegmentation/LungCTGMMSegmentation.py#L136>

---

<div class="post-metadata">

### Author: ![Daniel\_Lo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/daniel_lo/32/77935_2.png) [@Daniel\_Lo](https://discourse.slicer.org/u/Daniel_Lo)
#### Post date: [September 24, 2024, 12:28am UTC](https://discourse.slicer.org/t/slicer-density-lung-segmentation/22751/4 "2024-09-24T00:28:34Z")

</div>

![Screenshot 2024-09-24 at 08.25.23](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/8/e86fd454f609dd202485025bcb44f2e90c5a5507.jpeg)  
Hi, i have tried this, my system is macos, in this case, i have large green area, which was labeled as label\_2, can you help me to understand this part ?
