How to set coordinate of Dicom file?

Hello all, I have a dicom file. I open it on ITK-snap with the coordinate is 0
Screenshot from 2020-02-05 19-57-36

Then, I open it on Slicer, and create an ROI on the image.

    # Create ROI
    roiNode = slicer.vtkMRMLAnnotationROINode()
    roiNode.SetXYZ(0, 0, 0)
    roiNode.SetRadiusXYZ(25,40,65)
    roiNode.Initialize(slicer.mrmlScene)

However, the center point locates on an unexpected location (not the center of the image as the figure below). If I want the center of the ROI locates on center of the image, How can I do it? Thanks
Screenshot from 2020-02-05 20-04-59

The origin is the starting point of your dicom image slices. My guess is that the roi origin is at the right place. If you need to calculate the midpoint of your volume, take its dimensions and divide by 2.

I would use something like

roiNode.SetXYZ(400, 300, 34)
1 Like

roiNode.SetXYZ(400, 300, 34)

Thanks for your suggestion. It should be change to roiNode.SetXYZ(-400, -300, 34) instead of roiNode.SetXYZ(400, 300, 34)