The handles exist in 3D space. The plane widget (image actor) also exists in a 3D world. The seeds, if they are behind the actor plane are occluded. If they are in front of the plane, they will be visible. If they are right on the plane, they may flip flop. <br>
<br>The widgets do not know about the slice plane at all. This is something you may have to manage at the application level, enabling/disabling the widget if it is on the wrong slice.<br><br>--<br>karthik<br><br><div class="gmail_quote">
On Fri, Apr 24, 2009 at 11:18 AM, kent williams <span dir="ltr"><<a href="mailto:nkwmailinglists@gmail.com">nkwmailinglists@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;">
The problem is that even if I use vtkPointHandleRepresentation3D, the<br>
widget interacts very poorly with the Plane view widget I'm using,<br>
which is vtkinria3d's vtkViewImage2D class.<br>
<br>
If I use vtkPointHandleRepresentation3D, I have to call 'AllOn()'<br>
before anytheing shows up, and then box & crosshairs don't go away if I<br>
switch to a different slice. If I zoom in and out, the crosshairs<br>
and bounding boxes flip in and out of visibility, as though they're<br>
being clipped incosistently by the view plane.<br>
<br>
What I don't get is how the SeedWidget actors know which slice is<br>
being displayed. I don't see the connection there. Here is my setup<br>
code:<br>
<br>
typedef vtkPointHandleRepresentation3D HandleRepType;<br>
<br>
HandleRepType *handle =<br>
HandleRepType::New();<br>
handle->AllOn();<br>
handle->GetProperty()->SetColor(1,0,0);<br>
<br>
this->m_SeedRepresentation =<br>
vtkSeedRepresentation::New();<br>
this->m_SeedRepresentation->SetHandleRepresentation(handle);<br>
<br>
this->m_SeedWidget = vtkSeedWidget::New();<br>
// m_ViewImage type is vtkinria3d's vtkViewImage2D<br>
vtkImageActor *imageActor = this->m_ViewImage->GetImageActor();<br>
this->m_Placer = vtkImageActorPointPlacer::New();<br>
<br>
this->m_Placer->SetImageActor(imageActor);<br>
this->m_Orientation = this->m_ViewImage->GetOrientation();<br>
this->m_SeedWidget->SetInteractor(this->m_ViewImage->GetRenderWindowInteractor());<br>
this->m_SeedWidget->SetRepresentation(this->m_SeedRepresentation);<br>
this->m_SeedWidget->SetKeyPressActivation(0);<br>
this->m_SeedWidget->On();<br>
<div><div></div><div class="h5"><br>
<br>
On Thu, Apr 23, 2009 at 10:42 PM, Karthik Krishnan<br>
<<a href="mailto:karthik.krishnan@kitware.com">karthik.krishnan@kitware.com</a>> wrote:<br>
> Kent:<br>
><br>
> I apologize for any poor documentation.. will try to add some. Here is an<br>
> explanation.<br>
><br>
> vtkPointHandleRepresentation2D - The geometrical representation (a 2D cross<br>
> hair) is composed of vtkActor2D and entirely exists on the overlay plane.<br>
> Being rendered as an overlay, it will be visible even if you change slices<br>
> etc. This is the only representation that exists on the overlay plane.<br>
><br>
> vtkPointHandleRepresentation3D - Its rendered as a 3D cross hair (much like<br>
> vtkCursor3D) and exists in physical space. It will change its visibility as<br>
> you toggle slices. Try to set the point placer as a vtkImageActorPointPlacer<br>
> on this representation if you are placing it on an image actor. I'll try to<br>
> add a test/example when I get a chance.<br>
><br>
> vtkSphereHandleRepresentation - Same as vtkPointHandleRepresentation3D,<br>
> except that its rendered as a sphere<br>
><br>
> vtkPolygonalHandleRepresentation3D - Same as vtkPointHandleRepresentation3D,<br>
> except that it is rendered as an arbitrary polygonal shape.<br>
><br>
> Thanks<br>
> --<br>
> karthik<br>
><br>
> On Thu, Apr 23, 2009 at 5:42 PM, kent williams <<a href="mailto:nkwmailinglists@gmail.com">nkwmailinglists@gmail.com</a>><br>
> wrote:<br>
>><br>
>> I was having nothing but trouble trying to get the vtkSeedWidget<br>
>> going, and I instrumented it so I could quickly try all the<br>
>> HandleRepresentation types.<br>
>><br>
>> What I'd like is for points to display in a 2D viewer, allow all the<br>
>> normal interactions, and when I change to a different slice, the<br>
>> handles disappear. When I change back to the slice, the points should<br>
>> reappear.<br>
>><br>
>> What actually happens is this, depending on representation:<br>
>><br>
>> 1. vtkPointHandleRepresentation2D: Points stuck at one pixel size,<br>
>> regardless of zoom. Nearly invisible. They stay visible no matter<br>
>> what slice you go to.<br>
>> 2. vtkPointHandleRepresentation3D: Nothing shows up in my 2D viewer at<br>
>> all.<br>
>> 3. vtkPolygonalRepresentation3D -- with geometry provided by a<br>
>> vtkSphereSource: Spheres display, but don't disappear if you change<br>
>> slices. Points can't be selected, moved, or deleted with the mouse.<br>
>> 4.vtkSphereHandleRepresentation -- pretty much as case #3.<br>
>><br>
>> I am using vtkinria3d's vtkViewWidget2D class, and not<br>
>> vtkImageViewer2, but that shouldn't cause this problem -- I though if<br>
>> I used 3D, the handles would disappear when i changed slices and<br>
>> reappear when i went back to the original slice.<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<br>
>> <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:<br>
>> <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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Karthik Krishnan<br>R&D Engineer,<br>Kitware Inc.<br>Ph: 518 881 4919<br>Fax: 518 371 4573<br>