[vtkusers] Fwd: the tetrahedralmesh not appear by using vtkStrippe

Jérôme jerome.velut at gmail.com
Wed Oct 28 11:09:52 EDT 2009


Hi Ali,

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.

I hope that I am right and that helps.
Jerome

2009/10/28 Ali Habib <ali.mahmoud.habib at gmail.com>

>
> Hi All,
>
> 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 :
> http://www.zib.de/Numerik/software/kardos/projects/mandible3.gif
>
> 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 :
>
>  //Variables
> array<double> ^metaScalarRange = gcnew array<double>(2) { 0, 0 };
>
>
> // Read a DICOM series path:
> vtk::vtkDICOMImageReader ^VDR = gcnew vtk::vtkDICOMImageReader();
> VDR->SetDirectoryName("H:\\work\\Master
> Degree\\DataSet\\case2\\DICOM\\PA1\\ST1\\SE2");
> VDR->SetDataOrigin(0, 0, 0);
>
> VDR->Update();
>
> /////
> vtk::vtkImageChangeInformation ^VIC = gcnew
> vtk::vtkImageChangeInformation();
> VIC->SetInput(VDR->GetOutput());
>
> VIC->CenterImageOn();
>
> VIC->Update();
>
> // set the imagedata
> vtk::vtkImageData ^VoxelData = VIC->GetOutput();
>
> vtk::vtkMarchingCubes ^mcubes = gcnew vtk::vtkMarchingCubes();
> mcubes->GetOutput()->ReleaseDataFlagOff();
> mcubes->SetInput(VoxelData);
> mcubes->SetValue(0, 4);
> mcubes->ComputeGradientsOn();
> mcubes->Update();
>
>
> vtk::vtkSmoothPolyDataFilter ^smoother = gcnew
> vtk::vtkSmoothPolyDataFilter();
> smoother->GetOutput()->ReleaseDataFlagOff();
> smoother->SetInput(mcubes->GetOutput());
> smoother->SetNumberOfIterations(5);
> smoother->SetRelaxationFactor(0.70);
> smoother->SetFeatureAngle(70);
> smoother->FeatureEdgeSmoothingOn();
> smoother->BoundarySmoothingOn();
> smoother->Update();
>
> vtk::vtkPolyDataNormals ^normals = gcnew vtk::vtkPolyDataNormals();
> normals->GetOutput()->ReleaseDataFlagOff();
> normals->SetInput(smoother->GetOutput());
> normals->SetFeatureAngle(80);
> normals->Update();
>
>  vtk::vtkStripper ^stripper1 = gcnew vtk::vtkStripper();
> stripper1->SetInput(normals->GetOutput());
> stripper1->GetOutput()->ReleaseDataFlagOff();
> stripper1->Update();
> //
> //          vtkDelaunay3D stripper = new vtkDelaunay3D();
> //            stripper.SetInputConnection(normals.GetOutputPort());
> //            stripper.Update();
>  vtkDataSetTriangleFilter ^stripper = gcnew vtkDataSetTriangleFilter();
> stripper->SetInputConnection(normals->GetOutputPort());
>
>
> vtkDataSetMapper ^mapper = gcnew vtkDataSetMapper();
> mapper->SetInputConnection(stripper->GetOutputPort());
>
> /////////////////////
>
>
> // actor coordinates geometry, properties, transformation
> vtkActor ^aSphere = gcnew vtkActor();
> aSphere->SetMapper(mapper);
>    // aSphere.GetProperty().SetRepresentationToWireframe();
> //aSphere.GetProperty().SetColor(0,0,1); // sphere color blue
>
> // a renderer and render window
> vtkRenderer ^ren1 = gcnew vtkRenderer();
> vtkRenderWindow ^renWin = gcnew vtkRenderWindow();
> renWin->AddRenderer(ren1);
>
> // an interactor
> vtkRenderWindowInteractor ^iren = gcnew vtkRenderWindowInteractor();
> iren->SetRenderWindow(renWin);
>
> // add the actor to the scene
> ren1->AddActor(aSphere);
> //ren1.SetBackground(1,1,1); // Background color white
>
> // render an image (lights and cameras are created automatically)
> renWin->Render();
>
> // begin mouse interaction
> iren->Start();
>
> Hint : the delaunary3d take along time , so I stoped it before seeing the
> resuult
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091028/4cfb792e/attachment.htm>


More information about the vtkusers mailing list