Getting ROI bounds from vtkMRMLMarkupsROINode

Because the new Markups ROI can be rotated freely, using a normal bounds with 6 values doesn’t always work. GetBounds()/GetRASBounds() returns the axis-aligned bounds, so it will be correct if the ROI is axis-aligned. In the image below, the magenta cube will be the bounds that are returned by GetBounds() if the ROI is rotated.

The way to get the OBB in any orientation would be to use the GetPlanes()/GetPlanesWorld() functions, which return the planes for the 6 faces of the ROI.

If you are checking whether or not a point is in the ROI, also consider the IsPointInROI()/IsPointInROIWorld() functions.

GetBoundsROI() returns the bounds in the axis-aligned ROI coordinate system, with the center of the ROI at (0,0,0). It is mostly used internally, and should probably be made into a protected function.