<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>Thank you Bill.</DIV>
<DIV>I post here the code i use to extract the surface of my volume. When i run it, i have some parts of the skull which are colored and not the whole surface. Please, can you tell me what to modify in the code?</DIV>
<DIV>Thank you</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>vtkVolume16Reader *v16 = vtkVolume16Reader::New();<BR>v16->SetDataDimensions(256,256);<BR>v16->SetFilePrefix("C:/test");<BR>v16->SetImageRange(0,160); <BR>v16->SetDataByteOrderToLittleEndian();<BR>v16->SetDataSpacing(2,1,2);<BR> <BR>// The isosurface<BR>vtkMergePoints *locator = vtkMergePoints::New();<BR>locator->SetDivisions(32,32,46);<BR>locator->SetNumberOfPointsPerBucket(2);<BR>locator->AutomaticOff();<BR> <BR>vtkMarchingCubes *iso = vtkMarchingCubes::New();<BR>iso->SetInput(v16->GetOutput());<BR>iso->SetValue(1,1000);<BR>iso->ComputeGradientsOn();<BR>iso->ComputeScalarsOn();<BR>iso->SetLocator(locator);<BR> <BR>// Smooth the surface<BR>vtkSmoothPolyDataFilter *smooth =
vtkSmoothPolyDataFilter::New();<BR>smooth->SetInput(iso->GetOutput());<BR>smooth->SetNumberOfIterations(100);<BR>smooth->BoundarySmoothingOn();<BR>smooth->SetFeatureAngle(120);<BR>smooth->SetEdgeAngle(90);<BR>smooth->SetRelaxationFactor(1);<BR> <BR>// Display<BR>vtkVectorNorm *gradient = vtkVectorNorm::New();<BR>gradient->SetInput(smooth->GetOutput());<BR> <BR>vtkDataSetMapper *isoMapper = vtkDataSetMapper::New();<BR>isoMapper->SetInput(gradient->GetOutput());<BR>isoMapper->ScalarVisibilityOn();<BR>isoMapper->SetScalarRange(0,1200);<BR>isoMapper->ImmediateModeRenderingOn();<BR> <BR><BR>--- En date de : <B>Mer 18.3.09, Bill Lorensen <I><bill.lorensen@gmail.com></I></B> a écrit :<BR></DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid"><BR>De: Bill Lorensen <bill.lorensen@gmail.com><BR>Objet: Re: [vtkusers] Please help! How to extract the surface of a volume?<BR>À: "Liam Kurmos" <quantum.leaf@googlemail.com><BR>Cc: "Nour Mestiri" <nourmestiri@yahoo.fr>, "vtk" <vtkusers@vtk.org><BR>Date: Mercredi 18 Mars 2009, 14h21<BR><BR>
<DIV class=plainMail>If your segmented images have discrete labels for each structure, then<BR>use vtkDiscreteMarchingCubes rather than vtkMarchingCubes.<BR><BR>Bill<BR><BR>On Wed, Mar 18, 2009 at 5:29 AM, Liam Kurmos<BR><<A href="http://fr.mc282.mail.yahoo.com/mc/compose?to=quantum.leaf@googlemail.com" ymailto="mailto:quantum.leaf@googlemail.com">quantum.leaf@googlemail.com</A>> wrote:<BR>> why isn't the result of marching cubes what you want?<BR>> did you set the isovalue to what you want?<BR>><BR>> On Wed, Mar 18, 2009 at 10:44 AM, Nour Mestiri <<A href="http://fr.mc282.mail.yahoo.com/mc/compose?to=nourmestiri@yahoo.fr" ymailto="mailto:nourmestiri@yahoo.fr">nourmestiri@yahoo.fr</A>> wrote:<BR>>> Hi all vtk users.<BR>>> I need your help. In fact, i have a sequence of 2D 'segmented' images which<BR>>> represent the bones of the human head.<BR>>> When i make the reconstruction, i obtain the whole volume of
the skull... My<BR>>> objective is to keep just the extern surface of this skull and eliminate all<BR>>> the rest.<BR>>> I used the marching cubes algorithm but the result is not exactly what i<BR>>> want!!!<BR>>> Is it possible to extract the surface of the volume? If yes, how to do?<BR>>> Thank you.<BR>>><BR>>><BR>>> _______________________________________________<BR>>> Powered by www..kitware.com<BR>>><BR>>> Visit other Kitware open-source projects at<BR>>> <A href="http://www.kitware.com/opensource/opensource.html" target=_blank>http://www.kitware.com/opensource/opensource.html</A><BR>>><BR>>> Please keep messages on-topic and check the VTK FAQ at:<BR>>> <A href="http://www.vtk.org/Wiki/VTK_FAQ" target=_blank>http://www.vtk.org/Wiki/VTK_FAQ</A><BR>>><BR>>> Follow this link to subscribe/unsubscribe:<BR>>> <A
href="http://www.vtk.org/mailman/listinfo/vtkusers" target=_blank>http://www.vtk.org/mailman/listinfo/vtkusers</A><BR>>><BR>>><BR>> _______________________________________________<BR>> Powered by www.kitware.com<BR>><BR>> Visit other Kitware open-source projects at <A href="http://www.kitware.com/opensource/opensource.html" target=_blank>http://www.kitware.com/opensource/opensource.html</A><BR>><BR>> Please keep messages on-topic and check the VTK FAQ at: <A href="http://www.vtk.org/Wiki/VTK_FAQ" target=_blank>http://www.vtk.org/Wiki/VTK_FAQ</A><BR>><BR>> Follow this link to subscribe/unsubscribe:<BR>> <A href="http://www.vtk.org/mailman/listinfo/vtkusers" target=_blank>http://www.vtk.org/mailman/listinfo/vtkusers</A><BR>><BR></DIV></BLOCKQUOTE></td></tr></table><br>