<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.2802" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi, Users:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; I have some problems when I try to read 
scalar data from each 3D point.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; Now, I have a 3D object with isosurface. On 
the surface, I can get all the coordinates for every vertex, but some problems 
appeared when I tried to read the scalaer data (image intensity data, for pgm 
images) using vtkImageData-&gt;<A class=el 
href="http://www.vtk.org/doc/release/5.0/html/a01511.html#z1071_2"><FONT 
size=3>GetScalarComponentAsDouble</FONT></A><FONT size=3> (int x, int y, int z, 
int component).</FONT></FONT></DIV>
<DIV><FONT face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial>&nbsp;All the values are 0. does anyone know the 
reason?&nbsp; I just set the arguememt: component=0 which I found from some 
other examples. </FONT></DIV>
<DIV><FONT face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial>&nbsp;some of&nbsp; mu codes are listed 
below:</FONT></DIV>
<DIV><FONT face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; 
deci-&gt;Update();<BR>&nbsp;&nbsp;&nbsp; vtkPolyData *colonPoly = 
deci-&gt;GetOutput();</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; long int 
numofcell=colonPoly-&gt;GetNumberOfCells(); //the number of vtkCell</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; for (int i=0; i&lt;numofcell; 
i++)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
printf("This is %d cell of the total %d\n", i, 
numofcell);<BR>&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp; //all the 
vertices (points) contained in the cell<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
<BR>&nbsp;&nbsp;&nbsp;&nbsp; //1). get each cell<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
vtkCell *colonCell=colonPoly-&gt;GetCell(i);<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
<BR>&nbsp;&nbsp;&nbsp;&nbsp; //2). get the points<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
vtkPoints* colonPts=colonPoly-&gt;GetPoints();<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
<BR>&nbsp;&nbsp;&nbsp;&nbsp; //3). get each coordinate and access the scalar 
data<BR>&nbsp;&nbsp;&nbsp;&nbsp; int 
numofpoint=colonCell-&gt;GetNumberOfPoints(); 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double* coord= 
new double [numofpoint];</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp; vtkImageData 
*colonImg=vtkImageData::New();</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp; for (int j=0; 
j&lt;numofpoint; j++)<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int 
ptID=colonCell-&gt;GetPointId(j);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; colonPts-&gt;GetPoint(ptID, 
coord);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT><FONT 
face=Arial size=2> double 
inten=colonImg-&gt;GetScalarComponentAsDouble((int)coord[0],(int)coord[1],(int)coord[2],0);<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; delete [] 
coord;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; 
</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;Thanks a lot.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Best WIshes,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Dongqing Chen<BR>Rm. 007, Paul C. Lutz Hall 
<BR>Computer Vision &amp; Image Processing (CVIP) Lab<BR>Dept. of Electrical 
&amp; Computer Engineering<BR>University of Louisville<BR>Louisville, KY. 
40292<BR>U.S.A.<BR>Email: <A 
href="mailto:dqchen@cvip.louisville.edu">dqchen@cvip.louisville.edu</A><BR>Phone: 
(502)852-6130(Office)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
(502)852-2789(Lab)</FONT></DIV></BODY></HTML>