Cross-sectional area and line profile

Hi, I am wondering how you would go about creating a graph in slicer of the cross sectional area changes as you go from one side of a model to another, and the same for the line profiles for the cross-section as you go from one side to another. Also, if possible, is there a method to extract the average line profile from a mesh? To give you more background, I am trying to perform these analyses on meshes of clavicles that I segmented to analyze radiodensity and cross-sectional area differences.

how you would go about creating a graph in slicer of the cross sectional area changes as you go from one side of a model to another

You can use vtkCutter to get cross-section polygons along the line profile and VTK can compute the cross-sectional area. Probably 10-15 lines of simple Python script.

You can convert your model to Segmentation, export to labelmap, use Extract Skeleton module to get points along the centerline, and can fit a line to these centerline points.

Once you get the skeleton, how can you get the line profile in slicer? Also, is it possible to give me an example script for the vtkCutter?

Skeleton can return markup fiducials (in recent nightly versions), which you can use with MarkupsToModel module to generate a smooth, interpolated line. You go along that line and generate a cutting plane (compute plane position and normal using basic vector algebra) and set it as input to vtkCutter.

VTK examples website contains fully functional examples for all VTK classes. For example, here is one for vtkCutter: https://lorensen.github.io/VTKExamples/site/Java/Miscellaneous/Cutter/

I’m confused how this gives you a line profile for intensity values?

I though you mean cross-sectional area profile. Intensity profile along a line is even simpler, see https://github.com/lassoan/SlicerLineProfile/blob/master/LineProfile/LineProfile.py

That helped thank you.

1 Like

Hi everyone,

About the LineProfile.py script, I don’t know how to implement it as a additional module in 3D Slicer.

Can anyone may give me the instructions or a tutorial link in this purpose, please?

Sorry if the question seems too much straightforward.

Jonathan

Have you completed the Slicer programming tutorial yet? It would be a good start. If you have questions then let us know.

I know it’s been a while since this question was last asked, but I wanted to give a more detailed solution on how I personally installed the Line Profile extension.

  1. Download the entire github repository and extract the folder from .zip
  2. Go to Slicer --> Extension Wizard module --> Select Extension
  3. Select the entire folder that you just extracted

Once you do all these steps, you should see Line Profile in your extensions.

I’ve followed all the steps detailed by ycpan but this error message popped up "The ._LineProfile module could not be registered.

We have added line profile module to SlicerSandbox extension (in Examples category), so you don’t need to manually download and install the module anymore.

2 Likes