<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Hi Cory,<DIV><BR class="khtml-block-placeholder"></DIV><DIV>Thanks, I'll keep your advice in mind.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Regards,</DIV><DIV>Andres</DIV><DIV><BR><DIV><DIV>On 22/07/2006, at 11:54AM, Cory Quammen wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV>Here's a simpler way to grab values from a vtkImageData object:<BR><BR>vtkImageData *foo = ...;<BR>double scalar = foo-&gt;GetScalarComponentAsDouble(x, y, z, component);<BR><BR>where component = 0 if you have just one scalar component in your image. <BR> <BR>It may be slow if you are looping through your entire image, though, so you may want to use the method described by Chase and Torsten. But if you want just one value or several values, the above works pretty well. <BR><BR>Cory<BR></DIV><BR><BLOCKQUOTE style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">Hi Andres,<BR><BR>Here is one way to do it:<BR><BR>vtkImageData *foo; <BR>int *dimensions = foo-&gt;GetDimensions();<BR>pixelValue =<BR>foo-&gt;GetPointData()-&gt;GetScalar<DIV style="direction: ltr;">s()-&gt;GetTuple1(x+y*dimensions[0]+z*dimensions[0]*dimensions[1]);<BR><BR>Anyone have a better way? <BR><BR>Chase Yarbrough<BR><BR>Andres Munarriz wrote:<BR>&gt; Hi everyone,<BR>&gt;<BR>&gt; I'm pretty sure someone has already posted a similar question if not<BR>&gt; the same (for this I apologize), but I haven't been able to find such <BR>&gt; post.  Is there a way to retrieve the pixel intensity at a particular<BR>&gt; index from a vtkImageData object?  Under ITK one can " make" the index<BR>&gt; then get the pixelData from it.<BR>&gt;<BR>&gt; <BR>&gt; Thanks in advance,<BR>&gt;<BR>&gt; Andres E. Munarriz Soto</DIV></BLOCKQUOTE><BR clear="all"><BR>-- <BR>Cory Quammen<BR>University of North Carolina at Chapel Hill<BR><A href="http://www.cs.unc.edu/~cquammen">http://www.cs.unc.edu/~cquammen </A><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">This is the private VTK discussion list.<SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Please keep messages on-topic. Check the FAQ at: <A href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Follow this link to subscribe/unsubscribe:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</A></DIV> </BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>