Exporting segmentation to another software

Hi all,

I am exporting a segmentation (as .seg.nrrd) from Slicer to Matlab using nrrdread function provided by Slicer Matlab Bridge. I realized that, when I plug in the coordinates of the reference MRI (specified as source geometry) I sometimes cannot replicate the segments as they are in Slicer. It is as if they are somewhat shifted or segmented, etc. It is not like the whole segmentation is read wrong in Matlab, because most of the coordinates are correct.

I just want to be able to replicate in Matlab what I am seeing in Slicer, so that when I plug in the coordinates of the MRI image I get the segment at that particular location.
Everything else seems consistent (sizes of the segmentation, names, etc.)

Any ideas ? I tried a bunch of things, eg., exporting the segmentation in different ways, labelmap,.nii, . But all have the same problem.

Thanks !

Previously, Slicer cropped the segmentation to the minimum necessary size on save. Current Slicer versions save the segmentation with the same extent as the first master volume, so voxel coordinates should match.

Yes, I observed this behavior by comparing versions 4.10 and 4.11.

But I am sure that this problem is present . Because I am manually plugging in the coordinates and observing the results.

Any suggestions ? (I am using 4.11)

Can I ask a very simple question, to make sure that I don’t misunderstand the basic steps :
While saving the segmentation:
I just save the segmentation node (.seg.nrrd ) file.
And then read it to matlab with nrrdread
And then plug in the coordinates of the source geometry MRI image.
Is there anything which sounds wrong to you ?

Thank you so much.