[vtkusers] bounds argument in vtkBox::IntersectWithLine()

David Gobbi david.gobbi at gmail.com
Wed Mar 18 15:15:48 EDT 2015


You can define "outside" to be whatever you want, but VTK defines "outside
the bounds" to mean "beyond the data points that form the edge of the data
set."  :)

If, for example, I wanted to intersect a line with the first and last slice
of the volume, I would _not_ add 0.5*spacing.  But that's because I
consider my "slice" to be an infinitesimally thin object.  So according to
my definition of "slice", the distance between one end of the volume and
the other is 99 times the spacing.

Really, how you define things will depend partly on the requirements of
your application.  I'm just saying what my own definitions are.

 - David


On Wed, Mar 18, 2015 at 12:58 PM, Maarten Beek <beekmaarten at yahoo.com>
wrote:

> Hi David,
>
> To clarify.
> Since "the bounds of avolume start and end in the center of the corner
> voxels.", I would have to expand the bbox in all directions by 0.5*spacing
> to get the intersections with the 'outside' planes of the image? And the
> distance between one 'outside' and its opposite 'outside' would be 100
> times the spacing?
>
> Maarten
>
>
>
>   On Wednesday, March 18, 2015 9:42 AM, David Gobbi <david.gobbi at gmail.com>
> wrote:
>
>
> Hi Maarten,
>
> If you used (0, 13, ...) then you'd get the wrong answer.  The bounds of a
> volume start and end in the center of the corner voxels.  If the first
> voxel
> is 0 and the last voxel is 99, then the real-world dimension of the volume
> is
> 99 times the spacing.
>
> A voxel is a data point.  Emphasis on "point".  If you have a series of
> data
> points, anything before the first point or after the last point is outside
> of the
> bounds of the data points.
>
>  - David
>
>
> On Wed, Mar 18, 2015 at 7:23 AM, Maarten Beek via vtkusers <
> vtkusers at vtk.org> wrote:
>
> Hi all,
>
> For an image with dims = (100, 100, 100) and spacing = (0.13, 0.13, 0.13),
> vtkImageData::GetBounds() returns
> (0, 12.87, 0, 12.87, 0, 12.87)
>
> If I use these bounds as argument in vtkBox::IntersectWithLine, do I get
> the correct intersections?
> Or should I use (0, 13, 0, 13, 0, 13) for the bounds?
>
> Thanks - Maarten
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150318/67a2777d/attachment.html>


More information about the vtkusers mailing list