<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->SetValue(0, 5); <br>
<br>
Instead of 5 you can use 500 (Bone) or -500 (Skin).<br>
<br>
That is, try either <b>surface->SetValue(0, 500);</b> or <b>surface->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< vtkDICOMImageReader > reader =</div>
<div><span class="" style="white-space:pre"> </span>vtkSmartPointer<
vtkDICOMImageReader >::New();</div>
<div><span class="" style="white-space:pre"> </span>reader->SetDataByteOrderToLittleEndian();</div>
<div><span class="" style="white-space:pre"> </span>//reader->SetDirectoryName(argv[1]);</div>
<div><span class="" style="white-space:pre"> </span>reader->SetDirectoryName("C:\\VTK5.10\\DATA\\DICOM");</div>
<div><span class="" style="white-space:pre"> </span>reader->SetDataSpacing(1,
1, 1);</div>
<div><span class="" style="white-space:pre"> </span>reader->SetDataOrigin(0.0,
0.0, 0.0);</div>
<div><span class="" style="white-space:pre"> </span>reader->Update();</div>
</div>
<div><br>
</div>
<div>
<div>vtkSmartPointer< vtkMarchingCubes > surface =</div>
<div><span class="" style="white-space:pre"> </span>vtkSmartPointer<
vtkMarchingCubes >::New();</div>
<div><span class="" style="white-space:pre"> </span>surface->SetInputConnection(reader->GetOutputPort());</div>
<div><span class="" style="white-space:pre"> </span>surface->ComputeNormalsOn();</div>
<div><span class="" style="white-space:pre"> </span>surface->SetValue(0,
5);</div>
<div><span class="" style="white-space:pre"> </span></div>
<div><span class="" style="white-space:pre"> </span>vtkSmartPointer<
vtkRenderer > surfacerenderer =</div>
<div><span class="" style="white-space:pre"> </span>vtkSmartPointer<
vtkRenderer >::New();</div>
<div><span class="" style="white-space:pre"> </span>surfacerenderer->SetBackground(0.1,
0.2, 0.3);</div>
<div><br>
</div>
<div><span class="" style="white-space:pre"> </span>vtkSmartPointer<
vtkRenderWindow > renderwin =</div>
<div><span class="" style="white-space:pre"> </span>vtkSmartPointer<
vtkRenderWindow >::New();</div>
<div><span class="" style="white-space:pre"> </span>renderwin->AddRenderer(surfacerenderer);</div>
<div><span class="" style="white-space:pre"> </span></div>
<div><span class="" style="white-space:pre"> </span>vtkSmartPointer<
vtkRenderWindowInteractor > intersurf =</div>
<div><span class="" style="white-space:pre"> </span>vtkSmartPointer<
vtkRenderWindowInteractor >::New();</div>
<div><span class="" style="white-space:pre"> </span>intersurf->SetRenderWindow(renderwin);</div>
<div>
<br>
</div>
<div><span class="" style="white-space:pre"> </span>vtkSmartPointer<
vtkPolyDataNormals > premapper =</div>
<div><span class="" style="white-space:pre"> </span>vtkSmartPointer<
vtkPolyDataNormals >::New();</div>
<div><span class="" style="white-space:pre"> </span>premapper->SetInputConnection(surface->GetOutputPort());</div>
<div><span class="" style="white-space:pre"> </span>premapper->ComputeCellNormalsOn();</div>
<div><span class="" style="white-space:pre"> </span></div>
<div><span class="" style="white-space:pre"> </span>vtkSmartPointer<
vtkPolyDataMapper > surfacemapper =</div>
<div><span class="" style="white-space:pre"> </span>vtkSmartPointer<
vtkPolyDataMapper >::New();</div>
<div><span class="" style="white-space:pre"> </span>surfacemapper->SetInputConnection(premapper->GetOutputPort());</div>
<div><span class="" style="white-space:pre"> </span>//surfacemapper->SetInputConnection(surface->GetOutputPort());</div>
<div><br>
</div>
<div><span class="" style="white-space:pre"> </span>vtkSmartPointer<
vtkActor > actor =</div>
<div><span class="" style="white-space:pre"> </span>vtkSmartPointer<
vtkActor >::New();</div>
<div><span class="" style="white-space:pre"> </span>actor->SetMapper(surfacemapper);</div>
<div><br>
</div>
<div><span class="" style="white-space:pre"> </span>vtkSmartPointer<
vtkProperty > backFaces =</div>
<div><span class="" style="white-space:pre"> </span>vtkSmartPointer<
vtkProperty >::New();</div>
<div><span class="" style="white-space:pre"> </span>backFaces->SetSpecular(0.0);</div>
<div><span class="" style="white-space:pre"> </span>backFaces->SetDiffuse(0.0);</div>
<div><span class="" style="white-space:pre"> </span>backFaces->SetAmbient(1.0);</div>
<div><span class="" style="white-space:pre"> </span>backFaces->SetAmbientColor(1.0000,
0.3883, 0.2784);</div>
<div><span class="" style="white-space:pre"> </span>backFaces->SetOpacity(256);</div>
<div><br>
</div>
<div><span class="" style="white-space:pre"> </span>actor->SetBackfaceProperty(backFaces);</div>
<div><br>
</div>
<div><span class="" style="white-space:pre"> </span>surfacerenderer->AddActor(actor);</div>
<div><span class="" style="white-space:pre"> </span>renderwin->SetSize(800,600);</div>
<div><span class="" style="white-space:pre"> </span>//renderWindow->Render();</div>
<div><span class="" style="white-space:pre"> </span>intersurf->Start();</div>
<div><br>
</div>
<div><span class="" style="white-space:pre"> </span>this->ui->vtksurface->GetRenderWindow()->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>
--
<div><b><font color="#000066" face="'comic sans ms', sans-serif">Rodrigo
Lovera </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>