<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi<br>
      <br>
      Change the value in following line.<br>
      surface-&gt;SetValue(0, 5); <br>
      <br>
      Instead of 5 you can use 500 (Bone) or -500 (Skin).<br>
      <br>
      That is, try either <b>surface-&gt;SetValue(0, 500);</b> or <b>surface-&gt;SetValue(0,
        -500); </b><br>
      <br>
      --<br>
      Sathish<br>
      <br>
      On Saturday 17 November 2012 02:46 AM, Rodrigo Lovera wrote:<br>
    </div>
    <blockquote
cite="mid:CAPYxsj9TKQsC816eJaU8T7Rw9BmgpVCDKdDw5ndX2TZPeZV9EA@mail.gmail.com"
      type="cite"><br clear="all">
      <div>Hello everyone,</div>
      <div><br>
      </div>
      <div>I'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'm only getting some kind of box and not the head
        that shold be forming.</div>
      <div><br>
      </div>
      <div>I'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("C:\\VTK5.10\\DATA\\DICOM");</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'd appreciate any kind of help, example code or advice. Thx
        in advance.</div>
      <div><br>
      </div>
      --&nbsp;
      <div><b><font color="#000066" face="'comic sans ms', sans-serif">Rodrigo
            Lovera&nbsp;</font></b><br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>

Visit other Kitware open-source projects at <a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>

Please keep messages on-topic and check the VTK FAQ at: <a class="moz-txt-link-freetext" href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a>

Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>