<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
Greetings all,<br>
<br>
I refered the post below on this topic ,<br>
<br>
<a class="moz-txt-link-freetext" href="http://vtk.1045678.n5.nabble.com/Creating-a-3D-surface-mesh-from-a-stack-of-contours-td1245753.html">http://vtk.1045678.n5.nabble.com/Creating-a-3D-surface-mesh-from-a-stack-of-contours-td1245753.html</a><br>
<br>
In the solution given below , I don't understand the variable
"input_image" (which i assume of type vtkImageData). <br>
Is it the volume-data which is used to extract contours? Can't I
generate mesh only using contours&nbsp; without this image data?<br>
<br>
<br>
vtkAppendPolyData * app = vtkAppendPolyData::New();<br>
&nbsp;<br>
for (std::vector&lt;vtkPolyData*&gt;::iterator i =
roi.contours.begin(); i != roi.contours.end(); i++)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; app-&gt;AddInput(*i);<br>
<br>
&nbsp;&nbsp;&nbsp; vtkPolyDataWriter* w=vtkPolyDataWriter::New();<br>
&nbsp;&nbsp;&nbsp; vtkLinearExtrusionFilter * extrude=vtkLinearExtrusionFilter::New();<br>
&nbsp;&nbsp;&nbsp; extrude-&gt;SetInput(app-&gt;GetOutput());<br>
&nbsp;&nbsp;&nbsp; extrude-&gt;SetVector(0, 0, 3);&nbsp; //3 is the Z spacing between
contours<br>
&nbsp;&nbsp;&nbsp; extrude-&gt;CappingOn();<br>
&nbsp;&nbsp;&nbsp; extrude-&gt;Update();<br>
<br>
&nbsp;&nbsp;&nbsp; vtkPolyDataToImageStencil* sts=vtkPolyDataToImageStencil::New();<br>
&nbsp;&nbsp;&nbsp; vtkImageStencil* stencil=vtkImageStencil::New();<br>
&nbsp;&nbsp;&nbsp; sts-&gt;SetInput(extrude-&gt;GetOutput());<br>
&nbsp;&nbsp;&nbsp; sts-&gt;SetInformationInput(input_image);&nbsp;&nbsp; /////****** What is
this input_image ?<br>
&nbsp;&nbsp;&nbsp; sts-&gt;Update();<br>
&nbsp;&nbsp;&nbsp; stencil-&gt;SetStencil(sts-&gt;GetOutput());<br>
&nbsp;&nbsp;&nbsp; stencil-&gt;SetInput(input_image);<br>
<br>
&nbsp;&nbsp;&nbsp; vtkSmartPointer&lt;vtkMarchingCubes&gt; marching =
vtkSmartPointer&lt;vtkMarchingCubes&gt;::New();<br>
&nbsp;&nbsp;&nbsp; marching-&gt;SetInput(stencil-&gt;GetOutput());<br>
&nbsp;&nbsp;&nbsp; marching-&gt;SetValue(0,0.5);<br>
&nbsp;&nbsp;&nbsp; marching-&gt;Update();&nbsp; <br>
<span class="ul-threaded" style="margin: 0.5em 0pt 0pt -20px;"><span
 class="text-cell"><span>&nbsp; <b class="highlight"></b></span><span><br>
<br>
<br>
Thanks in advance.<br>
</span></span></span><br>
</body>
</html>