Hi all, I have the following situation when working with a dataset where a MR has been fused to the base CT scan:
In the MR, I paint a segmentation object in the segment editor via the sphere brush and print the origin of the object (see below for code)
I save the segmentation object to my local machine and load it again into slicer via the DICOM module. The origin of the loaded object does not coincide with the origin of the painted object, although the objects are shown on top of each other in the views.
This is the code to retrieve the origin:
segm = node.GetSegmentation() binaryLabelmapPresent = segm.CreateRepresentation( slicer.vtkSegmentationConverter.GetSegmentationBinaryLabelmapRepresentationName()) segment = segm.GetNthSegment(0) labelMapName = vtkSegmentationCore.vtkSegmentationConverter.GetSegmentationBinaryLabelmapRepresentationName() vtkOrientedImageData = segment.GetRepresentation(labelMapName) origin = vtkOrientedImageData.GetOrigin()
Do you see a problem with the code or can you please explain why the two origins differ?