<div dir="ltr"><div><div><div>dear luis,</div><div><br></div><div>i want to display the segmented part using vtk , but the problem when save segmented data  and try to display it nothing appear , just blank data , how to reconstruct the 3D of the segmented part </div>
<div><br></div><div>best regards</div><br><div class="gmail_quote">On Tue, Mar 16, 2010 at 7:57 PM, Luis Ibanez <span dir="ltr">&lt;<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">Hi Ali,<br>
<br>
Thanks for your detailed post.<br>
<br>
<br>
It seems however that you missed<br>
to describe what the problem is.<br>
<br>
What exactly is what you want to fix ?<br>
<br>
---<br>
<br>
If you are looking for examples on how to use<br>
VTK to visualize a segmentation produced by ITK,<br>
then you may want to look at:<br>
<br>
InsightApplications/Auxiliary/vtk/<br>
     itkReadITKImage3DSegmentShowVTK.cxx<br>
<br>
<a href="http://www.itk.org/cgi-bin/viewcvs.cgi/Auxiliary/vtk/itkReadITKImage3DSegmentShowVTK.cxx?root=InsightApplications&amp;view=log" target="_blank">http://www.itk.org/cgi-bin/viewcvs.cgi/Auxiliary/vtk/itkReadITKImage3DSegmentShowVTK.cxx?root=InsightApplications&amp;view=log</a><br>

<br>
<br>
      Regards,<br>
<br>
<br>
             Luis<br>
<br>
<br>
-----------------------------------------------------------<br>
</div><div><div></div><div class="h5">On Fri, Mar 12, 2010 at 3:36 PM, Ali Habib &lt;<a href="mailto:ali.mahmoud.habib@gmail.com">ali.mahmoud.habib@gmail.com</a>&gt; wrote:<br>
&gt; Dear All,<br>
&gt; I use ITK snap program to segment , then save the segmentation output to raw<br>
&gt; image data (using the menu segmentation --&gt; Save As )<br>
&gt; I read it using vtk, and try t extract the bone ad reconstruct it using the<br>
&gt; following code :<br>
&gt;  vtkMetaImageReader metaImageReader = new vtkMetaImageReader();<br>
&gt;             metaImageReader.SetFileName(@&quot;C:\Users\Eng. Ali<br>
&gt; Mahmoud\Desktop\yyymhdmhd&quot;);<br>
&gt;             metaImageReader.Update();<br>
&gt;<br>
&gt;             vtkImageShrink3D VIS = new vtkImageShrink3D();<br>
&gt;             VIS.SetShrinkFactors(2, 2, 2);<br>
&gt;             VIS.SetInputConnection(metaImageReader.GetOutputPort());<br>
&gt;             VIS.Update();<br>
&gt;             vtkImageThreshold VIT = new vtkImageThreshold();<br>
&gt;             VIT.ThresholdBetween(200, 2000);<br>
&gt;             VIT.SetInputConnection(VIS.GetOutputPort());<br>
&gt;             VIT.Update();<br>
&gt;             vtkImageMarchingCubes imageMarchingCubes = new<br>
&gt; vtkImageMarchingCubes();<br>
&gt;             imageMarchingCubes.SetInput(VIT.GetOutput());<br>
&gt;             imageMarchingCubes.SetValue(0, 500);<br>
&gt;             imageMarchingCubes.ComputeScalarsOff();<br>
&gt;             imageMarchingCubes.ComputeNormalsOff();<br>
&gt;             imageMarchingCubes.ComputeGradientsOff();<br>
&gt;             imageMarchingCubes.Update();<br>
&gt;              vtkPolyDataMapper map =new vtkPolyDataMapper();<br>
&gt;   map.SetInput(imageMarchingCubes.GetOutput());<br>
&gt;   // actor coordinates geometry, properties, transformation<br>
&gt;   vtkActor aSphere =new vtkActor();<br>
&gt;   aSphere.SetMapper(map);<br>
&gt;   aSphere.GetProperty().SetColor(0,0,1); // sphere color blue<br>
&gt;   // a renderer and render window<br>
&gt;   vtkRenderer ren1 =new vtkRenderer();<br>
&gt;   vtkRenderWindow renWin =new vtkRenderWindow();<br>
&gt;   renWin.AddRenderer(ren1);<br>
&gt;   // an interactor<br>
&gt;   vtkRenderWindowInteractor iren =new vtkRenderWindowInteractor();<br>
&gt;   iren.SetRenderWindow(renWin);<br>
&gt;   // add the actor to the scene<br>
&gt;   ren1.AddActor(aSphere);<br>
&gt;   ren1.SetBackground(1,1,1); // Background color white<br>
&gt;   // render an image (lights and cameras are created automatically)<br>
&gt;   renWin.Render();<br>
&gt;   // begin mouse interaction<br>
&gt;    iren.Start();<br>
&gt;<br>
&gt; how to fix that<br>
&gt; Best regards<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div><div><div></div><div class="h5">&gt; _____________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Kitware offers ITK Training Courses, for more information visit:<br>
&gt; <a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the ITK FAQ at:<br>
&gt; <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br></div></div></div>