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