[vtkusers] vtkMarchingCubes does not work with vtkPolyData??

Luca Pamparana luca.pamparana at gmail.com
Tue Aug 7 08:51:37 EDT 2007


Thanks for the clarification Cory. I am having way too much trouble with the
marching cubes algo.

I am aware of using the old style pipeline. Just been too lazy to update it.
Will get to it once this problem is solved! :)

Thanks,
Luca

On 8/7/07, Cory Quammen <cquammen at cs.unc.edu> wrote:
>
> [cc'ing list]
>
> Luca,
>
> Inheritance from vtkPolyDataAlgorithm does not necessarily imply that
> the algorithm takes vtkPolyData as input. In the case of
> vtkMarchingCubes, you just need to pass in your filtered image data.
> You might consider using vtkImageGaussianSmooth for smoothing your
> data, or any one of the other filters starting with vtkImage* listed
> at http://www.vtk.org/doc/nightly/html/classes.html.
>
> As an aside, you are using the old style pipeline connections. It is
> better to use the new style connections, such as:
>
> m_smoother->SetInputConnection(m_input->GetOutputPort());
> m_mc->SetInputConnection(m_smoother->GetOutputPort());
>
> Hope this helps,
> Cory
>
> On 8/7/07, Luca Pamparana <luca.pamparana at gmail.com> wrote:
> > Hi everyone,
> >
> > Looking at the documentation of the vtkMarchingCubes object, it inherits
> > from vtkPolyDataAlgorithm. However, when I use the following filter
> > pipeline, it fails with the error:
> >
> >  Input for connection index 0 on input port index 0 for algorithm
> > vtkMarchingCubes(0x1753e60) is of type vtkPolyData, but a vtkImageData
> is
> > required.
> >
> > The pipeline is as follows:
> >
> > // Convert the image data to polygons
> > m_polyDataFilter->SetInput(m_input->GetOutput());
> >
> > m_polyDataFilter->SetOutputStyleToPolygonalize();
> >
> > // Smooth the data to remove the high frequencies and minmise the step
> > effects
> > m_smoother->SetInput(m_polyDataFilter->GetOutput());
> >
> > m_smoother->SetNumberOfIterations(50);
> >
> > // Pass this to the marching cube filter
> >  m_mc->SetInput(m_smoother->GetOutput());
> >
> > This fails with the above error. Is it meant to be like this? Is there
> an
> > easy way to convert polydata back to image data or alternatively smooth
> an
> > image data with some filter.
> >
> > Thanks,
> > Luca
> >
> >
> >
> >
> > _______________________________________________
> > This is the private VTK discussion list.
> > Please keep messages on-topic. Check the FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
> >
>
>
> --
> Cory Quammen
> Department of Computer Science
> University of North Carolina at Chapel Hill
> http://www.cs.unc.edu/~cquammen
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070807/a4c09917/attachment.htm>


More information about the vtkusers mailing list