[vtkusers] Question about contour widget

Jonathan Morra jonmorra at gmail.com
Tue Oct 12 01:03:01 EDT 2010


I have a vtkImageViewer2 and wish to use vtkContourWidget to draw a contour
on the image.  The data I'm loading is a 3D DICOM CT volume.  I have found
the following question
http://vtk.1045678.n5.nabble.com/vtkContourWidget-with-vtkImageViewer2-td1236295.html
and
created the following code as a result (in Java)

        vtkContourWidget contourWidget = new vtkContourWidget();
        contourWidget.SetInteractor(panel.getRenWin().getIren());
        contourWidget.FollowCursorOn();

        vtkOrientedGlyphContourRepresentation rep = new
vtkOrientedGlyphContourRepresentation();
        contourWidget.SetRepresentation(rep);

        vtkImageActorPointPlacer placer = new vtkImageActorPointPlacer();
        placer.SetImageActor(panel.getImageViewer().GetImageActor());
        rep.SetPointPlacer(placer);

        contourWidget.EnabledOn();
        contourWidget.ProcessEventsOn();

When I do this and draw a contour and then scroll through the image planes
the same contour appears on every plane.  Ideally I'd like a different
contour on every plane.  If I don't use the vtkImageActorPointPlacer then
the contour only appears on one plane but it's the same plane regardless of
which plane is being viewed, which is also wrong.

Any suggestions about how to do this correctly would be greatly appreciated.

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101011/cbee3436/attachment.htm>


More information about the vtkusers mailing list