[vtkusers] problem with GetNumberOfPoints () and GetNumberOfCells ()
Marco Kassner
kassner at cs.tu-berlin.de
Thu Feb 21 18:43:49 EST 2002
Hello.
This is my first mail to the group.
I develop a program which reads voxel data and calculates Spinmaps.
Representing the data works easily but I have a problem to access the
PolyData.
I receive the result null for the function GetNumberOfPoints () and
GetNumberOfCells ().
Please, can somebody tell me, which filter I still need or where the error
is ?
It would be great, if somebody can help me.
My program:
// first data read
vtkVolume16Reader *v16 = vtkVolume16Reader::New();
v16->SetDataDimensions(64,64);
v16->SetDataByteOrderToLittleEndian();
v16->SetFilePrefix ("D:\\VTK32\\vtkdata\\headsq\\quarter");
v16->SetImageRange(1, 93);
v16->SetDataSpacing (3.2, 3.2, 1.5);
// extract the skin
vtkContourFilter *skinExtractor = vtkContourFilter::New();
skinExtractor->SetInput(v16->GetOutput());
skinExtractor->SetValue(0, 500);
vtkStripper *skinStripper = vtkStripper::New();
skinStripper->SetInput(skinExtractor->GetOutput());
// forcing triangles
vtkTriangleFilter *skinTriangleFilter = vtkTriangleFilter:: New() ;
skinTriangleFilter->SetInput(skinStripper->GetOutput()) ;
// data reduce
vtkDecimate *skinDecimate = vtkDecimate::New();
skinDecimate->SetInput(skinTriangleFilter->GetOutput());
skinDecimate->SetAspectRatio (20.0);
skinDecimate->SetInitialError (0.0005);
skinDecimate->SetErrorIncrement (0.001);
skinDecimate->SetMaximumIterations (10);
skinDecimate->SetMaximumNumberOfSquawks (0);
skinDecimate->PreserveEdgesOff () ;
// type PolyData
vtkPolyData *polydatatemp = vtkPolyData::New();
polydatatemp = skinDecimate->GetOutput() ;
printf ("\nGetNumberOfPoints = %i",polydatatemp->GetNumberOfPoints()) ; // output = 0
printf ("\nGetNumberOfCells = %i",polydatatemp->GetNumberOfCells()) ; // output = 0
Thanks, Marco
\|/
(o o)
--------------------------------------------------------oOOo-(_)-oOOo------
Marco Kassner:
e-mail: kassner at cs.tu-berlin.de
PS: Make it as simple as possible, but not simpler. (A.E.)
-------------------------------------------------------------------------------
More information about the vtkusers
mailing list