[vtkusers] vtkImageViewer2 image display

tobse tobias.meisel at phacon-leipzig.de
Fri Apr 4 05:11:46 EDT 2008


Hi,

I calculated the FocalPoint and the Position of the camera with respect to
the image size

1. determine the size of the image in x and y direction (using the extent
and the spacing of the input image)
2. based on the larger axes, you can modify the view angle or the distance
of the camera
  
            angle = Camera->GetViewAngle();
            distance= SizeOfLargerAxes/2/tan(angle/2);
3. Determine the middle of the image
4. Focus the camera to the middle of the image 

      
            Camera->SetFocalPoint(xmax/2, ymax/2, 0);
             Camera->SetPosition(xmax/2,ymax/2,distance);

This will work as long as the image is in the xy-plane , with z=0.

hope this will help

tobse
-- 
View this message in context: http://www.nabble.com/vtkImageViewer2-image-display-tp16486823p16489656.html
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list