<div class="gmail_quote">On Tue, Oct 12, 2010 at 10:33 AM, Jonathan Morra <span dir="ltr"><<a href="mailto:jonmorra@gmail.com">jonmorra@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
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 <a href="http://vtk.1045678.n5.nabble.com/vtkContourWidget-with-vtkImageViewer2-td1236295.html" target="_blank">http://vtk.1045678.n5.nabble.com/vtkContourWidget-with-vtkImageViewer2-td1236295.html</a> and created the following code as a result (in Java)<div>
<br><div><div> vtkContourWidget contourWidget = new vtkContourWidget();</div><div> contourWidget.SetInteractor(panel.getRenWin().getIren());</div><div> contourWidget.FollowCursorOn();</div><div><br></div>
<div> vtkOrientedGlyphContourRepresentation rep = new vtkOrientedGlyphContourRepresentation();</div><div> contourWidget.SetRepresentation(rep);</div><div><br></div><div> vtkImageActorPointPlacer placer = new vtkImageActorPointPlacer();</div>
<div> placer.SetImageActor(panel.getImageViewer().GetImageActor());</div><div> rep.SetPointPlacer(placer);</div></div></div></blockquote><div><br>What this point placer does is to constrain the contour to the plane defined by the ImageActor. However, given that the same image actor is used for multiple slices, when you change the slice, the position of the image actor effectively changes and the contour updates itself to lie on the new plane. <br>
<br>What you need is to use a vtkBoundedPlanePointPlacer with the bounding planes de-lienating the bounds of the image actor when the contour is defined. That way it won't change when you change the slice.<br><br>Also to manage visibility of the contour (the contour will be visible for all slices in front of the defined slice), you could subclass the contour representation, insert a clipper that clips the polydata based on the bounding planes, that way, visibility is implicitly managed by the representation.<br>
<br>--<br>karthik<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div><div> contourWidget.EnabledOn();</div><div> contourWidget.ProcessEventsOn();</div>
</div></div><div><br></div><div>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.</div>
<div><br></div><div>Any suggestions about how to do this correctly would be greatly appreciated.</div><div><br></div><div>Thanks</div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/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" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br>