Segmentation Transform

Hi all,

I have a segmentation (similar to an atlas but includes only specific anatomical regions) and an MRI and I need to figure out how Slicer aligns them. When I open and plot them in Matlab, they are not aligned. Basically it seems like their origins are different. Slicer somehow apples the correct transformation and I need to figure out what it is.

When I check the Transforms module, I don’t see any transforms applied to the Segmentation. I don’t understand why…

Any suggestions ?

Thank you !

When you export the segmentation have you select the correct coordination system ? Both RAS and LPS is available and by default it is set to RAS.

You have two options:

  • take into account pixel<->physical coordinate system mapping that is saved into the segmented image (it is available in IJK to LPS transformation matrix provided by the nrrd reader)
  • export the labelmap into the same image geometry as the input image (this is the default behavior in recent Slicer-4.11 versions, but if you use an older Slicer version then you may need to select the input image as reference volume manually when you export the segmentation to labelmap)

I would recommend to move on from Matlab to Python, as Python has so many more and much better tools for medical image computing, you can implement complete application workflows (from server-side processing to end-user GUI), there are no licensing hassles, etc. I’ve implemented Slicer’s MatlabBridge extension because 5-10 years ago it still made sense to use Matlab for some problems, but nowadays it is very hard to justify choosing Matlab over Python.