Thank you David, I&#39;ll try to change the background.<br><br>But in fact, even if I saw that the borders were red, it wouldn&#39;t resolve my problem. I&#39;m going to explain you why...<br><br><br>Here&#39;s what I&#39;d like :<br>
<br>If I call something like :<br><br>&quot;window.SetSize(x,y)&quot; (with x,y proportionnal to 60 x 27.5 =&gt; if you remember it is the real proportions of the coronal image)<br><br>Have a look at <a href="http://info.fundp.ac.be/%7Escalande/borders2.PNG">http://info.fundp.ac.be/~scalande/borders2.PNG</a> to understand...<br>
<br><br><br>It is so important for me because I&#39;m creating an interface that allow the select a region of the image with the mouse...<br>So I have to do a conversion between the mouse coordinates and the image coordinates.<br>
<br><br>I&#39;ve another thing to say. In my example, the height of the coronal image is smaller than the height of the axial image. (60 &gt; 27.5)<br>And so there are borders... But if it was the contrary, if the coronal image height was 80, for example...<br>
<br>Would the image be croped of 10 on top and 10 on down?<br><br><br>To avoid the borders in the first case (&lt;60) and the possible crop in the second case (&gt;60), it would be really nice if the coronal views created by ImageReslice were represented in their own &quot;physical space&quot; (instead of the axial views physical space).<br>
<br><br><br>Do you understand better ?<br><br><br><br>I thank you one more time for the help,<br><br><br><br>Stéphane<br><br><br><br><div class="gmail_quote">2008/11/11 David Gobbi <span dir="ltr">&lt;<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Stephane,<br>
<br>
When you get back to you office, try setting the background of the<br>
renderer to red and I&#39;m sure that you will see that the borders are<br>
not part of the image.<br>
<br>
The reason that the borders don&#39;t disappear when you resize the window<br>
is that everything in the vtkRenderer gets resized when you resize the<br>
window. &nbsp;That is always the behavior of vtkImageActor or any other<br>
actor that is not a 2D actor: everything gets scaled relative to the<br>
window size.<br>
<font color="#888888"><br>
 &nbsp; David<br>
</font><div><div></div><div class="Wj3C7c"><br>
<br>
<br>
On Tue, Nov 11, 2008 at 9:29 AM, Stéphane CALANDE &lt;<a href="mailto:scalande@gmail.com">scalande@gmail.com</a>&gt; wrote:<br>
&gt; Hi vtk-list, hi David,<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Thank you very much for your answer.<br>
&gt;<br>
&gt; I had already fixed the problem of zoom (that is not 1.0 by default) before.<br>
&gt;<br>
&gt; About the problem of the borders, I understand what you say, but I think<br>
&gt; that the borders are &quot;really&quot; included in the image.<br>
&gt; To be honnest, I can&#39;t try your advice beacuse I&#39;m not in my office today,<br>
&gt; but I can give you other details to prove that the borders are included in<br>
&gt; the image.<br>
&gt;<br>
&gt; Even if I re-sized manually the window with the mouse (for example the<br>
&gt; height), all the image (the coronal subject and the borders) are<br>
&gt; proportionally reduced.<br>
&gt;<br>
&gt; (I&#39;ve tinkered a PNG to explain this. Have a look at :<br>
&gt; <a href="http://info.fundp.ac.be/%7Escalande/borders.PNG" target="_blank">http://info.fundp.ac.be/~scalande/borders.PNG</a><br>
&gt; But it&#39;s obviously not the real images because I&#39;m not in my office today,<br>
&gt; it&#39;s just to give an example of the same effect...)<br>
&gt;<br>
&gt;<br>
&gt; If the black borders were &quot;just&quot; the background, they should slowly<br>
&gt; disappear during the re-sizing of the window... But it&#39;s not the case...<br>
&gt;<br>
&gt;<br>
&gt; I really have the impression that the coronal views created by ImageReslice<br>
&gt; are represented in the same &quot;physic space&quot; than the basic axial views<br>
&gt; (representing the volume).<br>
&gt;<br>
&gt;<br>
&gt; Can my explanation help you to understand the problem?<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Thank you very much for your help,<br>
&gt;<br>
&gt;<br>
&gt; Regards,<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Stéphane<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; 2008/11/10 David Gobbi &lt;<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>&gt;<br>
&gt;&gt;<br>
&gt;&gt; Hi Stephane,<br>
&gt;&gt;<br>
&gt;&gt; The black borders that you see in this example are actually the<br>
&gt;&gt; background in the renderer. &nbsp;If you add<br>
&gt;&gt; &quot;renderer-&gt;SetBackground(1.0,0.0,0.0);&quot; to the example, then you will<br>
&gt;&gt; see the black bars turn to red.<br>
&gt;&gt;<br>
&gt;&gt; In other words, it isn&#39;t vtkImageReslice that is adding these borders.<br>
&gt;&gt; &nbsp;These borders are present because the RenderWindow is square, and<br>
&gt;&gt; vtkImageReslice has no control over the window size.<br>
&gt;&gt;<br>
&gt;&gt; So what you need to do is call window-&gt;SetSize() to set the size of<br>
&gt;&gt; the window to the size of your image. &nbsp;You can call Update() on<br>
&gt;&gt; ImageReslice and get the size of its output, so that you know what<br>
&gt;&gt; size to make the window.<br>
&gt;&gt;<br>
&gt;&gt; Even after you do this, though, you will still have to do one more<br>
&gt;&gt; thing. &nbsp;By default, the zoom factor for camera is not 1.0. &nbsp;You will<br>
&gt;&gt; have to call add code like the following:<br>
&gt;&gt;<br>
&gt;&gt; &nbsp;vtkCamera *camera = renderer-&gt;GetActiveCamera();<br>
&gt;&gt; &nbsp;camera-&gt;SetViewAngle(2.0*atan(0.5*height_of_image/camera_distance));<br>
&gt;&gt;<br>
&gt;&gt; Alternatively, you can switch to parallel projections, which makes the<br>
&gt;&gt; math easier but I&#39;m not sure if the VTK interactors all work properly<br>
&gt;&gt; in parallel mode:<br>
&gt;&gt;<br>
&gt;&gt; &nbsp;camera-&gt;ParallelProjectionOn();<br>
&gt;&gt; &nbsp;camera-&gt;SetParallelScale(height_of_image);<br>
&gt;&gt;<br>
&gt;&gt; I hope this is what you were looking for,<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp;David<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Mon, Nov 10, 2008 at 9:38 AM, Stéphane CALANDE &lt;<a href="mailto:scalande@gmail.com">scalande@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt; Hi,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I&#39;m trying &quot;ImageSlicing.cxx&quot; to display an &quot;coronal&quot; slice from a<br>
&gt;&gt; &gt; volume<br>
&gt;&gt; &gt; (multiple axial slices).<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; It works well, but there is just a problem.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Information about my axial slices :<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; SIZE : 512 x 512<br>
&gt;&gt; &gt; SPACING : (1,17188 ; 1,17188)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; &quot;REAL&quot; SIZE = 60 cm x 60 cm<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Information about the coronal slices that SHOULD be created<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; SIZE : 512 x 55<br>
&gt;&gt; &gt; SPACING : (1,17188 ; 5)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; &quot;REAL&quot; SIZE = 60 cm x 27.5 cm<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; But the problem is that the image created by &quot;ImageSlicing&quot; has the<br>
&gt;&gt; &gt; shape of<br>
&gt;&gt; &gt; a square.<br>
&gt;&gt; &gt; I mean it has the same shape than the axial images.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; The representation of the coronal object is correct (good proportions)<br>
&gt;&gt; &gt; but<br>
&gt;&gt; &gt; there are 2 black borders (top and down)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Something like that :<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; +++++++++++++++++++<br>
&gt;&gt; &gt; +++++++++++++++++++<br>
&gt;&gt; &gt; +++++++++++++++++++<br>
&gt;&gt; &gt; ---CORONAL IMAGE---<br>
&gt;&gt; &gt; ---CORONAL IMAGE---<br>
&gt;&gt; &gt; ---CORONAL IMAGE---<br>
&gt;&gt; &gt; +++++++++++++++++++<br>
&gt;&gt; &gt; +++++++++++++++++++<br>
&gt;&gt; &gt; +++++++++++++++++++<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; (&#39;+&#39; = black)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; In fact, I&#39;d like the image to have the proportion &quot;60 x 27.5 &quot; (without<br>
&gt;&gt; &gt; any<br>
&gt;&gt; &gt; black borders...)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ---CORONAL IMAGE---<br>
&gt;&gt; &gt; ---CORONAL IMAGE---<br>
&gt;&gt; &gt; ---CORONAL IMAGE---<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Do you see what I mean ?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I&#39;ve searched in the methods of vtkImageReslice but I didn&#39;t find what<br>
&gt;&gt; &gt; I&#39;m<br>
&gt;&gt; &gt; looking for...<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Do you have any idea to help me ?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Any help would be appreciated ;-)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Thank you in advance !<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Stéphane<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; This is the private VTK discussion list.<br>
&gt;&gt; &gt; Please keep messages on-topic. Check the FAQ at:<br>
&gt;&gt; &gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;&gt; &gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt; &gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br>