Hello everyone,
I’m having troubles exporting results from the parenchyma analysis module in CSV. It only exports the first row without the resulting values. Also, I cannot copy and paste to excel which instead is possible when using the scalar volume module
Sorry, I am new to this and I am also having trouble.
I am not able to export the data in parenchyma analysis in CSV format.
I can only export one parameter each time. Is there a way to export all the results at one go?
I tried using my own segmentation label map volume (using segment editor). My histogram does not look correct. My left lung histogram is flat. I am not sure what I am doing wrong.
How did you segment the lungs? Using Segment Editor module? Have you clicked “Apply” in “Grow from seeds” effect after the preview looked good?
You could also consider using the LungCTAnalyzer extension. If you miss some features (e.g., want to compute histogram) then probably @rbumm could easily add it.
using paint to draw general outlines for right lung, left lung and trachea
Click on grow from seeds and initialize
Add additional areas of paint for regions that need correction
Click on apply under grow from seeds to finalize
Export as new label map volume
Go to parenchyma analysis and select input CT volume and the newly created label map volume
Click on apply
I tried the lung CT segmenter extension as well (using landmarks for right lung, left lung and trachea). I still get the same flat histogram for left lung
You do not have to do lung masks in “Parenchyma Analysis”. Just set the input volume to the lung CT dataset and leave the “Label map volume” set to “None”, then press “Apply”.
I see, thanks! I will try to use the native label map volume from “Parenchyma Analysis” as much as possible.
My only concern is if there are some studies where the automated segmentation by the “Parenchyma Analysis” is not optimal and I have to manually edit some areas. In that case, I am worried that this issue will again recur.
I would also like to ask if there is any way to export the data in “Parenchyma Analysis” as a CSV file?
I am not the developer of this extension but - yes, after “Parenchyma analysis” and if you go into the “Data” extension, you see, that the results of the analysis are stored in table nodes.
The flat histogram looks good, it belongs the trachea (or “other”) segment, which is very small and dark compared to the two lung segments.
The Parenchyma Analysis module probably uses hardcoded label values, which are not the same as the values that are used when you export the segmentation that was created in Lung CT segmentation module. The module should be modernized so that it can use segmentation as input (so that we don’t need to rely on hardcoded label values anymore). The module should also modernized so that for plotting it does not use Charts (that will be removed soon from Slicer) but Plots.
I am not very experienced with Python coding but I will play around with it. Does that mean I can possibly add in my own parameters for analysis (such as other percentile densities instead of the ones provided)?
I realized that if I were to switch the order around in “segment editor”, where “left lung” comes before “right lung”, I will get the histogram for the “left lung” but it will be labelled as “right lung” in “parenchymal analysis”. Essentially, “parenchymal analysis” will create the histogram for the first segmentation accurately but not the others.
This is the original histogram with “right lung” on 1st in order by default:
Yes you could do that, the python code is exposed in that extension.
You would need to switch Slicer to “Enable developer mode” under “Application Settings” > “Developer”, then you would be able to “Edit” and “Reload” the extension code (with great care)
This is the expected behavior if you export the segmentation to labelmap without specifying a mapping from segment names to label values.
You could change the label values quite easily manually, using numpy, but it is more elegant to specify a color mapping from segment names to label values using a color table node. You can create a color node that matches label values of CIP conventions for a few labels like this:
You can then specify this color table when you export the segmentation to labelmap to get the desired label values.
@rbumm if you want to make it easier to use LungCTAnalyzer segmentations with CIP then you could create a color node like this in the segmentation module and set it in the segmentation node. I think it would be used by default when you export the segmentation to labelmap.