Hi, <br><br>I'm using vtkImageViewer for a 2D medical image viewer and I want to put flipping functionality. My purpose is to flip, either horizontally or verticaly, the image in axial, sagital or coronal view. I know about vtkImageFlip filter but I want to avoid it because I think I can do the same, manipulating directly the camera and it would be faster.
<br><br>My question is that I don't know exactly which is the proper method to achieve the flipping with vtkCamera. For rotations on the image I used the SetRoll method, it seems I'll need one of this ones Yaw, Azimuth, Elevation, Pitch, etc to flip, but I don't obtain the results that i like.
<br>If I'm on the axial view, Yaw(180) is ok for horizontal flip, but with sagital or coronal view it doesn't behave well.<br><br>Did someone achieved correct flippings manipulating vtkCamera?<br><br>Her are some code snippets that tell what I'm doing in each situation:
<br><br>To change to axial view<br><br>m_imageViewer->SetSliceOrientationToXY();<br>// this is because the vtk default axial orientation is not as the medical axial orientation<br>camera->SetFocalPoint(0,0,0);
<br>camera->SetViewUp(0,-1,0);<br>camera->SetPosition(0,0,-1);<br>renderer->ResetCamera();<br>cam->SetRoll( -m_rotateFactor*90. + 180. ); // apply the rotation of the camera, it will be always 0,90,180 or 270 degrees
<br><br><br>To change to sagital view<br>
<br>
m_imageViewer->SetSliceOrientationToYZ();<br>camera->SetRoll( -m_rotateFactor*90. -90. );<br><br><br>
To change to coronal view<br>
<br>
m_imageViewer->SetSliceOrientationToYZ();<br>
camera->SetRoll( -m_rotateFactor*90. );<br><br>When i update the camera to apply a flip:<br><br>if( m_applyFlip )<br>{ <br> camera->OrthogonalizeViewUp();<br> camera->Yaw(180);<br> renderer()->ResetCamera();
<br>}<br>