<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>hi all;</DIV>
<DIV>I have some specific coordinates(x,y,z).&nbsp; and 3D image which extension is <EM>raw.&nbsp; </EM>I would like to get these coordinates scalars (grey level value) by interpolating.&nbsp; I found out an example which seems what I would like to do. but in the following code I couldn't understand first&nbsp; part of&nbsp;it&nbsp;where I show with red. &nbsp; How ca i set the variable of <EM>output</EM>,<EM>input</EM> ? I could not understand the method of using <FONT color=#0000ff><STRONG>this-&gt;........</STRONG> </FONT><FONT color=#000000><STRONG>Could someone help me on that confusing situation? I really need it much!</STRONG></FONT></DIV>
<DIV><STRONG>Thanks</STRONG></DIV>
<DIV><STRONG></STRONG>&nbsp;</DIV>
<DIV><STRONG></STRONG>&nbsp;</DIV>
<DIV><STRONG>here is example code:</STRONG></DIV>
<DIV>void vtkCellDataToPointData::Execute()<BR>{<BR><FONT color=#ff0000><STRONG>&nbsp; vtkIdType cellId, ptId;<BR>&nbsp; vtkIdType numCells, numPts;<BR>&nbsp; vtkDataSet *input= <FONT color=#0000ff>this-&gt;</FONT>GetInput();<BR>&nbsp; vtkDataSet *output= <FONT color=#0000ff>this-&gt;</FONT>GetOutput();<BR>&nbsp; vtkCellData *inPD=input-&gt;GetCellData();<BR>&nbsp; vtkPointData *outPD=output-&gt;GetPointData();<BR>&nbsp; vtkIdList *cellIds;</STRONG></FONT><BR>&nbsp; float weight, *weights=new float[VTK_MAX_CELLS_PER_POINT];<BR><BR>&nbsp; vtkDebugMacro(&lt;&lt;"Mapping cell data to point data");<BR><BR>&nbsp; // First, copy the input to the output as a starting point<BR>&nbsp; output-&gt;CopyStructure( input );<BR><BR>&nbsp; cellIds = vtkIdList::New();<BR>&nbsp; cellIds-&gt;Allocate(VTK_MAX_CELLS_PER_POINT);<BR><BR>&nbsp; if ( (numPts=input-&gt;GetNumberOfPoints()) &lt; 1 )<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; vtkErrorMacro(&lt;&lt;"No input point
 data!");<BR>&nbsp;&nbsp;&nbsp; cellIds-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; return;<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp; <BR>&nbsp; // Pass the point data first. The fields and attributes<BR>&nbsp; // which also exist in the cell data of the input will<BR>&nbsp; // be over-written during CopyAllocate<BR>&nbsp; output-&gt;GetPointData()-&gt;PassData(input-&gt;GetPointData());<BR><BR>&nbsp; // notice that inPD and outPD are vtkCellData and vtkPointData; respectively.<BR>&nbsp; // It's weird, but it works.<BR>&nbsp; outPD-&gt;CopyAllocate(inPD,numPts);<BR><BR>&nbsp; int abort=0;<BR>&nbsp; vtkIdType progressInterval=numPts/20 + 1;<BR>&nbsp; for (ptId=0; ptId &lt; numPts &amp;&amp; !abort; ptId++)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; if ( !(ptId % progressInterval) )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this-&gt;UpdateProgress((float)ptId/numPts);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; abort = GetAbortExecute();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 }<BR><BR>&nbsp;&nbsp;&nbsp; input-&gt;GetPointCells(ptId, cellIds);<BR>&nbsp;&nbsp;&nbsp; numCells = cellIds-&gt;GetNumberOfIds();<BR>&nbsp;&nbsp;&nbsp; if ( numCells &gt; 0 )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; weight = 1.0 / numCells;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (cellId=0; cellId &lt; numCells; cellId++)<BR>        {<BR>        weights[cellId] = weight;<BR>        }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; outPD-&gt;<B style="COLOR: black; BACKGROUND-COLOR: #ffff66">InterpolatePoint</B>(inPD, ptId, cellIds, weights);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; outPD-&gt;NullPoint(ptId);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; }<BR><BR>&nbsp; if ( this-&gt;PassCellData )<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; output-&gt;GetCellData()-&gt;PassData(input-&gt;GetCellData());<BR>&nbsp;&nbsp;&nbsp; }<BR><BR>&nbsp; cellIds-&gt;Delete();<BR>&nbsp;
 delete [] weights;<BR>}<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>