Hi Ali,<br><br>I am not a specialist of tetrahedral meshes. But as far as I know, marching cube algorithm outputs a surface, that only has 2D cells. Your DataSetTriangle does the job, I think, that is to triangulate these 2D cells. Your output is coherent with your code. You won't have tets unless you give it an input with 3D cells.<br>
<br>I hope that I am right and that helps.<br>Jerome<br><br><div class="gmail_quote">2009/10/28 Ali Habib <span dir="ltr"><<a href="mailto:ali.mahmoud.habib@gmail.com">ali.mahmoud.habib@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5"><div dir="ltr"><div class="gmail_quote"><br>
<div dir="ltr">Hi All,
<div><br></div>
<div>I use dicom reader to read about just 48 slices , after that I want to apply a mesh algorithm to the volume be reconstructed from those 2d slices, as in this figure appear at this link : <span style="font-family: 'Segoe UI'; white-space: pre; font-size: 12px;"><a href="http://www.zib.de/Numerik/software/kardos/projects/mandible3.gif" target="_blank">http://www.zib.de/Numerik/software/kardos/projects/mandible3.gif</a></span></div>
<div><br></div>
<div>I just tried this algorithm algorithms but no effect to the stripper(No tetrahedral mesh appeared ) any advice please (attached is the output ) and the used code is :</div>
<div>
<div><br></div>
<div> //Variables</div>
<div><span style="white-space: pre;"></span>array<double> ^metaScalarRange = gcnew array<double>(2) { 0, 0 };</div>
<div><br></div>
<div><br></div>
<div><span style="white-space: pre;"></span>// Read a DICOM series path:</div>
<div><span style="white-space: pre;"></span>vtk::vtkDICOMImageReader ^VDR = gcnew vtk::vtkDICOMImageReader();</div>
<div><span style="white-space: pre;"></span>VDR->SetDirectoryName("H:\\work\\Master Degree\\DataSet\\case2\\DICOM\\PA1\\ST1\\SE2");</div>
<div><span style="white-space: pre;"></span>VDR->SetDataOrigin(0, 0, 0);</div>
<div><br></div>
<div><span style="white-space: pre;"></span>VDR->Update();</div>
<div><br></div>
<div><span style="white-space: pre;"></span>/////</div>
<div><span style="white-space: pre;"></span>vtk::vtkImageChangeInformation ^VIC = gcnew vtk::vtkImageChangeInformation();</div>
<div><span style="white-space: pre;"></span>VIC->SetInput(VDR->GetOutput());</div>
<div><br></div>
<div><span style="white-space: pre;"></span>VIC->CenterImageOn();</div>
<div><br></div>
<div><span style="white-space: pre;"></span>VIC->Update();</div>
<div><br></div>
<div><span style="white-space: pre;"></span>// set the imagedata </div>
<div><span style="white-space: pre;"></span>vtk::vtkImageData ^VoxelData = VIC->GetOutput();</div>
<div><br></div>
<div><span style="white-space: pre;"></span>vtk::vtkMarchingCubes ^mcubes = gcnew vtk::vtkMarchingCubes();</div>
<div><span style="white-space: pre;"></span>mcubes->GetOutput()->ReleaseDataFlagOff();</div>
<div><span style="white-space: pre;"></span>mcubes->SetInput(VoxelData);</div>
<div><span style="white-space: pre;"></span>mcubes->SetValue(0, 4);</div>
<div><span style="white-space: pre;"></span>mcubes->ComputeGradientsOn();</div>
<div><span style="white-space: pre;"></span>mcubes->Update();</div>
<div><br></div>
<div><br></div>
<div><span style="white-space: pre;"></span>vtk::vtkSmoothPolyDataFilter ^smoother = gcnew vtk::vtkSmoothPolyDataFilter();</div>
<div><span style="white-space: pre;"></span>smoother->GetOutput()->ReleaseDataFlagOff();</div>
<div><span style="white-space: pre;"></span>smoother->SetInput(mcubes->GetOutput());</div>
<div><span style="white-space: pre;"></span>smoother->SetNumberOfIterations(5);</div>
<div><span style="white-space: pre;"></span>smoother->SetRelaxationFactor(0.70);</div>
<div><span style="white-space: pre;"></span>smoother->SetFeatureAngle(70);</div>
<div><span style="white-space: pre;"></span>smoother->FeatureEdgeSmoothingOn();</div>
<div><span style="white-space: pre;"></span>smoother->BoundarySmoothingOn();</div>
<div><span style="white-space: pre;"></span>smoother->Update();</div>
<div><br></div>
<div><span style="white-space: pre;"></span>vtk::vtkPolyDataNormals ^normals = gcnew vtk::vtkPolyDataNormals();</div>
<div><span style="white-space: pre;"></span>normals->GetOutput()->ReleaseDataFlagOff();</div>
<div><span style="white-space: pre;"></span>normals->SetInput(smoother->GetOutput());</div>
<div><span style="white-space: pre;"></span>normals->SetFeatureAngle(80);</div>
<div><span style="white-space: pre;"></span>normals->Update();</div>
<div><br></div>
<div><span style="white-space: pre;"></span> vtk::vtkStripper ^stripper1 = gcnew vtk::vtkStripper();</div>
<div><span style="white-space: pre;"></span>stripper1->SetInput(normals->GetOutput());</div>
<div><span style="white-space: pre;"></span>stripper1->GetOutput()->ReleaseDataFlagOff();</div>
<div><span style="white-space: pre;"></span>stripper1->Update();</div>
<div>// </div>
<div>// vtkDelaunay3D stripper = new vtkDelaunay3D();</div>
<div>// stripper.SetInputConnection(normals.GetOutputPort());</div>
<div>// stripper.Update();</div>
<div><span style="white-space: pre;"></span> vtkDataSetTriangleFilter ^stripper = gcnew vtkDataSetTriangleFilter();</div>
<div><span style="white-space: pre;"></span>stripper->SetInputConnection(normals->GetOutputPort());</div>
<div><br></div>
<div><br></div>
<div><span style="white-space: pre;"></span>vtkDataSetMapper ^mapper = gcnew vtkDataSetMapper();</div>
<div><span style="white-space: pre;"></span>mapper->SetInputConnection(stripper->GetOutputPort());</div>
<div><br></div>
<div><span style="white-space: pre;"></span>/////////////////////</div>
<div><br></div>
<div><br></div>
<div><span style="white-space: pre;"></span>// actor coordinates geometry, properties, transformation </div>
<div><span style="white-space: pre;"></span>vtkActor ^aSphere = gcnew vtkActor();</div>
<div><span style="white-space: pre;"></span>aSphere->SetMapper(mapper);</div>
<div><span style="white-space: pre;"></span> // aSphere.GetProperty().SetRepresentationToWireframe();</div>
<div><span style="white-space: pre;"></span>//aSphere.GetProperty().SetColor(0,0,1); // sphere color blue</div>
<div><br></div>
<div><span style="white-space: pre;"></span>// a renderer and render window </div>
<div><span style="white-space: pre;"></span>vtkRenderer ^ren1 = gcnew vtkRenderer();</div>
<div><span style="white-space: pre;"></span>vtkRenderWindow ^renWin = gcnew vtkRenderWindow();</div>
<div><span style="white-space: pre;"></span>renWin->AddRenderer(ren1);</div>
<div><br></div>
<div><span style="white-space: pre;"></span>// an interactor </div>
<div><span style="white-space: pre;"></span>vtkRenderWindowInteractor ^iren = gcnew vtkRenderWindowInteractor();</div>
<div><span style="white-space: pre;"></span>iren->SetRenderWindow(renWin);</div>
<div><br></div>
<div><span style="white-space: pre;"></span>// add the actor to the scene </div>
<div><span style="white-space: pre;"></span>ren1->AddActor(aSphere);</div>
<div><span style="white-space: pre;"></span>//ren1.SetBackground(1,1,1); // Background color white</div>
<div><br></div>
<div><span style="white-space: pre;"></span>// render an image (lights and cameras are created automatically) </div>
<div><span style="white-space: pre;"></span>renWin->Render();</div>
<div><br></div>
<div><span style="white-space: pre;"></span>// begin mouse interaction </div>
<div><span style="white-space: pre;"></span>iren->Start();</div>
<div><br></div>
<div>Hint : the delaunary3d take along time , so I stoped it before seeing the resuult</div></div></div></div><br></div>
</div></div><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><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></blockquote></div><br>