Hi vtk-list, hi David,<br><br><br><br>Thank you very much for your answer.<br><br>I had already fixed the problem of zoom (that is not 1.0 by default) before.<br><br>About the problem of the borders, I understand what you say, but I think that the borders are &quot;really&quot; included in the image.<br>
To be honnest, I can&#39;t try your advice beacuse I&#39;m not in my office today, but I can give you other details to prove that the borders are included in the image.<br><br>Even if I re-sized manually the window with the mouse (for example the height), all the image (the coronal subject and the borders) are proportionally reduced.<br>
<br>(I&#39;ve tinkered a PNG to explain this. Have a look at : <a href="http://info.fundp.ac.be/%7Escalande/borders.PNG">http://info.fundp.ac.be/~scalande/borders.PNG</a><br>But it&#39;s obviously not the real images because I&#39;m not in my office today, it&#39;s just to give an example of the same effect...)<br>
<br><br>If the black borders were &quot;just&quot; the background, they should slowly disappear during the re-sizing of the window... But it&#39;s not the case...<br><br><br>I really have the impression that the coronal views created by ImageReslice are represented <u>in the same &quot;physic space&quot;</u> than the basic axial views (representing the volume).<br>
<br><br>Can my explanation help you to understand the problem?<br><br><br><br>Thank you very much for your help,<br><br><br>Regards,<br><br><br><br>Stéphane<br><br><br><br><br><br><br><div class="gmail_quote">2008/11/10 David Gobbi <span dir="ltr">&lt;<a href="mailto:david.gobbi@gmail.com" target="_blank">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>
The black borders that you see in this example are actually the<br>
background in the renderer. &nbsp;If you add<br>
&quot;renderer-&gt;SetBackground(1.0,0.0,0.0);&quot; to the example, then you will<br>
see the black bars turn to red.<br>
<br>
In other words, it isn&#39;t vtkImageReslice that is adding these borders.<br>
&nbsp;These borders are present because the RenderWindow is square, and<br>
vtkImageReslice has no control over the window size.<br>
<br>
So what you need to do is call window-&gt;SetSize() to set the size of<br>
the window to the size of your image. &nbsp;You can call Update() on<br>
ImageReslice and get the size of its output, so that you know what<br>
size to make the window.<br>
<br>
Even after you do this, though, you will still have to do one more<br>
thing. &nbsp;By default, the zoom factor for camera is not 1.0. &nbsp;You will<br>
have to call add code like the following:<br>
<br>
 &nbsp;vtkCamera *camera = renderer-&gt;GetActiveCamera();<br>
 &nbsp;camera-&gt;SetViewAngle(2.0*atan(0.5*height_of_image/camera_distance));<br>
<br>
Alternatively, you can switch to parallel projections, which makes the<br>
math easier but I&#39;m not sure if the VTK interactors all work properly<br>
in parallel mode:<br>
<br>
 &nbsp;camera-&gt;ParallelProjectionOn();<br>
 &nbsp;camera-&gt;SetParallelScale(height_of_image);<br>
<br>
I hope this is what you were looking for,<br>
<br>
 &nbsp; &nbsp;David<br>
<div><div></div><div><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
On Mon, Nov 10, 2008 at 9:38 AM, Stéphane CALANDE &lt;<a href="mailto:scalande@gmail.com" target="_blank">scalande@gmail.com</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt;<br>
&gt; I&#39;m trying &quot;ImageSlicing.cxx&quot; to display an &quot;coronal&quot; slice from a volume<br>
&gt; (multiple axial slices).<br>
&gt;<br>
&gt; It works well, but there is just a problem.<br>
&gt;<br>
&gt;<br>
&gt; Information about my axial slices :<br>
&gt;<br>
&gt; SIZE : 512 x 512<br>
&gt; SPACING : (1,17188 ; 1,17188)<br>
&gt;<br>
&gt; &quot;REAL&quot; SIZE = 60 cm x 60 cm<br>
&gt;<br>
&gt;<br>
&gt; Information about the coronal slices that SHOULD be created<br>
&gt;<br>
&gt; SIZE : 512 x 55<br>
&gt; SPACING : (1,17188 ; 5)<br>
&gt;<br>
&gt; &quot;REAL&quot; SIZE = 60 cm x 27.5 cm<br>
&gt;<br>
&gt;<br>
&gt; But the problem is that the image created by &quot;ImageSlicing&quot; has the shape of<br>
&gt; a square.<br>
&gt; I mean it has the same shape than the axial images.<br>
&gt;<br>
&gt; The representation of the coronal object is correct (good proportions) but<br>
&gt; there are 2 black borders (top and down)<br>
&gt;<br>
&gt; Something like that :<br>
&gt;<br>
&gt; +++++++++++++++++++<br>
&gt; +++++++++++++++++++<br>
&gt; +++++++++++++++++++<br>
&gt; ---CORONAL IMAGE---<br>
&gt; ---CORONAL IMAGE---<br>
&gt; ---CORONAL IMAGE---<br>
&gt; +++++++++++++++++++<br>
&gt; +++++++++++++++++++<br>
&gt; +++++++++++++++++++<br>
&gt;<br>
&gt; (&#39;+&#39; = black)<br>
&gt;<br>
&gt; In fact, I&#39;d like the image to have the proportion &quot;60 x 27.5 &quot; (without any<br>
&gt; black borders...)<br>
&gt;<br>
&gt; ---CORONAL IMAGE---<br>
&gt; ---CORONAL IMAGE---<br>
&gt; ---CORONAL IMAGE---<br>
&gt;<br>
&gt;<br>
&gt; Do you see what I mean ?<br>
&gt;<br>
&gt; I&#39;ve searched in the methods of vtkImageReslice but I didn&#39;t find what I&#39;m<br>
&gt; looking for...<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Do you have any idea to help me ?<br>
&gt;<br>
&gt; Any help would be appreciated ;-)<br>
&gt;<br>
&gt; Thank you in advance !<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Stéphane<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; This is the private VTK discussion list.<br>
&gt; Please keep messages on-topic. Check the FAQ at:<br>
&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;<br>
&gt;<br>
</blockquote></div><br>