Use MarkupsROI to crop DICOM in coronal / sagittal view

dhanushkannan
Wed, 05 Jul 2023 03:28:41 +0000
Development

Hi all,
I have used MarkupsROI to crop DICOM images using Python.

the following is the code which I have used for cropping based on ROI

cropVolumeLogic = slicer.modules.cropvolume.logic()
cropVolumeParameterNode = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLCropVolumeParametersNode")
nodeID = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLMarkupsROINode")
cropVolumeParameterNode.SetInputVolumeNodeID(seriesNodeIDs[0])
cropVolumeParameterNode.SetOutputVolumeNodeID(seriesNodeIDs[0])
cropVolumeParameterNode.SetROINodeID(nodeID.GetID())
volumeNode = slicer.util.getNode(seriesNodeIDs[0])
spacing = volumeNode.GetSpacing()
radiusRAS = [(radiusIJK[0]*spacing[0])/2, (radiusIJK[1]*spacing[1])/2, (radiusIJK[2]*spacing[2])/2]
nodeID.SetRadiusXYZ(radiusRAS)

But the problem is, by default, the cropping or SetRadiusXYZ reflects only in Axial view.
I need the cropping to be reflected in the points in Coronal & Sagittal view.

Pls help me to solve this. Thanks in advance!!

1 post - 1 participant