[vtkusers] Ordering wrong when convert vtkImageData to vtkPolyData

Summer Sun sunxiasx at foxmail.com
Fri Mar 17 02:48:54 EDT 2017


Thank you David,
But I use code below, the render result still doesn't change.

...
// get marching squares of image data
vtkSmartPointer<vtkMarchingSquares> segContour =
vtkSmartPointer<vtkMarchingSquares>::New();
segContour->SetInputData(segmentation); // segmentation is my image data
segContour->SetValue(0, 255);
segContour->Update();

// use vtkStripper to process marching squares data
vtkSmartPointer<vtkStripper> segPolyStripper =
vtkSmartPointer<vtkStripper>::New();
segPolyStripper->SetInputData(segContour->GetOutput());
segPolyStripper->Update();

*// set points and lines according to stripper output*
vtkSmartPointer<vtkPolyData> segPoly = vtkSmartPointer<vtkPolyData>::New();
segPoly->SetPoints(segContour->GetOutput()->GetPoints());
segPoly->SetLines(segPolyStripper->GetOutput()->GetLines());

// draw the contour
contourWidget->Initialize(segPoly);
...



--
View this message in context: http://vtk.1045678.n5.nabble.com/Ordering-wrong-when-convert-vtkImageData-to-vtkPolyData-tp5742492p5742504.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list