Extracting Bounding Box information from an image

HI! Is there a way to load nifty image and extract its bounding box coordinates from it? If I am not mistaken, bounding box within nifty image is called largest possible region in ITK, correct?

I would like to measure hight of the bounding box to try and quantify how much of a specific anatomy is contained within an image.

Largest possible region is measured in index (ijk) coordinates, you probably want physical coordinates. Go through 8 corners of the image, and for each of them call TransformIndexToPhysicalPoint. From those 8 points with coordinates in millimeters you can asses “height” of the field of view.

So if I understood correctly I would first call LargestPossibleRegion to get index coordinates. And then go through 8 corners of the largest possible region and call TransformIndexToPhysicalPoint. Correct?

1 Like


Additionally, the itk::ImageSpatialObject class can be used to compute the bounding box.