<div class="gmail_quote">On Wed, Aug 4, 2010 at 2:59 AM, Krishna Katamneni <span dir="ltr">&lt;<a href="mailto:krishna.katamneni@gmail.com">krishna.katamneni@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;">

Dear All<br>I have several 2D  images with different dimensions, origins and resolutions.<br>I want to draw them using 2D API (class vtkImageItem) etc and also want the images to be drawn in windows screen coordinates.<br>


<br>I&#39;m also confused with parameters for DrawImage method in the 2D API(are these screen coordinates or should be in-terms of image dimensions).  <br>When using this method, all my images are upside down.<br></blockquote>

<div><br></div><div>These are screen coordinates by default, but they can be transformed.  </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">.<br>For example , my window size is 600x400<br>


<br>and have many 2D images(  details of few examples are given below)<br><br>Image  Details<br><br>                        Resolution                Dimensions                          Origin<br><ol><li>              0.1 x 0.1 x 1             930   x  700   x 1                -78.3 x 0  x 0</li>


<li>              0.2 x 0.2 x 1             1560 x  750   x 1                -78.3 x 0  x 0</li><li>              0.5 x 0.2 x 1             3100 x  1560 x 1                -100  x 20 x 0</li><li>              0.1 x 0.2 x 1             360   x  180   x 1               -14.3 x 0  x 0</li>


</ol>and also would like my image to be to fit to the available window size(I can resize my window dynamically).<br></blockquote><div><br></div><div>I have just added some API to scale the images drawn by a scale factor. </div>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>I think we should be able to create 2D Transform that handles all these cases in one go, but I&#39;m not sure how to achieve it using vtkTransform2D.<br>

</blockquote><div><br></div><div>The 2D API has a scene, and you can build up a tree, making a vtkImageItem the child item of a vtkContextTransform would allow you to them transform the child items (translation, scale, rotation), see the TestContextScene code for some examples.</div>

<div><br></div><div>There are still issues with test not being transformed correctly, I am working on that. Most other stuff should get transformed, and I could likely give you a few pointers. I am not sure why your images would be upside down, I did not encounter that in my tests. </div>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>Could anybody help me how to handle these situations?<br></blockquote><div><br></div><div>Hopefully that clears some of this up. It would be good to come up with an example that could be added to the wiki, and possibly as a new test. I am pretty busy right now, but will try to give you further pointers if anything is not clear.</div>

<div><br></div><div>Thanks,</div><div><br></div><div>Marcus</div><div>--<br clear="all">Marcus D. Hanwell, Ph.D.<br>R&amp;D Engineer, Kitware Inc.<br>(518) 881-4937<br></div></div>