[vtkusers] vtkSmoothPolyDataFilter
Suresh Joshi
Suresh.Joshi at insa-lyon.fr
Mon Aug 3 09:46:57 EDT 2009
Two things I would try:
1: Find out what the GetRadiusFactors(...) are. As you didn't set
them, they should default to 1.5 I believe.
2: And try non-zero SetStandardDeviations(...), whilst I don't think
either of these would cause errors like what you have, I ran unit
testing on a program of mine and errors started popping up when one of
these parameters was set to zero.
Also, with a dimensionality of 3, shouldn't you have another parameter
here: GaussianSmooth.SetStandardDeviations(0.0,4.0) ?
Good luck
On Mon, Aug 3, 2009 at 2:32 PM, Bryn Lloyd<blloyd at vision.ee.ethz.ch> wrote:
> Check if you actually have a contour at the value(s), e.g. by looking at the
> number of points in the output of vtkContourFilter. My guess is your contour
> (polydata) is empty.
>
> You can also check the data range of the image, something like:
>
> GaussianSmooth.GetOutput().GetPointData().GetScalars().GetRange()
>
> /Bryn
>
>
>
>
>
> Gururajan wrote:
>>
>> Yup, you are right, i place an update in vtkImageGaussianSmooth, but
>> even now, it hits me the same,
>>
>> Thanks
>> Guru
>>
>> Dominik Szczerba wrote:
>>>
>>> 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
>>>>
>>>
>>
>> _______________________________________________
>> 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
>>
>
>
> --
> -------------------------------------------------
> Bryn Lloyd
> Computer Vision Laboratory
> ETH Zürich, Sternwartstrasse 7
> CH - 8092 Zürich, Switzerland
> Tel: +41 44 63 26668
> Fax: +41 44 63 21199
> -------------------------------------------------
> _______________________________________________
> 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
>
More information about the vtkusers
mailing list