[vtkusers] vtkSmoothPolyDataFilter
Dominik Szczerba
dominik at itis.ethz.ch
Mon Aug 3 08:11:25 EDT 2009
you probably missing Update() somewhere...
Gururajan wrote:
> Hi all,
>
> On execution of my application, am getting below error. Ane one have any clue please,
>
> 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!
>
> Thanks in advance
> Guru
>
> vtkDICOMImageReader dicomreader = new vtkDICOMImageReader();
> dicomreader.SetDirectoryName("/home/gururaj/MANIX/MANIX/CER-CT/AVEC I.V.");
> dicomreader.Update();
> double[] dataspacing = dicomreader.GetDataSpacing();
> System.out.println(dataspacing[0] + ":" + dataspacing[1] + ":" + dataspacing[2]);
> System.out.println("Patient Ka naam : " + dicomreader.GetPatientName());
> vtkImageWriter writer = new vtkImageWriter();//vtkImageWriter::New()
> writer.SetInput(dicomreader.GetOutput());
> writer.SetFilePrefix("/home/gururaj/eclipse Project/SimpleVTK/SimpleVtk/Raw/dicom");
> writer.SetFilePattern("%s%3d.raw");
> writer.Write();
>
> vtkVolume16Reader v16 = new vtkVolume16Reader();
> v16.SetDataByteOrderToLittleEndian();
> v16.SetFilePrefix("/home/gururaj/eclipse Project/SimpleVTK/SimpleVtk/Raw/");
> v16.SetFilePattern("%s%3d.dcm.raw");
> v16.SetImageRange(0, 123);
> v16.GetOutput().ReleaseDataFlagOn();
> v16.SetDataSpacing(dicomreader.GetDataSpacing());
> v16.SetDataDimensions(dicomreader.GetOutput().GetDimensions());
> v16.Update();
>
> vtkImageGaussianSmooth GaussianSmooth = new vtkImageGaussianSmooth();
> GaussianSmooth.SetInput(v16.GetOutput());
> GaussianSmooth.SetDimensionality (3);
> GaussianSmooth.SetStandardDeviations(0.0,4.0);
> vtkContourFilter skinExtractor = new vtkContourFilter();
> skinExtractor.SetInput((vtkDataSet)GaussianSmooth.GetOutput());
> skinExtractor.SetValue(0, 500);
> skinExtractor.Update();
> vtkSmoothPolyDataFilter smoother=new vtkSmoothPolyDataFilter();
> smoother.SetInput(skinExtractor.GetOutput());
> smoother.SetNumberOfIterations(70);
> vtkPolyDataNormals skinNormals = new vtkPolyDataNormals();
> skinNormals.SetInput(smoother.GetOutput());
> skinNormals.SetFeatureAngle(60.0);
>
> vtkPolyDataWriter pdw=new vtkPolyDataWriter();
> pdw.SetInput(skinNormals.GetOutput());
> pdw.SetFileName("/home/gururaj/eclipse Project/SimpleVTK/SimpleVtk/CardiacCT/out.vtk");
> pdw.Write();
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
--
d o m i n i k s z c z e r b a , p h d . . . . . . . . . . .
c o m p u t a t i o n a l l i f e s c i e n c e g r o u p
. . . . . . . i t ' i s r e s e a r c h f o u n d a t i o n
. . . . . . . . . . . . . . . . . . . . http://www.itis.ethz.ch
More information about the vtkusers
mailing list