<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">Sergi,<br><br>I'll assume some points before put these solution:<br>1 - You have the coordinates;<br>2 - You was rescaled/shifted the image to view ( I think the solution can works if not shifted/rescaled too );<br>3 - You are using C++.<br><br>This piece of code will do it for you, and are based on another piece of code of vtkImagePlaneWidget class:<br><br><br>double YourClass::computeScalarValue( double *coords)<br>{<br>&nbsp; if(!ImageData || !coords ) return 0.0;<br><br><br>&nbsp; double tol2;<br>&nbsp; vtkCell *cell;<br>&nbsp; vtkPointData *pd;<br>&nbsp; int subId;<br>&nbsp; double pcoords[3], weights[8];<br><br><br>&nbsp; pd = ImageData-&gt;GetPointData();<br><br>&nbsp; vtkPointData* outPD = vtkPointData::New();<br>&nbsp;
 outPD-&gt;InterpolateAllocate(pd, 1, 1);<br><br>&nbsp; tol2 = ImageData-&gt;GetLength();<br>&nbsp; tol2 = tol2 ? tol2*tol2 / 1000.0 : 0.001;<br><br>&nbsp; cell = ImageData-&gt;FindAndGetCell(coords,NULL,-1,tol2,subId,pcoords,weights);<br>&nbsp; if (cell)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; outPD-&gt;InterpolatePoint(pd,0,cell-&gt;PointIds,weights);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return outPD-&gt;GetScalars()-&gt;GetTuple1(0);<br>&nbsp;&nbsp;&nbsp; } else {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return -1;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>&nbsp; outPD-&gt;Delete();<br>}<br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Mensagem original ----<br>De: Sergi Dote &lt;sergidt@gmail.com&gt;<br>Para: vtkusers@vtk.org<br>Enviadas: Quinta-feira, 26 de Abril de 2007 9:08:02<br>Assunto: [vtkusers] gray value of image<br><br>Hello vtkUsers, I need your
 knowledge:<br><br>I work with a volume (gray CT) and  I want to get the gray value of a point of this volume specified by world coordinates; this is, for example I ask what is gray value of a point Xmin=
33.2 Xmax =123.2 Ymin=14.1 Ymax=15.6 Zmin=11 Zmax=11 and I need to have this value.<br><br>Somebody knows how can I do this?<br><br>thank you very much!!<br clear="all"><br>-- <br>.: Sergi Dote Teixidor :.
<div>_______________________________________________<br>This is the private VTK discussion list. <br>Please keep messages on-topic. Check the FAQ at: <a target="_blank" href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><br>Follow this link to subscribe/unsubscribe:<br><a target="_blank" href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><br></div></div><br></div></div><br>__________________________________________________<br>Fale com seus amigos  de graça com o novo Yahoo! Messenger <br>http://br.messenger.yahoo.com/ </body></html>