Hi David, <div>It&#39;s not working :(</div><div><br></div><div>here is the snippet of my code:</div><div><br></div><div><br></div><div><div><font face="courier new, monospace">void </font></div><div><font face="courier new, monospace">SliceRenderView::SetView(</font></div>
<div><font face="courier new, monospace"><span class="" style="white-space:pre">        </span>ViewType a_view)</font></div><div><font face="courier new, monospace">{</font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">        </span>d_view = a_view;</font></div>
<div><span class="" style="white-space:pre"><font face="courier new, monospace">        </font></span></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">        </span>switch (d_view) {</font></div><div>
<font face="courier new, monospace"><span class="" style="white-space:pre">                </span>case eAxial: {</font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">                        </span>d_interactorStyle-&gt;SetZViewRightVector(1,0,0);<span class="" style="white-space:pre">        </span></font></div>
<div><font face="courier new, monospace"><span class="" style="white-space:pre">                        </span>d_interactorStyle-&gt;SetZViewUpVector(0,1,0);<span class="" style="white-space:pre">                        </span></font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">                        </span>}</font></div>
<div><font face="courier new, monospace"><span class="" style="white-space:pre">                        </span>break;</font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">                </span>case eSagittal: {</font></div>
<div><font face="courier new, monospace"><span class="" style="white-space:pre">                        </span>d_interactorStyle-&gt;SetXViewRightVector(0,1,0);<span class="" style="white-space:pre">        </span></font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">                        </span>d_interactorStyle-&gt;SetXViewUpVector(0,0,1);<span class="" style="white-space:pre">                                                </span></font></div>
<div><font face="courier new, monospace"><span class="" style="white-space:pre">                        </span>}</font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">                        </span>break;</font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">                </span>case eCoronal: {</font></div>
<div><font face="courier new, monospace"><span class="" style="white-space:pre">                        </span>d_interactorStyle-&gt;SetYViewRightVector(1,0,0);<span class="" style="white-space:pre">        </span></font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">                        </span>d_interactorStyle-&gt;SetYViewUpVector(0,0,1);<span class="" style="white-space:pre">                        </span></font></div>
<div><font face="courier new, monospace"><span class="" style="white-space:pre">                        </span>}</font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">                        </span>break;</font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">                </span>case eOblique:</font></div>
<div><span class="" style="white-space:pre"><font face="courier new, monospace">                        </font></span></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">                </span>default:</font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">                        </span>std::cout &lt;&lt; &quot;Unimplemented&quot; &lt;&lt; std::endl;</font></div>
<div><font face="courier new, monospace"><span class="" style="white-space:pre">        </span>}<span class="" style="white-space:pre">        </span></font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">        </span>this-&gt;setCornerAnnotationText(d_ViewText[d_view]);</font></div>
<div><font face="courier new, monospace"><span class="" style="white-space:pre">        </span>this-&gt;renderer()-&gt;ResetCamera();</font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">        </span>d_interactorStyle-&gt;SetImageOrientation(d_interactorStyle-&gt;GetZViewRightVector(),</font></div>
<div><font face="courier new, monospace"><span class="" style="white-space:pre">                </span>d_interactorStyle-&gt;GetZViewUpVector());<span class="" style="white-space:pre">                </span></font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">        </span>/*</font></div>
<div><font face="courier new, monospace"><span class="" style="white-space:pre">        </span>this-&gt;renderWindow()-&gt;Render();</font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">        </span>this-&gt;renderWindow()-&gt;GetInteractor()-&gt;Render();</font></div>
<div><font face="courier new, monospace"><span class="" style="white-space:pre">        </span>this-&gt;repaint();</font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">        </span>*/</font></div>
<div><font face="courier new, monospace">}</font></div></div><div><font face="courier new, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">It gets called when the image has been loaded</font></div>
<div><font face="arial, helvetica, sans-serif"><br></font></div><div><div><font face="courier new, monospace">void </font></div><div><font face="courier new, monospace">SliceRenderView::setImageData(</font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">        </span>VolumeData* a_data)</font></div>
<div><font face="courier new, monospace">{</font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">        </span>std::cout &lt;&lt; __FUNCTION__ &lt;&lt; std::endl;</font></div><div><font face="courier new, monospace"><br>
</font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">        </span>d_image = a_data-&gt;GetImage();</font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">        </span>d_imgResliceMapper-&gt;SetInput(d_image);<span class="" style="white-space:pre">        </span></font></div>
<div><font face="courier new, monospace"><span class="" style="white-space:pre">        </span>d_imgSlice-&gt;SetMapper(d_imgResliceMapper);<span class="" style="white-space:pre">        </span></font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">        </span>d_imgSlice-&gt;SetProperty(d_imgProp); </font></div>
<div><font face="courier new, monospace"><span class="" style="white-space:pre">        </span>this-&gt;SetView(d_view);</font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">        </span>this-&gt;renderWindow()-&gt;Render();<span class="" style="white-space:pre">                </span></font></div>
<div><font face="courier new, monospace"><span class="" style="white-space:pre">        </span>this-&gt;renderer()-&gt;ResetCameraClippingRange();<span class="" style="white-space:pre">                </span> <span class="" style="white-space:pre">        </span></font></div>
<div><span class="" style="white-space:pre"><font face="courier new, monospace">        </font></span></div><div><font face="courier new, monospace">}</font></div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">
Any hints on what can be wrong?</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Dec 5, 2012 at 1:16 PM, David Gobbi <span dir="ltr">&lt;<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Sergio,<br>
<br>
The view will change if you call SetImageOrientation().  For example:<br>
<br>
style-&gt;SetImageOrientation(style-&gt;GetZViewRightVector(),<br>
                          style-&gt;GetZViewUpVector());<br>
<br>
Or you can use code like this:<br>
<br>
double vector1[3] = { 1.0, 0.0, 0.0 };<br>
double vector2[3] = { 0.0, 0.0, -1.0 };<br>
style-&gt;SetImageOrientation(vector1, vector2);<br>
<br>
 - David<br>
<div class="HOEnZb"><div class="h5"><br>
On Wed, Dec 5, 2012 at 2:53 AM, Sergio Vera &lt;<a href="mailto:sergio.vera@alma3d.com">sergio.vera@alma3d.com</a>&gt; wrote:<br>
&gt; Hello all<br>
&gt; I&#39;m implementing a medical image viewer with the typical 3+1 windows (axial,<br>
&gt; coronal sagittal and 3d) layout.<br>
&gt;<br>
&gt; Each window has his vtkRenderWindowInteractor and vtkIntractorStyleImage<br>
&gt;<br>
&gt; I setup the interactor styles views vectors (right &amp; up) for each slice view<br>
&gt; (axial, coronal, sagital) with<br>
&gt; SetZViewRightVector() and SetZViewUpVector().<br>
&gt;<br>
&gt; However, my views don&#39;t change, no matter how hard I try to update the<br>
&gt; window / renderer / renderwindow /camera (I believe I&#39;ve tested almost all,<br>
&gt; if not all possibilities)<br>
&gt;<br>
&gt; The only way is to manually click &quot;x&quot; &quot;z&quot; or &quot;y&quot; keys on each window to<br>
&gt; obtain the desired point of view in the images.<br>
&gt;<br>
&gt; Anyone knows how to automatically set my views to the desired way without<br>
&gt; having to press keys?<br>
&gt;<br>
&gt; By the wai I use ctkVTKRenderView not a regular vtkRenderWindow but I<br>
&gt; believe this is not related to CTK.<br>
&gt;<br>
&gt; Best regards<br>
&gt; --<br>
&gt; Sergio Vera<br>
&gt;<br>
&gt;  Alma IT Systems<br>
&gt;  C/ Vilana, 4B, 4º 1ª<br>
&gt;  08022 Barcelona<br>
&gt;  T. <a href="tel:%28%2B34%29%20932%20380%20592" value="+34932380592">(+34) 932 380 592</a><br>
&gt;  <a href="http://www.alma3d.com" target="_blank">www.alma3d.com</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Sergio Vera<br><br> Alma IT Systems<br> C/ Vilana, 4B, 4º 1ª<br> 08022 Barcelona<br> T. (+34) 932 380 592<br> <a href="http://www.alma3d.com">www.alma3d.com</a><br>

</div>