for i, shape_seg in enumerate(shape_seg_list):
shape_seg.crop(bounding_box).pad(5,0)
ERROR:
shape_seg.crop(bounding_box).pad(5,0)
RuntimeError: C:\bdeps\ITK\Modules\Core\Common\src\itkDataObject.cxx:355:
Requested region is (at least partially) outside the largest possible region.
I tried printing the Spatial Coordinate Range of the shape_seg and it is not outside the global bounding_box, but it got an error, I don’t know why.
In your case the bounding box Y coordinates go from -89.4858 to 85.762, but the image only goes from -83.9446 to 81.1488, so the crop size is larger than the image. For this crop function to work, the specified size must be entirely inside the image.
Thank you.
But actually the image Y coordinate goes from -175.0 to 174.125. What you say is just the Y coordinates of the image’s bounding box which comes from sw.ImageUtils.boundingBox([shape_seg], iso_value = 0.5)