[vtkusers] strange output, any advice please

David Doria daviddoria+vtk at gmail.com
Wed Dec 16 19:25:06 EST 2009


On Wed, Dec 16, 2009 at 4:29 PM, Ali Habib <ali.mahmoud.habib at gmail.com> wrote:
> 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

I think you should look at the output at each step (using paraview
perhaps) and see if it is what you expect. I would test each section
with a very controlled input so you know what the output is supposed
to look like. Let us know when you have these intermediate results and
maybe we can see where it broke down.

Thanks,

David



More information about the vtkusers mailing list