[vtkusers] strange output, any advice please

Ali Habib ali.mahmoud.habib at gmail.com
Wed Dec 16 16:29:30 EST 2009


I used two algorithms to create 3D mesh but the out put is so strange

The first one using Delunary2d function and the code is :

// algorithm using Delunary 3d

vtkDICOMImageReader *v16 = vtkDICOMImageReader::New();

v16->SetDirectoryName(
@"D:\work\MasterDegree\DataSet\case2\DICOM\PA1\ST1\SE2");

            v16->SetDataOrigin(2, 2, 1);

            v16->Update();

            vtkMarchingCubes *skinExtractor =vtkMarchingCubes::New();

            skinExtractor->GetOutput()->ReleaseDataFlagOff();

            skinExtractor->SetInputConnection(v16->GetOutputPort());

            skinExtractor->SetValue(0, 500);

            skinExtractor->ComputeGradientsOn();

            skinExtractor->Update();

            vtkTriangleFilter *VTF = vtkTriangleFilter::New();

            VTF->SetInputConnection(skinExtractor->GetOutputPort());

            VTF->GetOutput()->ReleaseDataFlagOff();

            VTF->Update();

            vtkDelaunay2D *stripper =vtkDelaunay2D::New();

            stripper->SetInputConnection(VTF->GetOutputPort());

            stripper->GetOutput()->ReleaseDataFlagOff();

            stripper->Update();

            vtkPolyDataMapper *skinMapper = vtkPolyDataMapper::New();

            skinMapper->SetInput(stripper->GetOutput());

            skinMapper->ScalarVisibilityOff();

            vtkActor *skin = vtkActor::New();

            skin->SetMapper(skinMapper);

* *

*the seconde one  using  **vtkClipDataSet the code is *

            vtkClipDataSet VCD = vtkClipDataSet::New();

            VCD->GetOutput()->ReleaseDataFlagOff();

            VCD->SetInputConnection(skinExtractor->GetOutputPort());

            VCD->Update();



            vtkDataSetTriangleFilter VDST =vtkDataSetTriangleFilter::New();

            VDST->GetOutput()->ReleaseDataFlagOff();

            VDST->SetInputConnection(VCD->GetOutputPort());

            VDST->Update();



            // Create Mapper

            vtkDataSetMapper skinMapper = vtkDataSetMapper::New();

            skinMapper->SetInputConnection(VDST->GetOutputPort());

Attached is example of strange output



Best regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091216/b3b8f4f5/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: VTK_delunary3D.jpg
Type: image/jpeg
Size: 71703 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091216/b3b8f4f5/attachment.jpg>


More information about the vtkusers mailing list