[vtkusers] Meaning of Bounds
David Gobbi
david.gobbi at gmail.com
Thu Nov 29 11:11:28 EST 2012
Hi Ian,
The bounds are measured from the leftmost sample in the data set to
the rightmost sample in the data set. For vtkImageData, the sample
points are at the centers of the pixels/voxels. It's best to think of
an image as a regular grid of sample points, rather than to think of
an image as a bunch of small rectangles.
- David
On Thu, Nov 29, 2012 at 8:18 AM, ianl <ilindsay at insigniamedical.co.uk> wrote:
> Hi all, maybe someone can point me to my error in thinking here. I came
> across this when investigating some strange 'out by 1' issues.
>
> I am trying to understand the meaning of 'Bounds' with respect to the
> vtkImageData class, as obtained via the GetBounds method. If I have an image
> which is 4 pixels wide (with extent 0 to 3 on the x axis), origin of 0,0,0
> and a spacing of 1mm, I would expect the bounds to be 0 and 4, ie the left
> edge of the left most pixel and the right edge of the right most pixel. What
> I seem to be getting is 0 and 3. I notice that the ComputeBounds function
> does the calculation, and does not seem to take the right hand edge of the
> right most pixel.
>
> What am I missing here?
>
> Ian Lindsay
More information about the vtkusers
mailing list