<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-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR>hi;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">thanks your reply, I found out a method and I am planing to use it. I found it itksoftwareguide 4.1.3 Accessing pixel data. </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">it is like this:</DIV><FONT face=Courier size=1>
<P style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif" align=left><FONT size=3><STRONG>ImageType::IndexType pixelIndex;</STRONG></FONT></P>
<P style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif" align=left><FONT size=3><STRONG>pixelIndex[0] = 27; // x position</STRONG></FONT></P>
<P style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif" align=left><FONT size=3><STRONG>pixelIndex[1] = 29; // y position</STRONG></FONT></P>
<P style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif" align=left><FONT size=3><STRONG>pixelIndex[2] = 37; // z position</STRONG></FONT></P></FONT><FONT face="Times New Roman">
<P style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif" align=left>
<P align=left><STRONG></STRONG>&nbsp;</P>
<P align=left><STRONG></STRONG></FONT><FONT face="Times New Roman">&nbsp;</P></FONT><FONT face=Courier><STRONG>ImageType::PixelType pixelValue = image-&gt;GetPixel( pixelIndex );</STRONG></P></FONT><FONT face="Times New Roman">
<P style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif" align=left><STRONG>The </STRONG></FONT><STRONG><FONT face=Courier>SetPixel() </FONT><FONT face="Times New Roman">method allows us to set the value of the pixel.</P></FONT></STRONG><FONT face=Courier>
<P style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif" align=left><STRONG>image-&gt;SetPixel( pixelIndex, pixelValue+1 );</STRONG></P>
<P></FONT>&nbsp;</P>
<P>&nbsp;</P>
<P>thanks a lot</P>
<P>Tony</P>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">----- Original Message ----<BR>From: Michael Knopke &lt;Michael.Knopke@gmx.de&gt;<BR>To: vtkusers@vtk.org<BR>Sent: Tuesday, March 6, 2007 2:43:56 PM<BR>Subject: [vtkusers] 3D .raw data density values<BR><BR>
<STYLE>
<!--
 _filtered {font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
text-decoration:underline;}
span.E-MailFormatvorlage17
        {
font-family:Arial;
color:windowtext;}
 _filtered {
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {}
-->
</STYLE>

<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hi Tony,</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I’m not sure if this is alright, so use with care </SPAN></FONT><FONT face=Wingdings size=2><SPAN lang=DE style="FONT-SIZE: 10pt; FONT-FAMILY: Wingdings">J</SPAN></FONT><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">If your dataset is vtkImageData (I guess so) then you can use:</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">vtkImageData-&gt;FindPoint(double x[3]); //where x is in worldspace coordinates</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">But this will only find the closest point belonging to your original dataset. So if you select a point in worldspace that has no direct association to a point in imagedata, the value is not correct.</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Data in between needs to be interpolated. A way to get the interpolated point at a certain position is to use the vtkProbeFilter with your imagedata. But the output depends on what interpolation type you choose (linear/cubic..).</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Please correct me If I’m wrong.</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Regards</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Michael</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;</SPAN></FONT></P></DIV>
<DIV>_______________________________________________<BR>This is the private VTK discussion list. <BR>Please keep messages on-topic. Check the FAQ at: <A href="http://www.vtk.org/Wiki/VTK_FAQ" target=_blank>http://www.vtk.org/Wiki/VTK_FAQ</A><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></DIV></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR></DIV></div><br>

<hr size=1>8:00? 8:25? 8:40? <a href="
http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&#news"> Find a flick</a> in no time<br> with the<a href="
http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&#news">Yahoo! Search movie showtime shortcut.</a></body></html>