<div dir="ltr">Thanks Dean! Will try it.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 24, 2013 at 3:04 PM, Dean Inglis <span dir="ltr"><<a href="mailto:inglis.dl@gmail.com" target="_blank">inglis.dl@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Hi Manuel,<br><br>the example code in<br>Wiki/VTK/Examples/Cxx/Images/PickingAPixel<br>
</div>provides the world coordinates of the picked location. If you want image i,j,k<br></div>
indices, you have to convert those coordinates yourself using the image data's<br></div>origin and spacing information.<br></div>double* o = image->GetOrigin();<br></div>double* s = image->GetSpacing();<br></div>
int x = static_cast<int>( ( x_world_pos - o[0] ) / s[0] + 0.5 );<br><br><div><div><div><div><div>do similar calcs for y and z.<br><br></div><div>regards,<br></div><div>Dean<br></div><div><br><br></div></div></div></div>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Thu, Jun 20, 2013 at 6:39 PM, Manuel Corrales <span dir="ltr"><<a href="mailto:manuelcorrales@gmail.com" target="_blank">manuelcorrales@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hello, <div><br></div><div>I am displaying a DICOM series using vtk and "navigating" through the slices using mouse interaction. I need to pick a pixel from the displayed image, and I expected to get something like an array of coordinates e.g: (142, 342, 13) assuming I can use this to actually fetch the data from the vtkImageData structure.</div>
<div><br></div><div>I tried to use the PickPixel and PickPixel examples from the wiki, but I get coordinates with negative numbers </div><div><br></div><div>(Location: ( -49.3894, 37.2297, -97.2094 )) </div><div><br></div>
<div>and don't know what to do with that. My goal is to be able to pick a pixel, get a coordinate and being able to use that coordinate to fetch the pixel color from the vtkImageData.</div><div><br></div><div>Any hints?</div>
<div><br></div><div>Regards,</div><div>Manuel.</div><div><br></div><div><br></div></div>
<br></div></div>_______________________________________________<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>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>