<br clear="all"><div>Hello everyone,</div><div><br></div><div>I&#39;ve got a set of dicom slices which I use for rendering a volume, now I tried to apply marching cubes to try surface rendering buy i&#39;m only getting some kind of box and not the head that shold be forming.</div>
<div><br></div><div>I&#39;m using atm the following code</div><div><br></div><div><div>vtkSmartPointer&lt; vtkDICOMImageReader &gt; reader =</div><div><span class="" style="white-space:pre">                </span>vtkSmartPointer&lt; vtkDICOMImageReader &gt;::New();</div>
<div><span class="" style="white-space:pre">        </span>reader-&gt;SetDataByteOrderToLittleEndian();</div><div><span class="" style="white-space:pre">        </span>//reader-&gt;SetDirectoryName(argv[1]);</div><div><span class="" style="white-space:pre">        </span>reader-&gt;SetDirectoryName(&quot;C:\\VTK5.10\\DATA\\DICOM&quot;);</div>
<div><span class="" style="white-space:pre">        </span>reader-&gt;SetDataSpacing(1, 1, 1);</div><div><span class="" style="white-space:pre">        </span>reader-&gt;SetDataOrigin(0.0, 0.0, 0.0);</div><div><span class="" style="white-space:pre">        </span>reader-&gt;Update();</div>
</div><div><br></div><div><div>vtkSmartPointer&lt; vtkMarchingCubes &gt; surface =</div><div><span class="" style="white-space:pre">                </span>vtkSmartPointer&lt; vtkMarchingCubes &gt;::New();</div><div><span class="" style="white-space:pre">        </span>surface-&gt;SetInputConnection(reader-&gt;GetOutputPort());</div>
<div><span class="" style="white-space:pre">        </span>surface-&gt;ComputeNormalsOn();</div><div><span class="" style="white-space:pre">        </span>surface-&gt;SetValue(0, 5);</div><div><span class="" style="white-space:pre">        </span></div>
<div><span class="" style="white-space:pre">        </span>vtkSmartPointer&lt; vtkRenderer &gt; surfacerenderer =</div><div><span class="" style="white-space:pre">                </span>vtkSmartPointer&lt; vtkRenderer &gt;::New();</div><div><span class="" style="white-space:pre">        </span>surfacerenderer-&gt;SetBackground(0.1, 0.2, 0.3);</div>
<div><br></div><div><span class="" style="white-space:pre">        </span>vtkSmartPointer&lt; vtkRenderWindow &gt; renderwin =</div><div><span class="" style="white-space:pre">                </span>vtkSmartPointer&lt; vtkRenderWindow &gt;::New();</div>
<div><span class="" style="white-space:pre">        </span>renderwin-&gt;AddRenderer(surfacerenderer);</div><div><span class="" style="white-space:pre">        </span></div><div><span class="" style="white-space:pre">        </span>vtkSmartPointer&lt; vtkRenderWindowInteractor &gt; intersurf =</div>
<div><span class="" style="white-space:pre">                </span>vtkSmartPointer&lt; vtkRenderWindowInteractor &gt;::New();</div><div><span class="" style="white-space:pre">        </span>intersurf-&gt;SetRenderWindow(renderwin);</div><div>
<br></div><div><span class="" style="white-space:pre">        </span>vtkSmartPointer&lt; vtkPolyDataNormals &gt; premapper =</div><div><span class="" style="white-space:pre">                </span>vtkSmartPointer&lt; vtkPolyDataNormals &gt;::New();</div>
<div><span class="" style="white-space:pre">        </span>premapper-&gt;SetInputConnection(surface-&gt;GetOutputPort());</div><div><span class="" style="white-space:pre">        </span>premapper-&gt;ComputeCellNormalsOn();</div><div><span class="" style="white-space:pre">        </span></div>
<div><span class="" style="white-space:pre">        </span>vtkSmartPointer&lt; vtkPolyDataMapper &gt; surfacemapper =</div><div><span class="" style="white-space:pre">                </span>vtkSmartPointer&lt; vtkPolyDataMapper &gt;::New();</div>
<div><span class="" style="white-space:pre">        </span>surfacemapper-&gt;SetInputConnection(premapper-&gt;GetOutputPort());</div><div><span class="" style="white-space:pre">        </span>//surfacemapper-&gt;SetInputConnection(surface-&gt;GetOutputPort());</div>
<div><br></div><div><span class="" style="white-space:pre">        </span>vtkSmartPointer&lt; vtkActor &gt; actor =</div><div><span class="" style="white-space:pre">                </span>vtkSmartPointer&lt; vtkActor &gt;::New();</div><div><span class="" style="white-space:pre">        </span>actor-&gt;SetMapper(surfacemapper);</div>
<div><br></div><div><span class="" style="white-space:pre">        </span>vtkSmartPointer&lt; vtkProperty &gt; backFaces =</div><div><span class="" style="white-space:pre">                </span>vtkSmartPointer&lt; vtkProperty &gt;::New();</div>
<div><span class="" style="white-space:pre">        </span>backFaces-&gt;SetSpecular(0.0);</div><div><span class="" style="white-space:pre">        </span>backFaces-&gt;SetDiffuse(0.0);</div><div><span class="" style="white-space:pre">        </span>backFaces-&gt;SetAmbient(1.0);</div>
<div><span class="" style="white-space:pre">        </span>backFaces-&gt;SetAmbientColor(1.0000, 0.3883, 0.2784);</div><div><span class="" style="white-space:pre">        </span>backFaces-&gt;SetOpacity(256);</div><div><br></div><div><span class="" style="white-space:pre">        </span>actor-&gt;SetBackfaceProperty(backFaces);</div>
<div><br></div><div><span class="" style="white-space:pre">        </span>surfacerenderer-&gt;AddActor(actor);</div><div><span class="" style="white-space:pre">        </span>renderwin-&gt;SetSize(800,600);</div><div><span class="" style="white-space:pre">        </span>//renderWindow-&gt;Render();</div>
<div><span class="" style="white-space:pre">        </span>intersurf-&gt;Start();</div><div><br></div><div><span class="" style="white-space:pre">        </span>this-&gt;ui-&gt;vtksurface-&gt;GetRenderWindow()-&gt;AddRenderer(surfacerenderer);</div>
</div><div><br></div><div>I&#39;d appreciate any kind of help, example code or advice. Thx in advance.</div><div><br></div>-- <div><b><font face="&#39;comic sans ms&#39;, sans-serif" color="#000066">Rodrigo Lovera </font></b><br>

</div>