[vtkusers] SeedWidget with ImageViewer2 to get 3D locations

Karthik Krishnan karthik.krishnan at kitware.com
Thu Feb 19 17:11:26 EST 2009


Mark:

This depends on the representation for the handles that you
are passing onto the seed widget. As you may be aware, we
have both 2D and 3D representations. 2D representations are
essentially vtkActor2D's and exist on the overlay plane and will
be visible across all slices. My guess is that this is what you are using.

Putting it in code....

The following will create seeds that lie on the overlay plane with
a behaviour you describe..

  vtkSeedRepresentation *rep = vtkSeedRepresentation::New();
  vtkPointHandleRepresentation2D *handle =
      vtkPointHandleRepresentation2D::New();
  rep->SetHandleRepresentation(handle);

The following will create seeds that lies in world coordinates.

  vtkSeedRepresentation *rep = vtkSeedRepresentation::New();
  vtkPointHandleRepresentation3D *handle =
      vtkPointHandleRepresentation3D::New();
  rep->SetHandleRepresentation(handle);





On Thu, Feb 19, 2009 at 10:07 AM, kent williams
<nkwmailinglists at gmail.com>wrote:

> I suspect that while it reports 3D points, they're really 2D, and you
> have to fill in the Z coordinate.  You should know this anyway since
> you use the sliderWidget to scroll through the volume.
>
> I'm curious about your application. We're going to do the same thing
> for picking points of interest in a volume.  Another developer in our
> team is working on that, so I don't have hands on experience with the
> vtkSeedWidget yet, but I suspect that it has the same idiosyncrasy
> with respect to the coordinate system in which it reports points.  It
> has methods that have 'WorldCoordinates' in the name, but in fact, the
> X,Y,Z values are permuted such that X and Y are X and Y in the viewing
> plane, and Z is the direction perpendicular to the viewing plane.
>
> We use vtkinria3d's synchronized views instead of vtkImageViewer2, and
> I don't know if the idea of coordinate systems in 2D views are exactly
> the same, but we additionally have to negate the Y coordinate in Axial
> views. So if your point values look upside down, that's one thing to
> consider ;-)
>
> On Thu, Feb 19, 2009 at 7:06 AM, Mark Gooding <mark.gooding at gmail.com>
> wrote:
> > Hi there,
> >
> > I'm using an ImageViewer2 with a sliderWidget to scroll through a
> > volume image (following an example I found in the archives when
> > searching for a solution to this problem). I am also using a
> > SeedWidget to select points from the current slice. The display XY
> > co-ordinate seems to be picked correctly, however the slice selected
> > by the seed widget is not the current slice, but appears to be fixed.
> > Has anyone done something like this? Some pointers would be helpful.
> >
> > thanks,
> >
> > mark
> > _______________________________________________
> > 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
> >
> _______________________________________________
> 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
>



-- 
Karthik Krishnan
R&D Engineer,
Kitware Inc.
Ph: 518 371 3971 x119
Fax: 518 371 3971
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090219/cba44590/attachment.htm>


More information about the vtkusers mailing list