I have a simple vtkImageViewer2 code displaying 3D data. I am trying to display correct orientation due to ITK to vtk conversion.<div>but change in any of the variables of vtkCamera like viewUp is not reflected in the image. Have tried to see user list but the code seems to be not working.</div>
<div>Please help in finding whats wrong with the code.<br clear="all"><br></div><div><b>// Create Renderer</b></div><div><div>vtkRenderer *ren1 = vtkRenderer::New();</div><div>vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><br></div><div>typedef unsigned short    PixelType;</div><div>const unsigned int      Dimension = 3;</div><div>typedef itk::Image&lt; PixelType, Dimension &gt;         ImageType;</div>
<div><br></div><div><b>// Create the reader for the data</b></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>typedef itk::ImageFileReader &lt;ImageType&gt; FileReaderType;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>FileReaderType::Pointer reader = FileReaderType::New();</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>reader-&gt;SetFileName(argv[1]);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>reader-&gt;Update();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div>   std::cout &lt;&lt; &quot;Reading and conversion Complete..&quot; &lt;&lt; std::endl;</div><div><br></div><div><b>// ITK To VTK conversion</b></div><div>  </div><div>typedef itk::ImageToVTKImageFilter &lt;ImageType&gt;<span class="Apple-tab-span" style="white-space:pre">                                </span>   itktovtkConnectorType;</div>
<div> itktovtkConnectorType::Pointer connector1_UC = itktovtkConnectorType::New();</div><div>connector1_UC-&gt;SetInput(reader-&gt;GetOutput());</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>try</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>connector1_UC-&gt;Update();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>catch(itk::ExceptionObject &amp;e)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>std::cout &lt;&lt;&quot;excep in spacing&quot;&lt;&lt; e&lt;&lt;std::endl;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><br></div><div><br></div><div>    vtkImageViewer2 * viewer = vtkImageViewer2::New();</div><div>    viewer-&gt;SetupInteractor(iren );</div><div>
    viewer-&gt;GetRenderWindow()-&gt;AddRenderer(ren1);</div><div>    viewer-&gt;SetInput( connector1_UC-&gt;GetOutput() );</div><div>    viewer-&gt;SetSlice(0);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkCamera *aCamera = vtkCamera::New();</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>aCamera-&gt;SetViewUp (0,-1, 0);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>aCamera-&gt;SetPosition (0, 0, 1);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>aCamera-&gt;SetFocalPoint (0, 0, 0);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>viewer-&gt;GetRenderer()-&gt;SetActiveCamera(aCamera);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>viewer-&gt;GetRenderer()-&gt;ResetCamera();</div>
<div><br></div><div>    viewer-&gt;SetColorWindow( 255 );</div><div>    viewer-&gt;SetColorLevel( 128 );</div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span></div><div>     viewer-&gt;Render();</div>
<div>     iren-&gt;Start();</div><div>   </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>return 0 ;</div></div><div><br></div><div>Thanks<br>Anu..<br>
</div>