[vtkusers] Initialize a vtkContourWidget from vtkContourFilter

rakesh patil prakeshofficial at gmail.com
Tue Mar 8 08:34:42 EST 2011


Hi Yang,

You are initializing contour widget with orderedPolydata, which I dont see
anywhere else in the code. Do you mean that there, testPolyData should be
placed there??

Regards
Rakesh Patil

On Tue, Mar 8, 2011 at 6:40 AM, Xiaopeng Yang <yxp233 at postech.ac.kr> wrote:

> Hello all,
>
>
>
> I am trying to initialize a vtkContourWidget from vtkContourFilter. But the
> initialized vtkContourWidget is out of order. I think it is because of the
> poor quality of the polydata I defined from the contour.  Could you provide
> any idea how to get good polydata? Thanks in advance!
>
>
>
> Here is my code:
>
>
>
> vtkExtractVOI * extract = vtkExtractVOI::New();
>
> extract->SetInput(connector2->GetOutput());
>
> extract->SetVOI(0,512,0,512,101,101);
>
>
>
> vtkContourFilter * contour = vtkContourFilter::New();
>
> contour->SetInput( connector2->GetOutput() );
>
> contour->SetValue(0, 128);
>
>
>
> vtkStripper *stripper = vtkStripper::New();
>
> stripper->SetInput(contour->GetOutput());
>
> stripper->Update();
>
>
>
> vtkPolyData * testPoly = vtkPolyData::New();
>
> testPoly->SetPoints(stripper->GetOutput()->GetPoints());
>
>
>
> vtkOrientedGlyphContourRepresentation *contourRep =
> vtkOrientedGlyphContourRepresentation::New();
>
> vtkContourWidget *contourWidget = vtkContourWidget::New();
>
>
>
> contourWidget->SetInteractor(iren);
>
> contourWidget->SetRepresentation(contourRep);
>
> contourWidget->On();
>
>
>
> contourWidget->Initialize(orderedPolyData);
>
> contourWidget->Render();
>
>
>
> Best,
>
> Yang
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110308/709d5c15/attachment.htm>


More information about the vtkusers mailing list