<div dir="ltr">Hi Summer,<div><br></div><div>For the contour widget, you will probably have to create a new vtkPoints object where the points have the ordering specified by the the cell array returned by stripper->GetLines().  The vtkStripper doesn't put the points in order, it just provides a cell array that specifies how to put the points in order.</div><div><br></div><div> - David</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 17, 2017 at 12:48 AM, Summer Sun <span dir="ltr"><<a href="mailto:sunxiasx@foxmail.com" target="_blank">sunxiasx@foxmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thank you David,<br>
But I use code below, the render result still doesn't change.<br>
<br>
...<br>
<span class="">// get marching squares of image data<br>
</span><span class="">vtkSmartPointer<<wbr>vtkMarchingSquares> segContour =<br>
vtkSmartPointer<<wbr>vtkMarchingSquares>::New();<br>
</span>segContour->SetInputData(<wbr>segmentation); // segmentation is my image data<br>
<span class="">segContour->SetValue(0, 255);<br>
segContour->Update();<br>
<br>
// use vtkStripper to process marching squares data<br>
</span><span class="">vtkSmartPointer<vtkStripper> segPolyStripper =<br>
vtkSmartPointer<vtkStripper>::<wbr>New();<br>
segPolyStripper->SetInputData(<wbr>segContour->GetOutput());<br>
segPolyStripper->Update();<br>
<br>
</span>*// set points and lines according to stripper output*<br>
vtkSmartPointer<vtkPolyData> segPoly = vtkSmartPointer<vtkPolyData>::<wbr>New();<br>
segPoly->SetPoints(segContour-<wbr>>GetOutput()->GetPoints());<br>
segPoly->SetLines(<wbr>segPolyStripper->GetOutput()-><wbr>GetLines());<br>
<br>
// draw the contour<br>
contourWidget->Initialize(<wbr>segPoly);<br>
...<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Ordering-wrong-when-convert-vtkImageData-to-vtkPolyData-tp5742492p5742504.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.<wbr>com/Ordering-wrong-when-<wbr>convert-vtkImageData-to-<wbr>vtkPolyData-tp5742492p5742504.<wbr>html</a><br>
<div class="HOEnZb"><div class="h5">Sent from the VTK - Users mailing list archive at Nabble.com.<br>
______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br></div>