Compute surface area in segment based on Hounsfield units (CT-images)

Dear all,

I hope you guys can help. I’m relatively new to 3D slicer. I am using the 4.11 version.
My goal is to compute skeletal muscle area in a single CT-slice.

I have loaded the CT and have created a segment using the segment editor. I manually outlined all the muscles in a single segment. If I go to the segment analysis, I can convert the segment to a model and I can calculate the surface area of this segment.

However, I am trying to calculate only the surface area of the pixels that have hounsfield units between -29 and +150, not the area of the entire segment. The main reason is to remove fatty tissue inside muscles from the calculation.
Is there a way in 3d Slicer to achieve this?

Thanks a lot in advance,
Best,
Justin

We developed a module for this with @hherhold some time ago, now I’ve touched it up and pushed it into Sandbox extension. You can download it tomorrow in latest Slicer Preview Release. The Sandbox extension is in Examples category, after you install it, the “Segment Cross-Section Area” module should show up in Quantification category.

Dear Andras,

Thanks very much for your quick reply and solution!
Once the module is available I’ll try it out.

Best, Justin

Nightly build was not successful on Windows last night but tomorrow it should be OK. If you want to try it earlier then you can download the repository from github and add the SegmentCrossSectionArea folder to the additional module paths in Slicer application settings.

Thanks very much Andras,
I noticed the windows version wasn’t updated, but I was able to install the module manually with your instruction.

I also found out that I could filter out the relevant HU range using the section editor, so I have all I need.

Thanks again,
Best, Justin

1 Like

A post was split to a new topic: Automating thresholding of existing segments

Can the SegmentCrossSectionArea also be reached through script?
I’ve looked up the script and tried

areaNode = slicer.mrmlScene.AddNewNodeByClass(“SegmentCrossSectionAreaWidget(ScriptedLoadableModuleLogic)”)
tableNode = slicer.mrmlScene.AddNewNodeByClass(“vtkMRMLTableNode”, “Segment cross-section area table”)
plotChartNode = slicer.mrmlScene.AddNewNodeByClass(“vtkMRMLPlotChartNode”, “Segment cross-section area plot”)
logic = SegmentCrossSectionAreaLogic()
logic.run(segmentationNode, masterVolumeNode, “slice”, tableNode, plotChartNode)
logic.showChart(plotChartNode)

I get the error that SegmentCrossSectionAreaLogic is not defined.
Unfortunately I cannot make much more of the python script to see how SegmentCrossSectionAreaLogic should be defined or how I can add the right node so that it will work.

Do you have a suggestion?

The module’s automatic test serves as an example of how to use the module from a script:

If you run the code from a different file then of course you need to import the module or the classes that you use from them. For example, you can import the logic class by calling:

from SegmentCrossSectionArea import SegmentCrossSectionAreaLogic
logic = SegmentCrossSectionAreaLogic()
1 Like

Thanks, I found the example but I did not know I needed to import

As you say, I just followed the rest of the test module to work run the model from script.

1 Like