Thanks for the clarification Cory. I am having way too much trouble with the marching cubes algo.<br><br>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! :)
<br><br>Thanks,<br>Luca<br><br><div><span class="gmail_quote">On 8/7/07, <b class="gmail_sendername">Cory Quammen</b> &lt;<a href="mailto:cquammen@cs.unc.edu">cquammen@cs.unc.edu</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
[cc&#39;ing list]<br><br>Luca,<br><br>Inheritance from vtkPolyDataAlgorithm does not necessarily imply that<br>the algorithm takes vtkPolyData as input. In the case of<br>vtkMarchingCubes, you just need to pass in your filtered image data.
<br>You might consider using vtkImageGaussianSmooth for smoothing your<br>data, or any one of the other filters starting with vtkImage* listed<br>at <a href="http://www.vtk.org/doc/nightly/html/classes.html">http://www.vtk.org/doc/nightly/html/classes.html
</a>.<br><br>As an aside, you are using the old style pipeline connections. It is<br>better to use the new style connections, such as:<br><br>m_smoother-&gt;SetInputConnection(m_input-&gt;GetOutputPort());<br>m_mc-&gt;SetInputConnection(m_smoother-&gt;GetOutputPort());
<br><br>Hope this helps,<br>Cory<br><br>On 8/7/07, Luca Pamparana &lt;<a href="mailto:luca.pamparana@gmail.com">luca.pamparana@gmail.com</a>&gt; wrote:<br>&gt; Hi everyone,<br>&gt;<br>&gt; Looking at the documentation of the vtkMarchingCubes object, it inherits
<br>&gt; from vtkPolyDataAlgorithm. However, when I use the following filter<br>&gt; pipeline, it fails with the error:<br>&gt;<br>&gt;&nbsp;&nbsp;Input for connection index 0 on input port index 0 for algorithm<br>&gt; vtkMarchingCubes(0x1753e60) is of type vtkPolyData, but a vtkImageData is
<br>&gt; required.<br>&gt;<br>&gt; The pipeline is as follows:<br>&gt;<br>&gt; // Convert the image data to polygons<br>&gt; m_polyDataFilter-&gt;SetInput(m_input-&gt;GetOutput());<br>&gt;<br>&gt; m_polyDataFilter-&gt;SetOutputStyleToPolygonalize();
<br>&gt;<br>&gt; // Smooth the data to remove the high frequencies and minmise the step<br>&gt; effects<br>&gt; m_smoother-&gt;SetInput(m_polyDataFilter-&gt;GetOutput());<br>&gt;<br>&gt; m_smoother-&gt;SetNumberOfIterations(50);
<br>&gt;<br>&gt; // Pass this to the marching cube filter<br>&gt;&nbsp;&nbsp;m_mc-&gt;SetInput(m_smoother-&gt;GetOutput());<br>&gt;<br>&gt; This fails with the above error. Is it meant to be like this? Is there an<br>&gt; easy way to convert polydata back to image data or alternatively smooth an
<br>&gt; image data with some filter.<br>&gt;<br>&gt; Thanks,<br>&gt; Luca<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; This is the private VTK discussion list.<br>&gt; Please keep messages on-topic. Check the FAQ at:
<br>&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><br>&gt; Follow this link to subscribe/unsubscribe:<br>&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers
</a><br>&gt;<br>&gt;<br><br><br>--<br>Cory Quammen<br>Department of Computer Science<br>University of North Carolina at Chapel Hill<br><a href="http://www.cs.unc.edu/~cquammen">http://www.cs.unc.edu/~cquammen</a><br></blockquote>
</div><br>