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 "really" included in the image.<br>
To be honnest, I can't try your advice beacuse I'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'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's obviously not the real images because I'm not in my office today, it's just to give an example of the same effect...)<br>
<br><br>If the black borders were "just" the background, they should slowly disappear during the re-sizing of the window... But it'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 "physic space"</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"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></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. If you add<br>
"renderer->SetBackground(1.0,0.0,0.0);" to the example, then you will<br>
see the black bars turn to red.<br>
<br>
In other words, it isn't vtkImageReslice that is adding these borders.<br>
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->SetSize() to set the size of<br>
the window to the size of your image. 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. By default, the zoom factor for camera is not 1.0. You will<br>
have to call add code like the following:<br>
<br>
vtkCamera *camera = renderer->GetActiveCamera();<br>
camera->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'm not sure if the VTK interactors all work properly<br>
in parallel mode:<br>
<br>
camera->ParallelProjectionOn();<br>
camera->SetParallelScale(height_of_image);<br>
<br>
I hope this is what you were looking for,<br>
<br>
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 <<a href="mailto:scalande@gmail.com" target="_blank">scalande@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
><br>
> I'm trying "ImageSlicing.cxx" to display an "coronal" slice from a volume<br>
> (multiple axial slices).<br>
><br>
> It works well, but there is just a problem.<br>
><br>
><br>
> Information about my axial slices :<br>
><br>
> SIZE : 512 x 512<br>
> SPACING : (1,17188 ; 1,17188)<br>
><br>
> "REAL" SIZE = 60 cm x 60 cm<br>
><br>
><br>
> Information about the coronal slices that SHOULD be created<br>
><br>
> SIZE : 512 x 55<br>
> SPACING : (1,17188 ; 5)<br>
><br>
> "REAL" SIZE = 60 cm x 27.5 cm<br>
><br>
><br>
> But the problem is that the image created by "ImageSlicing" has the shape of<br>
> a square.<br>
> I mean it has the same shape than the axial images.<br>
><br>
> The representation of the coronal object is correct (good proportions) but<br>
> there are 2 black borders (top and down)<br>
><br>
> Something like that :<br>
><br>
> +++++++++++++++++++<br>
> +++++++++++++++++++<br>
> +++++++++++++++++++<br>
> ---CORONAL IMAGE---<br>
> ---CORONAL IMAGE---<br>
> ---CORONAL IMAGE---<br>
> +++++++++++++++++++<br>
> +++++++++++++++++++<br>
> +++++++++++++++++++<br>
><br>
> ('+' = black)<br>
><br>
> In fact, I'd like the image to have the proportion "60 x 27.5 " (without any<br>
> black borders...)<br>
><br>
> ---CORONAL IMAGE---<br>
> ---CORONAL IMAGE---<br>
> ---CORONAL IMAGE---<br>
><br>
><br>
> Do you see what I mean ?<br>
><br>
> I've searched in the methods of vtkImageReslice but I didn't find what I'm<br>
> looking for...<br>
><br>
><br>
><br>
> Do you have any idea to help me ?<br>
><br>
> Any help would be appreciated ;-)<br>
><br>
> Thank you in advance !<br>
><br>
><br>
><br>
> Stéphane<br>
><br>
</div></div>> _______________________________________________<br>
> This is the private VTK discussion list.<br>
> Please keep messages on-topic. Check the FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><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>
><br>
><br>
</blockquote></div><br>