I’m working on an extension to generate a bounding box based on 6 or more points placed on the extreme boundaries of a region of interest (e.g., a tumor).
Setup:
- The user loads multiple MR sequences from a single scan session, and selects one sequence to define the points. Images may be of different sizes and FOV, but are registered in the world coordinate.
- These points (minimum of 6) are placed on or near the extreme boundaries of the tumor. A bounding box is generated based on these points.
- The user then inspects other sequences to verify that the bounding box fully covers the ROI. If not, the user can manually adjust the box.
- The final bounding box is saved as a segmentation (NIfTI) for each MR image.
The problem I’m facing is that the selected points and the generated bounding box are in world coordinates , while I’d like the bounding box to align with RAS coordinates . Now I register the bounding box to every image and save them.
To achieve this, I register the bounding box to each image, then generate a vtkMRMLLabelMapVolumeNode
, and finally update a vtkMRMLSegmentationNode
to save it as a segmentation in NIfTI format.
However, this workflow is tedious, and there’s a disconnect: the box the user adjusts is not the one that is ultimately saved. As shown in the figure, the box with bright-green edge is what the user manipulates, while the colored box (in RAS) is the final saved segmentation.
My Question:
Is there a way in 3D Slicer to allow the user to directly adjust the bounding box in RAS coordinates for my case, so that the edited version is the same as the final output—without needing to separately register from world to RAS?