I tried to manipulate the camera's position but with no success. If in axial initially the position is 0,0,1 and the view up 0,1,0 it is suposed to change position to 0,0,-1 to get an horizontal flip, but I get no change. Maybe I'm missing another stuff with the camera, like clipping range, parallel scale...? Does anybody know?
<br><br><div><span class="gmail_quote">2007/1/26, Amy Squillacote &lt;<a href="mailto:amy.squillacote@kitware.com">amy.squillacote@kitware.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Jesús,<br><br>Why not directly manipulate the camera&#39;s position (SetPosition method)<br>and view up vector (SetViewUp method)?<br><br>- Amy<br><br>Jesús Spí­nola wrote:<br>&gt; Hi,<br>&gt;<br>&gt; I&#39;m using vtkImageViewer for a 2D medical image viewer and I want to
<br>&gt; put flipping functionality. My purpose is to flip, either horizontally<br>&gt; or verticaly, the image in axial, sagital or coronal view. I know<br>&gt; about vtkImageFlip filter but I want to avoid it because I think I can
<br>&gt; do the same, manipulating directly the camera and it would be faster.<br>&gt;<br>&gt; My question is that I don&#39;t know exactly which is the proper method to<br>&gt; achieve the flipping with vtkCamera. For rotations on the image I used
<br>&gt; the SetRoll method, it seems I&#39;ll need one of this ones Yaw, Azimuth,<br>&gt; Elevation, Pitch, etc to flip, but I don&#39;t obtain the results that i<br>&gt; like.<br>&gt; If I&#39;m on the axial view, Yaw(180) is ok for horizontal flip, but with
<br>&gt; sagital or coronal view it doesn&#39;t behave well.<br>&gt;<br>&gt; Did someone achieved correct flippings manipulating vtkCamera?<br>&gt;<br>&gt; Her are some code snippets that tell what I&#39;m doing in each situation:
<br>&gt;<br>&gt; To change to axial view<br>&gt;<br>&gt; m_imageViewer-&gt;SetSliceOrientationToXY();<br>&gt; // this is because the vtk default axial orientation is not as the<br>&gt; medical axial orientation<br>&gt; camera-&gt;SetFocalPoint(0,0,0);
<br>&gt; camera-&gt;SetViewUp(0,-1,0);<br>&gt; camera-&gt;SetPosition(0,0,-1);<br>&gt; renderer-&gt;ResetCamera();<br>&gt; cam-&gt;SetRoll( -m_rotateFactor*90. + 180. ); // apply the rotation of<br>&gt; the camera, it will be always 0,90,180 or 270 degrees
<br>&gt;<br>&gt;<br>&gt; To change to sagital view<br>&gt;<br>&gt; m_imageViewer-&gt;SetSliceOrientationToYZ();<br>&gt; camera-&gt;SetRoll( -m_rotateFactor*90. -90. );<br>&gt;<br>&gt;<br>&gt; To change to coronal view<br>
&gt;<br>&gt; m_imageViewer-&gt;SetSliceOrientationToYZ();<br>&gt; camera-&gt;SetRoll( -m_rotateFactor*90.&nbsp;&nbsp;);<br>&gt;<br>&gt; When i update the camera to apply a flip:<br>&gt;<br>&gt; if( m_applyFlip )<br>&gt; {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; camera-&gt;OrthogonalizeViewUp();
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; camera-&gt;Yaw(180);<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; renderer()-&gt;ResetCamera();<br>&gt; }<br>&gt; ------------------------------------------------------------------------<br>&gt;<br>&gt; _______________________________________________
<br>&gt; This is the private VTK discussion list.<br>&gt; Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><br>&gt; Follow this link to subscribe/unsubscribe:
<br>&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>&gt;<br></blockquote></div><br>