<div>Hi all,</div>
<div> </div>
<div>I'm a bit confused about how cameras are initialized. I would like to scale a 2D image (scale a DICOM image to best fit a viewport size). I first did this via vtkImageResample and that works fine, but now I would like to try this with accelarated scaling and so I wanted to do that as part of the visualization pipeline (I hope that means that it is actually using OpenGL). I replaced my original vtkActor2D/vtkImageMapper with a vtkImageActor. The following works (pseudo code):</div>
<div> </div>
<div>Variant 1:</div>
<div>- add imageActor to renderer, and renderer to renderwindow. Then call Render() on renderwindow. </div>
<div>-> The image displays as expected in the original size.</div>
<div> </div>
<div>Variant 2:</div>
<div>- same as in Variant 1 (including Render() call)</div>
<div>- renderer->GetActiveCamera()->ParallelProjectionOn()</div>
<div>- renderer->GetActiveCamera()->Zoom(zoomFactor);</div>
<div>-> The image displays with the desired scaling.</div>
<div> </div>
<div>But variant 2 only works because I called Render() first. I assume this somehow initializes the camera of the renderer with exactly the attributes that I need, but when I call GetActiveCamera without rendering first this (just calling the getter-method) will already) will give a different result (in my case a grey box in the upper right corner of the viewport). I'm now about to reverse engineer the camera settings after variant 1 was executed and set all the camera attributes to the desired initial values (position, viewUp, clipping range etc.), but I'm wondering if I'm just missing the more appropriate and convenient way to do this (after all the vtkImageActor seems to be all about convenience).</div>
<div> </div>
<div>Thank you.</div>
<div> </div>
<div>Mark</div>
<div> </div>
<div> </div>