question about image bounds

I have a volume image with the size of 192 x 256 x 256. The spacing of the image is 1. I use GetBounds(). The result is 0, 191, 0, 255, 0, 255. In my understanding, the result should be 0, 192, 0, 256, 0, 256. Is that right?

Every vtkDataSet has “bounds”: bounding box coordinates in the renderer’s coordinate system. Do not confuse this with image extents or dimensions.

Image “extents” specify first and last voxel coordinates of the image along each axis. This definition is simple, but I agree that it is somewhat unusual and typically requires extra attention, because image dimension does not equal to difference of extents. For an image size of 192x192x256 extents will be 0, 191, 0, 191, 0, 255. You can get image size (extent[2*axis+1]-extent[2*axis]+1) using GetDimensions() method.

Oh, I see. I’ll take your advice. Thanks. I have another question about image bounds, here is the post(question about slice of vtkResliceImageViewer). Can you give me some tips? Thank you!!