[vtk-developers] Add GetPoint function to vtkStructuredGrid

Berk Geveci berk.geveci at kitware.com
Fri Feb 5 16:55:08 EST 2010


Also, extents can be negative (don't ask me why).

-berk

On Fri, Feb 5, 2010 at 4:44 PM, David Gobbi <david.gobbi at gmail.com> wrote:

> On Fri, Feb 5, 2010 at 2:10 PM, David Doria <daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>>
> wrote:
> > On Fri, Feb 5, 2010 at 1:47 PM, Francois Bertel
> > <francois.bertel at kitware.com> wrote:
> >>
> >> Use vtkStructuredData::ComputePointIdForExtent() to get the point id,
> >> then get the coordinates on the vtkPoints object.
> >>
> >> and your code is wrong:
> >> 1.you passes arguments x,y,z per value
> >> 2.you check and compute against dimensions instead of extent.
> >
> > I didn't say we had to cut and paste this... this is the idea of bouncing
> > things off the mailing list rather than just committing the, right?
> > What is wrong with passing 3 int's by value? I thought you didn't have to
> > pass by reference unless the object was large (so you don't make a local
> > copy).
> > You recommend changing GetDimensions to GetExtent, but isn't it the
> > dimensions of the grid that we are interested in a case like this? The
> > function seems to behave properly.
> > I still think this would be useful, as clearly no one would know to call
> > ComputePointIdForExtent and then get the coordinates of the resulting
> > object. Even if they knew to do that, it is very awkward.
> > Thanks,
> >
> > David
>
> David, you should always use GetExtent, particularly when doing bounds
> checks.  The first point in the dataset is at
> IJK=(extent[0],extent[2],extent[3]), which is not guaranteed to be
> IJK=(0,0,0).
>
> The worst thing is that _most_ vtkImageData are base zero, meaning
> that they start at (0,0,0) as long the whole image is updated at each
> stage of the pipeline.  But as soon as one filter updates just one or
> two slices instead of updating the whole imagedata, code that was
> written to use "Dimension" instead of "Extent" no longer works.
>
> So, I beg you, please study the meaning of "extents" how streaming
> works in the VTK pipeline.
>
>   David
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100205/27d6a5ef/attachment.html>


More information about the vtk-developers mailing list