<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi everybody!!!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I'm trying to directly access to image voxels. 
</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I first tried this :</FONT></DIV>
<DIV><FONT face=Arial size=2>float* 
voxel=(float*)(mon_grad-&gt;GetOutput()-&gt;GetScalarPointer(x,y,z));</FONT></DIV>
<DIV><FONT face=Arial size=2>voxel[0] contains the value of voxel placed in x, y 
and z so it works well...</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; BUT </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I need to use the more complicated way 
:</FONT></DIV>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>float* 
voxel=(float*)(mon_grad-&gt;GetOutput()-&gt;GetScalarPointer());</FONT></DIV></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>In this case voxel is a pointer on the first 
element of a 1 dimensional Tab....</FONT></DIV>
<DIV><FONT face=Arial size=2>Does anyone knows 
how&nbsp;this&nbsp;structure&nbsp;is really made???</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I tried to get the x,y,z voxel by doing 
:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>voxel[x+y*dim(x)+z*dim(x)*dim(y)] or</FONT></DIV>
<DIV><FONT face=Arial size=2>voxel[z+y*dim(z)+x*dim(x)*dim(z)] or 
others....</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>And it never worked or is never the same&nbsp;voxel 
then when I use the first method!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>So please help me : what is the magic formula to 
get the right voxel from a </FONT></DIV>
<DIV><FONT face=Arial size=2>float* 
voxel=(float*)(mon_grad-&gt;GetOutput()-&gt;GetScalarPointer());</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks by advance!</FONT></DIV><FONT face=Arial 
size=2>
<DIV><BR>&nbsp;</DIV>
<DIV>Matei </DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV></FONT>&nbsp;</DIV></BODY></HTML>