<!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> </DIV>
<DIV><FONT face=Arial size=2> I have some problems when I try to read
scalar data from each 3D point.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> 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-><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> </DIV>
<DIV><FONT face=Arial> All the values are 0. does anyone know the
reason? I just set the arguememt: component=0 which I found from some
other examples. </FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial> some of mu codes are listed
below:</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial size=2>
deci->Update();<BR> vtkPolyData *colonPoly =
deci->GetOutput();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> long int
numofcell=colonPoly->GetNumberOfCells(); //the number of vtkCell</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> for (int i=0; i<numofcell;
i++)<BR> {<BR>
printf("This is %d cell of the total %d\n", i,
numofcell);<BR> <BR> //all the
vertices (points) contained in the cell<BR>
<BR> //1). get each cell<BR>
vtkCell *colonCell=colonPoly->GetCell(i);<BR>
<BR> //2). get the points<BR>
vtkPoints* colonPts=colonPoly->GetPoints();<BR>
<BR> //3). get each coordinate and access the scalar
data<BR> int
numofpoint=colonCell->GetNumberOfPoints();
<BR> double* coord=
new double [numofpoint];</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> vtkImageData
*colonImg=vtkImageData::New();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> for (int j=0;
j<numofpoint; j++)<BR>
{<BR> int
ptID=colonCell->GetPointId(j);<BR>
<BR> colonPts->GetPoint(ptID,
coord);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> </FONT><FONT
face=Arial size=2> double
inten=colonImg->GetScalarComponentAsDouble((int)coord[0],(int)coord[1],(int)coord[2],0);<BR>
}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> delete []
coord;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> }<BR>
</FONT></DIV>
<DIV><FONT face=Arial size=2> Thanks a lot.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Best WIshes,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Dongqing Chen<BR>Rm. 007, Paul C. Lutz Hall
<BR>Computer Vision & Image Processing (CVIP) Lab<BR>Dept. of Electrical
& 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>
(502)852-2789(Lab)</FONT></DIV></BODY></HTML>