Also, extents can be negative (don't ask me why).<br><br>-berk<br><br><div class="gmail_quote">On Fri, Feb 5, 2010 at 4:44 PM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">On Fri, Feb 5, 2010 at 2:10 PM, David Doria <<a href="mailto:daviddoria%2Bvtk@gmail.com">daviddoria+vtk@gmail.com</a>> wrote:<br>

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