[vtkusers] Re: vtkImageViewer Display Axes

Anja Ende anja.ende at googlemail.com
Thu Sep 14 19:00:40 EDT 2006


Hi Dean,

Thanks for reply. I tried the code but it seems to have no affect...
Maybe I did something wrong here. I will try again tomorrow and will
update the list of my progress.

Cheers and thanks.

Anja


Hi Anja,

>*Also, is there a way to change the way the image is displayed without
*>*resorting to changing the orientation of the reslicer. I have a lot of
*>*calculations which uses the IndexMatrix of the reslicer and after I invert
*>*the Y axes, all those calculations are invalid because of the negative
*>*values.
*
Tell the camera of the vtkImageViewer to change its postion by 180 degrees
around the view up vector:

p' = 2 f - p

p' is the new camera position, p is the camera's original position and
f is the camera's focal point.

vtkCamera* camera = renderer->GetActiveCamera();
double f[3];
camera->GetFocalPoint(f);
double p[3];
camera->GetPosition(p);
p[0] = 2*f[0]-p[0];
p[1] = 2*f[1]-p[1];
p[2] = 2*f[2]-p[2];
camera->SetPosition(p);


Dean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060915/f5595c2d/attachment.htm>


More information about the vtkusers mailing list