<div dir="ltr"><div>Hi Christian,<br><br></div><div>I wrote a class for querying image pixel/voxeld data a while back and I could make it available <br>to you off-line at your request.  <br>In the meantime, have a look at <a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx">http://www.vtk.org/Wiki/VTK/Examples/Cxx</a> in particular<br>
<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/PickingAPixel2">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/PickingAPixel2</a><br></div><div>and<br><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/PickingAPixel">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/PickingAPixel</a><br>
<br></div><div>For displaying a minimap, I would try adding a second vtkRenderer with a smaller viewport<br>in your main vtkRenderWindow and place a vtkImageActor within it.<br><br></div><div>To compute zoom, have a look at vtkCoordinate class, which allows conversion<br>
</div><div>between numerous kinds of coordinate types (viewport, normalized viewport, world etc.),<br></div><div>probably make use of the extrema of your viewing window and those of the image.<br><br></div><div>Dean <br></div>
<div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Sep 12, 2013 at 4:47 AM, Christian Lackas <span dir="ltr">&lt;<a href="mailto:lackas@invicro.com" target="_blank">lackas@invicro.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 Everybody,<br>
<br>
I display a large 2D image (larger then typical screen resolutions) in a<br>
a vtkImageViewer2 and would like to give the user some guidance as to<br>
which part she is currently looking at.<br>
<br>
My questions are:<br>
* What is the easiest way to get the zoom (ratio of image to world pixels)?<br>
* How can I get the coordinates (in image pixels) of the par of the<br>
  image that is currently visible?<br>
<br>
Details:<br>
<br>
In a first steps, I would like to show the zoom level (100% = one pixel<br>
on screen contains exactly one pixel of the image). I looked at<br>
vtkCamera and found the Zoom(double) function, pointing me to<br>
ParallelScale() (ParallelProjection: On), and this variable seems to be<br>
indeed related to the zoom (larger values indicate lower zoom), however,<br>
I was not able to derive an absolute number from this (e.g. 50%, so two<br>
image pixels are shown in 1 pixel on screen). In my example 100% is<br>
around ParallelScale=140.<br>
Also vtkCamera::Get(Model)ViewTransformObject()-&gt;GetScale() does not<br>
work (always returns 1,1,1).<br>
I tried to use vtkCamera&#39;s Print(stream) method, however, could not find<br>
any other values that change with the zoom, and I could not figure out<br>
how to use GetProjectionTransformObject(double,double,double) properly.<br>
<br>
In a next step, I would like to show a small minimap in one corner, just<br>
consisting of two rectangles showing the full image and the current view<br>
port. For this I would need to know which coordinates (in image pixels)<br>
are currently shown.<br>
Unfortunately, ImageActors DisplayExtent just contains the full<br>
dimensions, and I have not found any other value that seems to be useful<br>
(also not in vtkCamera).<br>
<br>
Any help on this is highly appreciated.<br>
<br>
Thanks,<br>
 Christian<br>
<br>
--<br>
Dr. Christian Lackas, Managing Partner<br>
inviCRO, LLC -- In Imaging Yours<br>
<a href="http://www.invicro.com/" target="_blank">http://www.invicro.com/</a>  <a href="http://www.spect-ct.com/" target="_blank">http://www.spect-ct.com/</a><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br></div>