[vtkusers] vtkImageViewer display axes

Dean Inglis dean.inglis at sympatico.ca
Tue Sep 12 11:19:08 EDT 2006


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



More information about the vtkusers mailing list