[vtkusers] getting pointids from an imagedata

Matthias Zangl zangl at ism-austria.at
Mon Jul 9 09:59:04 EDT 2001


Hello John,

I tried out your suggestion and I am not clear, if everything is working
properly:

float worldPoint[4];

 this->GetRenderer()->SetDisplayPoint(x,y,lastY);
 this->GetRenderer()->DisplayToWorld();
 this->GetRenderer()->GetWorldPoint(worldPoint);

 int pointId = data->FindPoint(worldPoint[0],worldPoint[1],worldPoint[2]);

 float coord[3];
 data->GetPoint(pointId,coord);

The function FidnPoint seems to return a valid pointId (although the
worldPoint-coords are not very familiar for me (0.001....)). But at least I
am getting a pointId. For checking if its valid I tried to get the coords
from the point id (with getpoint). But the coords stored in the coord-array
are always 0,5 or -0,5 for all axes.. There should definitly be a way for
transforming them to useful coordinates,right?

Is there another way for doing something with my point for ensuring that I
got the right one?

thx,
Matt
----- Original Message -----
From: "John Biddiscombe" <jbiddiscombe at skippingmouse.co.uk>
To: "Matthias Zangl" <zangl at ism-austria.at>; <vtkusers at public.kitware.com>
Sent: Saturday, July 07, 2001 12:25 PM
Subject: Re: [vtkusers] getting pointids from an imagedata


> Sorry, I misread your request. You'll need to get the window->World
> coordinate conversion from
> vtkViewPort::DisplayToWorld
> and then use findpoint...
>
>
> At 15:29 06/07/2001, John Biddiscombe wrote:
> >vtkDataSet::
> >int FindPoint (float x, float y, float z)
> >int FindPoint (float x[3])
> >
> >all subclasses (ImageData) implement it and given a 3space coordinate,
you
> >can find the point ID of the one you want.
> >
> >JB
> >
> >
> >At 14:16 05/07/2001, Matthias Zangl wrote:
> >>Hello!
> >>
> >>I am displaying a volume (vtkImageData) - slice by slice on my screen. I
> >>realized it by changing the outputorigin on slicing. Well, that works
well
> >>so far. Now I want to get the pointid from a point the user is selecting
on
> >>the screen. All I got are the coordinates in the renderwindow. I suppose
> >>I've to take care that they 're calculated dependend on the resolution
and
> >>current zoomfactor of my image. Maybe someone have some hints for me.
> >>
> >>greatly appreciated,
> >>
> >>bye,
> >>Matt
> >>
> >>
> >>_______________________________________________
> >>This is the private VTK discussion list.
> >>Please keep messages on-topic. Check the FAQ at:
> >><http://public.kitware.com/cgi-bin/vtkfaq>
> >>Follow this link to subscribe/unsubscribe:
> >>http://public.kitware.com/mailman/listinfo/vtkusers
> >
> >
> >_______________________________________________
> >This is the private VTK discussion list. Please keep messages on-topic.
> >Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> >Follow this link to subscribe/unsubscribe:
> >http://public.kitware.com/mailman/listinfo/vtkusers
>






More information about the vtkusers mailing list