# Autosegmentation of problematic Lung CT

**URL:** <https://discourse.slicer.org/t/autosegmentation-of-problematic-lung-ct/23915>\
**Category:** Support\
**Tags:** monailabel\
**Created:** [June 17, 2022, 5:26pm UTC](https://discourse.slicer.org/t/autosegmentation-of-problematic-lung-ct/23915 "2022-06-17T17:26:26Z")\
**Posts on this page:** 2\
**Page:** 1

<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 17, 2022, 5:26pm UTC](https://discourse.slicer.org/t/autosegmentation-of-problematic-lung-ct/23915/1 "2022-06-17T17:26:26Z")

</div>

During the preparation for the MONAILabel workshop, I noticed that in the public ML Task06\_lung dataset there are several datasets with strange contrasts that display very “dark” initially.  
Example: lung\_049

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/4/244cb4d1c826feca4e4bb7a57121487c2a8ec947.jpeg)

These data are difficult for both manually assisted as well as AI segmentation. How do you guys handle these data? Could preprocessing help here?

---

<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:** [June 17, 2022, 6:13pm UTC](https://discourse.slicer.org/t/autosegmentation-of-problematic-lung-ct/23915/2 "2022-06-17T18:13:41Z")

</div>

This has been discussed here:

> <https://github.com/Project-MONAI/MONAILabel/issues/447>
>
> We have had some feedback from clinical partners regarding setting of window for… highlighting different organs.
> The window/levels are defined typically by window width (WW) and window level (WL). This is then used in the following formula to set the min/max levels for CT images.
> w\_min = WL - WW/2
> w\_max = WL+WW/2
> 
> More info about this can be found here: https://radiopaedia.org/articles/windowing-ct?lang=gb
> 
> There are known WL/WW values for different organs/tissues (as listed in the above link). 
> 
> For example, a lung window is typically defined as WW=1500 and WL=-600. This has the following effect on visualizing the image volume:
> 
> Before applying lung window:
> !\[image\](https://user-images.githubusercontent.com/3410225/136550503-66fc1ba3-14f2-405a-8e06-afad4c3fc47f.png)
> 
> After applying lung window (WW=1500, WL=-600):
> !\[image\](https://user-images.githubusercontent.com/3410225/136550684-ba7a0ca4-9757-4de9-96c5-d132a8b30165.png)
> 
> You can notice that it highlights tissues/lesions inside lung better. The above is just one example, the values for WW/WL can vary for different organs and institute.
> 
> In 3D Slicer, the above can be achieved as:
> \`\`\`
> WL=-600; WW=1500
> volumeNode = slicer.mrmlScene.GetFirstNodeByClass("vtkMRMLScalarVolumeNode")
> volumeNode.GetDisplayNode().SetAutoWindowLevel(False)
> volumeNode.GetDisplayNode().SetWindowLevelMinMax(WL-WW/2, WL+WW/2)
> \`\`\`
> 
> Does this sound like something we can pass as argument from an app as default, given that we know the target organ/tissue and its WL/WW. In cases where these are not present, we can skip updating the above. In other cases where the user wants to change these, there is a window level button that can be used to adjust manually. 
> 
> cc: @tvercaut

Add a comment there, describing why it is a problem for you.
