<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>