[vtkusers] Error with vtkSmoothPolyDataFilter

TABAS CALLE, MANUEL DAVID ManuelDavid.Tabas at alu.uclm.es
Mon Nov 5 12:07:00 EST 2007


When i execute my program, i get this error:

ERROR: In C:\martink\vtk42\VTK\Graphics\vtkSmoothPolyDataFilter.cxx, line 191
vtkSmoothPolyDataFilter (0x0C702B08): No data to smooth!

ERROR: In C:\martink\vtk42\VTK\Graphics\vtkPolyDataNormals.cxx, line 88
vtkPolyDataNormals (0x0C702F68): No data to generate normals for!

The code of my program is:

        vtkImageReader reader=new vtkImageReader();
        reader.SetFileName("C:/Documents and Settings/Pc2/Escritorio/Tutorial VTK Eclipse/result.pic");
        reader.SetFileDimensionality(3);
        reader.SetDataExtent(0,159,0,147,0,40);
        reader.SetDataVOI(0,159,0,147,3,38);
        reader.SetDataOrigin(0,0,0);
        reader.SetDataScalarTypeToUnsignedChar();
        reader.SetDataSpacing(1,1,0.2);
        reader.SetHeaderSize(76);
        
        
        vtkContourFilter skinExtractor=new vtkContourFilter();
        skinExtractor.SetInput(reader.GetOutput());
        skinExtractor.SetValue(0,254);
        
       
        vtkSmoothPolyDataFilter smooth=new vtkSmoothPolyDataFilter();
        smooth.SetInput(skinExtractor.GetOutput());
        smooth.SetNumberOfIterations(50);
        smooth.BoundarySmoothingOn();
        smooth.SetFeatureAngle(120);
        smooth.SetRelaxationFactor(.025);
        
        
        vtkPolyDataNormals skinNormals= new vtkPolyDataNormals();
        skinNormals.SetInput(smooth.GetOutput());
        skinNormals.SetFeatureAngle(60.0);
        
        
        vtkPolyDataMapper skinMapper=new vtkPolyDataMapper();
        skinMapper.SetInput(skinNormals.GetOutput());
        skinMapper.ScalarVisibilityOff();

What am i doing wrong???? 



___________________________________________________
Enviado a través de http://alumnos.uclm.es/webmail


 
                   




More information about the vtkusers mailing list