I&#39;m trying to display a 2d image (resliced output from vtkImagePlaneWidget) onto a separate renderer. I&#39;m able to display the actor, but the image isn&#39;t centered, and the zoom isn&#39;t correct.<br><br>Here is the code that creates the image actor and displays it:<br>
<br>    vtkImageMapToColors* colorMapY = vtkImageMapToColors::New();<br>    colorMapY-&gt;PassAlphaToOutputOff();<br>    colorMapY-&gt;SetActiveComponent(0);<br>    colorMapY-&gt;SetOutputFormatToLuminance();<br>    colorMapY-&gt;SetInput(planeWidgetY-&gt;GetResliceOutput());<br>
    colorMapY-&gt;SetLookupTable(planeWidgetY-&gt;GetLookupTable());<br>    vtkImageActor* imageActorY = vtkImageActor::New();<br>    imageActorY-&gt;SetScaleSetInput(colorMapY-&gt;GetOutput());<br><br>    ren3-&gt;AddActor(imageActorY);<br>
    ren3-&gt;SetBackground( 0.2, 0.2, 0.2);<br>    ren3-&gt;SetViewport(0.7, 0.33, 1.0, 0.67);<br>    ren3-&gt;GetActiveCamera()-&gt;ParallelProjectionOn();<br>    ren3-&gt;GetActiveCamera()-&gt;Zoom(0.005);<br><br>For some reason if I use the default zoom, the image is zoomed so far in that I see individual pixels, so I use a zoom of 0.005. With a tiny zoom, I can see the image, but again, its not centered. I can&#39;t seem to find out the size of the displayed image so that I can center it.<br>
<br>I&#39;ve tried the vtkImageViewer and it displays correctly, but it makes the application incredibly slow. How can I center and correctly zoom into the 2d image?<br>