[Insight-users] plane cut the 3-D mesh surface into contours

Quan Chen quanchen at gmail.com
Mon Apr 25 15:26:02 EDT 2005


I am wondering if ITK have this functionality or I have to resort from VTK.
I have build a 3-D mesh surface.  Now I want to cut it and get contours.  I
tried with VTK functions vtkCutter.  However, the "contour" I got is just a
group of lines without correct ordering.  For example, a closed contour
would be like this 1->2, 2->3, 3->4, 4->1, but what I got was sth like this:
1->2, 3->4, 2->3, 4->1.  I could do a scan and switch the sequence.
However, I am wondering if ITK or VTK have other functions that I could use
to get a contour.
 
My code that uses vtk class:
vtkPlane   *plane=vtkPlane::New();
plane->SetOrigin(0, 0, 0);
plane->SetNormal(1, 0, 0);
 
vtkCutter  *cutEdges=vtkCutter::New();
cutEdges->SetInput(vtkdata);
cutEdges->SetCutFunction(plane);
cutEdges->GenerateCutScalarsOn();
cutEdges->GenerateValues(10, 0, 50);
 
vtkPolyDataWriter *contourwriter=vtkPolyDataWriter::New();
contourwriter->SetFileName("contour.vtk");
contourwriter->SetInput(cutEdges->GetOutput());
contourwriter->Update();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20050425/f6db6e79/attachment.html


More information about the Insight-users mailing list