Dear All<div>Here is the output of drawing vtk logo image using MayaVi and VTK 2D API.</div><div><br></div><div>Using MayaVi</div><div><br></div><div><img src="cid:ii_12a6f7d5c3567bbf" alt="MayaVi.PNG" title="MayaVi.PNG"><br>
</div><div><br></div><div><br></div><div>Using 2DAPI</div><div><img src="cid:ii_12a6f7e8301dd594" alt="2DAPI.PNG" title="2DAPI.PNG"><br></div><div><br></div><div>Here the image is drawn inverted.</div><div><br></div><div>
<br></div><div>When will be the new 2D Image API will be available for use?</div><div><br></div><br><div class="gmail_quote">On Wed, Aug 4, 2010 at 11:45 PM, Marcus D. Hanwell <span dir="ltr"><<a href="mailto:marcus.hanwell@kitware.com">marcus.hanwell@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="gmail_quote"><div class="im">On Wed, Aug 4, 2010 at 2:59 AM, Krishna Katamneni <span dir="ltr"><<a href="mailto:krishna.katamneni@gmail.com" target="_blank">krishna.katamneni@gmail.com</a>></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'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><div>These are screen coordinates by default, but they can be transformed. </div><div class="im"><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><div>I have just added some API to scale the images drawn by a scale factor. </div>
<div class="im">
<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'm not sure how to achieve it using vtkTransform2D.<br>
</blockquote><div><br></div></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>
<div class="im">
<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><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&D Engineer, Kitware Inc.<br>(518) 881-4937<br></div></div>
</blockquote></div><br><br clear="all"><br>-- <br>Best Regards<br>Krishna Katamaneni<br><br>