<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=text/html;charset=iso-8859-9 http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7600.16588"></HEAD>
<BODY style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px"
id=MailContainerBody leftMargin=0 topMargin=0 CanvasTabStop="true"
name="Compose message area">
<DIV><FONT size=2 face=Arial>
<DIV><FONT size=2 face=Arial>Eric, thank you very much. This works like a
charm.</FONT></DIV>
<DIV><SPAN
style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium 'Times New Roman'; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"
class=Apple-style-span><SPAN
style="TEXT-ALIGN: left; FONT-FAMILY: monospace; FONT-SIZE: 12px"
class=Apple-style-span><FONT size=2 face=Arial>Following code part spesifically
fits the image to the bounds of screen.</FONT></SPAN></SPAN></DIV>
<DIV><SPAN
style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium 'Times New Roman'; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"
class=Apple-style-span><SPAN
style="TEXT-ALIGN: left; FONT-FAMILY: monospace; FONT-SIZE: 12px"
class=Apple-style-span><FONT size=2 face=Arial></FONT> </DIV>
<DIV><PRE style="BORDER-BOTTOM: white 0px; BORDER-LEFT: white 0px; PADDING-BOTTOM: 0px; LINE-HEIGHT: normal; FONT-STYLE: normal; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; FONT-FAMILY: monospace; BACKGROUND: none transparent scroll repeat 0% 0%; COLOR: black; BORDER-TOP: white 0px; FONT-WEIGHT: normal; BORDER-RIGHT: white 0px; PADDING-TOP: 0px" class=de1><SPAN style="COLOR: rgb(102,102,102)" class=co1>//Set up the background camera to fill the renderer with the image</SPAN>
<SPAN style="COLOR: rgb(0,0,255)" class=kw4>double</SPAN> origin<SPAN style="COLOR: rgb(0,128,0)" class=br0>[</SPAN><SPAN style="COLOR: rgb(0,0,221)" class=nu0>3</SPAN><SPAN style="COLOR: rgb(0,128,0)" class=br0>]</SPAN><SPAN style="COLOR: rgb(0,128,128)" class=sy4>;</SPAN>
<SPAN style="COLOR: rgb(0,0,255)" class=kw4>double</SPAN> spacing<SPAN style="COLOR: rgb(0,128,0)" class=br0>[</SPAN><SPAN style="COLOR: rgb(0,0,221)" class=nu0>3</SPAN><SPAN style="COLOR: rgb(0,128,0)" class=br0>]</SPAN><SPAN style="COLOR: rgb(0,128,128)" class=sy4>;</SPAN>
<SPAN style="COLOR: rgb(0,0,255)" class=kw4>int</SPAN> extent<SPAN style="COLOR: rgb(0,128,0)" class=br0>[</SPAN><SPAN style="COLOR: rgb(0,0,221)" class=nu0>6</SPAN><SPAN style="COLOR: rgb(0,128,0)" class=br0>]</SPAN><SPAN style="COLOR: rgb(0,128,128)" class=sy4>;</SPAN>
imageData<SPAN style="COLOR: rgb(0,0,64)" class=sy2>-</SPAN><SPAN style="COLOR: rgb(0,0,128)" class=sy1>></SPAN>GetOrigin<SPAN style="COLOR: rgb(0,128,0)" class=br0>(</SPAN> origin <SPAN style="COLOR: rgb(0,128,0)" class=br0>)</SPAN><SPAN style="COLOR: rgb(0,128,128)" class=sy4>;</SPAN>
imageData<SPAN style="COLOR: rgb(0,0,64)" class=sy2>-</SPAN><SPAN style="COLOR: rgb(0,0,128)" class=sy1>></SPAN>GetSpacing<SPAN style="COLOR: rgb(0,128,0)" class=br0>(</SPAN> spacing <SPAN style="COLOR: rgb(0,128,0)" class=br0>)</SPAN><SPAN style="COLOR: rgb(0,128,128)" class=sy4>;</SPAN>
imageData<SPAN style="COLOR: rgb(0,0,64)" class=sy2>-</SPAN><SPAN style="COLOR: rgb(0,0,128)" class=sy1>></SPAN>GetExtent<SPAN style="COLOR: rgb(0,128,0)" class=br0>(</SPAN> extent <SPAN style="COLOR: rgb(0,128,0)" class=br0>)</SPAN><SPAN style="COLOR: rgb(0,128,128)" class=sy4>;</SPAN>
vtkCamera<SPAN style="COLOR: rgb(0,0,64)" class=sy2>*</SPAN> camera <SPAN style="COLOR: rgb(0,0,128)" class=sy1>=</SPAN> backgroundRenderer<SPAN style="COLOR: rgb(0,0,64)" class=sy2>-</SPAN><SPAN style="COLOR: rgb(0,0,128)" class=sy1>></SPAN>GetActiveCamera<SPAN style="COLOR: rgb(0,128,0)" class=br0>(</SPAN><SPAN style="COLOR: rgb(0,128,0)" class=br0>)</SPAN><SPAN style="COLOR: rgb(0,128,128)" class=sy4>;</SPAN>
camera<SPAN style="COLOR: rgb(0,0,64)" class=sy2>-</SPAN><SPAN style="COLOR: rgb(0,0,128)" class=sy1>></SPAN>ParallelProjectionOn<SPAN style="COLOR: rgb(0,128,0)" class=br0>(</SPAN><SPAN style="COLOR: rgb(0,128,0)" class=br0>)</SPAN><SPAN style="COLOR: rgb(0,128,128)" class=sy4>;</SPAN>
<SPAN style="COLOR: rgb(0,0,255)" class=kw4>double</SPAN> xc <SPAN style="COLOR: rgb(0,0,128)" class=sy1>=</SPAN> origin<SPAN style="COLOR: rgb(0,128,0)" class=br0>[</SPAN><SPAN style="COLOR: rgb(0,0,221)" class=nu0>0</SPAN><SPAN style="COLOR: rgb(0,128,0)" class=br0>]</SPAN> <SPAN style="COLOR: rgb(0,0,64)" class=sy2>+</SPAN> <SPAN style="COLOR: rgb(128,0,128)" class=nu16>0.5</SPAN><SPAN style="COLOR: rgb(0,0,64)" class=sy2>*</SPAN><SPAN style="COLOR: rgb(0,128,0)" class=br0>(</SPAN>extent<SPAN style="COLOR: rgb(0,128,0)" class=br0>[</SPAN><SPAN style="COLOR: rgb(0,0,221)" class=nu0>0</SPAN><SPAN style="COLOR: rgb(0,128,0)" class=br0>]</SPAN> <SPAN style="COLOR: rgb(0,0,64)" class=sy2>+</SPAN> extent<SPAN style="COLOR: rgb(0,128,0)" class=br0>[</SPAN><SPAN style="COLOR: rgb(0,0,221)" class=nu0>1</SPAN><SPAN style="COLOR: rgb(0,128,0)" class=br0>]</SPAN><SPAN style="COLOR: rgb(0,128,0)" class=br0>)</SPAN><SPAN style="COLOR: rgb(0,0,64)" class=sy2>*</SPAN>spacing<SPAN style="COLOR: rgb(0,128,0)" class=br0>[</SPAN><SPAN style="COLOR: rgb(0,0,221)" class=nu0>0</SPAN><SPAN style="COLOR: rgb(0,128,0)" class=br0>]</SPAN><SPAN style="COLOR: rgb(0,128,128)" class=sy4>;</SPAN>
<SPAN style="COLOR: rgb(0,0,255)" class=kw4>double</SPAN> yc <SPAN style="COLOR: rgb(0,0,128)" class=sy1>=</SPAN> origin<SPAN style="COLOR: rgb(0,128,0)" class=br0>[</SPAN><SPAN style="COLOR: rgb(0,0,221)" class=nu0>1</SPAN><SPAN style="COLOR: rgb(0,128,0)" class=br0>]</SPAN> <SPAN style="COLOR: rgb(0,0,64)" class=sy2>+</SPAN> <SPAN style="COLOR: rgb(128,0,128)" class=nu16>0.5</SPAN><SPAN style="COLOR: rgb(0,0,64)" class=sy2>*</SPAN><SPAN style="COLOR: rgb(0,128,0)" class=br0>(</SPAN>extent<SPAN style="COLOR: rgb(0,128,0)" class=br0>[</SPAN><SPAN style="COLOR: rgb(0,0,221)" class=nu0>2</SPAN><SPAN style="COLOR: rgb(0,128,0)" class=br0>]</SPAN> <SPAN style="COLOR: rgb(0,0,64)" class=sy2>+</SPAN> extent<SPAN style="COLOR: rgb(0,128,0)" class=br0>[</SPAN><SPAN style="COLOR: rgb(0,0,221)" class=nu0>3</SPAN><SPAN style="COLOR: rgb(0,128,0)" class=br0>]</SPAN><SPAN style="COLOR: rgb(0,128,0)" class=br0>)</SPAN><SPAN style="COLOR: rgb(0,0,64)" class=sy2>*</SPAN>spacing<SPAN style="COLOR: rgb(0,128,0)" class=br0>[</SPAN><SPAN style="COLOR: rgb(0,0,221)" class=nu0>1</SPAN><SPAN style="COLOR: rgb(0,128,0)" class=br0>]</SPAN><SPAN style="COLOR: rgb(0,128,128)" class=sy4>;</SPAN>
<SPAN style="COLOR: rgb(102,102,102)" class=co1>//double xd = (extent[1] - extent[0] + 1)*spacing[0];</SPAN>
<SPAN style="COLOR: rgb(0,0,255)" class=kw4>double</SPAN> yd <SPAN style="COLOR: rgb(0,0,128)" class=sy1>=</SPAN> <SPAN style="COLOR: rgb(0,128,0)" class=br0>(</SPAN>extent<SPAN style="COLOR: rgb(0,128,0)" class=br0>[</SPAN><SPAN style="COLOR: rgb(0,0,221)" class=nu0>3</SPAN><SPAN style="COLOR: rgb(0,128,0)" class=br0>]</SPAN> <SPAN style="COLOR: rgb(0,0,64)" class=sy2>-</SPAN> extent<SPAN style="COLOR: rgb(0,128,0)" class=br0>[</SPAN><SPAN style="COLOR: rgb(0,0,221)" class=nu0>2</SPAN><SPAN style="COLOR: rgb(0,128,0)" class=br0>]</SPAN> <SPAN style="COLOR: rgb(0,0,64)" class=sy2>+</SPAN> <SPAN style="COLOR: rgb(0,0,221)" class=nu0>1</SPAN><SPAN style="COLOR: rgb(0,128,0)" class=br0>)</SPAN><SPAN style="COLOR: rgb(0,0,64)" class=sy2>*</SPAN>spacing<SPAN style="COLOR: rgb(0,128,0)" class=br0>[</SPAN><SPAN style="COLOR: rgb(0,0,221)" class=nu0>1</SPAN><SPAN style="COLOR: rgb(0,128,0)" class=br0>]</SPAN><SPAN style="COLOR: rgb(0,128,128)" class=sy4>;</SPAN>
<SPAN style="COLOR: rgb(0,0,255)" class=kw4>double</SPAN> d <SPAN style="COLOR: rgb(0,0,128)" class=sy1>=</SPAN> camera<SPAN style="COLOR: rgb(0,0,64)" class=sy2>-</SPAN><SPAN style="COLOR: rgb(0,0,128)" class=sy1>></SPAN>GetDistance<SPAN style="COLOR: rgb(0,128,0)" class=br0>(</SPAN><SPAN style="COLOR: rgb(0,128,0)" class=br0>)</SPAN><SPAN style="COLOR: rgb(0,128,128)" class=sy4>;</SPAN>
camera<SPAN style="COLOR: rgb(0,0,64)" class=sy2>-</SPAN><SPAN style="COLOR: rgb(0,0,128)" class=sy1>></SPAN>SetParallelScale<SPAN style="COLOR: rgb(0,128,0)" class=br0>(</SPAN><SPAN style="COLOR: rgb(128,0,128)" class=nu16>0.5</SPAN><SPAN style="COLOR: rgb(0,0,64)" class=sy2>*</SPAN>yd<SPAN style="COLOR: rgb(0,128,0)" class=br0>)</SPAN><SPAN style="COLOR: rgb(0,128,128)" class=sy4>;</SPAN>
camera<SPAN style="COLOR: rgb(0,0,64)" class=sy2>-</SPAN><SPAN style="COLOR: rgb(0,0,128)" class=sy1>></SPAN>SetFocalPoint<SPAN style="COLOR: rgb(0,128,0)" class=br0>(</SPAN>xc,yc,<SPAN style="COLOR: rgb(128,0,128)" class=nu16>0.0</SPAN><SPAN style="COLOR: rgb(0,128,0)" class=br0>)</SPAN><SPAN style="COLOR: rgb(0,128,128)" class=sy4>;</SPAN>
camera<SPAN style="COLOR: rgb(0,0,64)" class=sy2>-</SPAN><SPAN style="COLOR: rgb(0,0,128)" class=sy1>></SPAN>SetPosition<SPAN style="COLOR: rgb(0,128,0)" class=br0>(</SPAN>xc,yc,d<SPAN style="COLOR: rgb(0,128,0)" class=br0>)</SPAN><SPAN style="COLOR: rgb(0,128,128)" class=sy4>;</SPAN></PRE><PRE style="BORDER-BOTTOM: white 0px; BORDER-LEFT: white 0px; PADDING-BOTTOM: 0px; LINE-HEIGHT: normal; FONT-STYLE: normal; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; FONT-FAMILY: monospace; BACKGROUND: none transparent scroll repeat 0% 0%; COLOR: black; BORDER-TOP: white 0px; FONT-WEIGHT: normal; BORDER-RIGHT: white 0px; PADDING-TOP: 0px" class=de1><SPAN style="COLOR: rgb(0,128,128)" class=sy4></SPAN> </PRE></SPAN></SPAN></DIV>
<DIV><FONT size=2 face=Arial>With my best regards,</FONT></DIV>
<DIV><FONT size=2 face=Arial>Huseyin</FONT></DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A
title="mailto:emonson@cs.duke.edu CTRL + Click to follow link"
href="mailto:emonson@cs.duke.edu">Eric E. Monson</A> </DIV>
<DIV><B>Sent:</B> Thursday, July 08, 2010 4:26 PM</DIV>
<DIV><B>To:</B> <A
title="mailto:metlord@hotmail.com CTRL + Click to follow link"
href="mailto:metlord@hotmail.com">Hüseyin Savaş</A> </DIV>
<DIV><B>Cc:</B> <A
title="mailto:vtkusers@vtk.org CTRL + Click to follow link"
href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</A> </DIV>
<DIV><B>Subject:</B> Re: [vtkusers] Image size</DIV></DIV></DIV>
<DIV><BR></DIV>Hey Huseyin,
<DIV><BR></DIV>
<DIV>If calling renderer->ResetCamera(imageActor->GetBounds()) doesn't get
you close enough, you can also look at the example on the Wiki where an image is
used as the background for a window:</DIV>
<DIV><BR></DIV>
<DIV><A
title="http://www.cmake.org/Wiki/VTK/Examples/Images/BackgroundImage CTRL + Click to follow link"
href="http://www.cmake.org/Wiki/VTK/Examples/Images/BackgroundImage">http://www.cmake.org/Wiki/VTK/Examples/Images/BackgroundImage</A></DIV>
<DIV><BR></DIV>
<DIV>I think this example came out of this mailing list thread:</DIV>
<DIV><BR></DIV>
<DIV><A
title="http://markmail.org/message/taknydvbtdhv6bsx CTRL + Click to follow link"
href="http://markmail.org/message/taknydvbtdhv6bsx">http://markmail.org/message/taknydvbtdhv6bsx</A></DIV>
<DIV><BR></DIV>
<DIV>I seem to recall anther recent thread talking about an image filling a
window, but I can't find it right now.</DIV>
<DIV><BR></DIV>
<DIV>Good luck,</DIV>
<DIV>-Eric</DIV>
<DIV><BR></DIV>
<DIV>
<DIV>
<DIV
style="FONT-SIZE: 12px">------------------------------------------------------</DIV>
<DIV style="FONT-SIZE: 12px">Eric E Monson</DIV>
<DIV style="FONT-SIZE: 12px">Duke Visualization Technology Group</DIV>
<DIV style="FONT-SIZE: 12px"><BR class=webkit-block-placeholder></DIV></DIV><BR>
<DIV>
<DIV>On Jul 8, 2010, at 3:22 AM, Hüseyin Savaş wrote:</DIV><BR
class=Apple-interchange-newline>
<BLOCKQUOTE type="cite">
<DIV style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px"
id=MailContainerBody name="Compose message area" canvastabstop="true"
topmargin="0" leftmargin="0">
<DIV><FONT size=2 face=Arial>
<DIV><FONT size=2 face=Arial>Actually that looks irrelevant.</FONT></DIV>
<DIV><FONT size=2 face=Arial>Let me describe my need again: I want my image
(probably imageActor) to fill the whole screen.</FONT></DIV>
<DIV><FONT size=2 face=Arial>As far as I got, I can set the scale of my
imageactor with some necessary calculations and then mandatorily set the
position of imageactor for aligning the image to center.</FONT></DIV>
<DIV><FONT size=2 face=Arial>But again as I said, this isn't native at all.
There should definitely be a more proper way.</FONT></DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><FONT face=Arial>Thanks in advance.</FONT></DIV>
<DIV><FONT face=Arial>Huseyin.</FONT></DIV>
<DIV><FONT face=Arial></FONT><BR> </DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A
title="mailto:jothybasu@gmail.com CTRL + Click to follow link"
href="mailto:jothybasu@gmail.com">Jothy</A> </DIV>
<DIV><B>Sent:</B> Wednesday, July 07, 2010 6:09 PM</DIV>
<DIV><B>To:</B> <A
title="mailto:metlord@hotmail.com CTRL + Click to follow link"
href="mailto:metlord@hotmail.com">Hüseyin Savaş</A> </DIV>
<DIV><B>Cc:</B> <A
title="mailto:vtkusers@vtk.org CTRL + Click to follow link"
href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</A> </DIV>
<DIV><B>Subject:</B> Re: [vtkusers] Image size</DIV></DIV></DIV>
<DIV><BR></DIV>
<DIV dir=ltr>Did you tried ResetCameraClippingRange()?<BR><BR>Jothy<BR><BR>
<DIV class=gmail_quote>2010/7/7 Hüseyin Savaş <SPAN dir=ltr><<A
title="mailto:metlord@hotmail.com CTRL + Click to follow link"
href="mailto:metlord@hotmail.com">metlord@hotmail.com</A>></SPAN><BR>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px"
name="Compose message area">
<DIV><FONT size=2 face=Arial>Hello,</FONT></DIV>
<DIV><FONT size=2 face=Arial>My question looks fairly simple. </FONT></DIV>
<DIV><FONT size=2 face=Arial>I have an ImageActor, created via
ImageViewer2.getImageActor() , added to a Renderer that has been added to a
RenderWindow. </FONT></DIV>
<DIV><FONT size=2 face=Arial>The actual image displayed covers nearly the
same size, whatever image's resolution is and wastes a lot of screen space
with black area. </FONT></DIV>
<DIV><FONT size=2 face=Arial>I tried scaling, zooming and some extra
stuff to get what I want (having an image that fits to the
screen), but all of these solutions didn't look so native. </FONT></DIV>
<DIV><FONT size=2 face=Arial>Is there any proper solution to have an image
that fits the whole screen?</FONT></DIV>
<DIV><FONT size=2 face=Arial>Thanks already for any advice.</FONT></DIV>
<DIV><FONT size=2 face=Arial>Sincerely.</FONT></DIV><BR><BR>__________
Information from ESET NOD32 Antivirus, version of virus signature database
5259 (20100707) __________<BR><BR>The message was checked by ESET NOD32
Antivirus.<BR><BR><A
title="http://www.eset.com/ CTRL + Click to follow link"
href="http://www.eset.com/"
target=_blank>http://www.eset.com</A><BR></DIV><BR>_______________________________________________<BR>Powered
by <A title="http://www.kitware.com/ CTRL + Click to follow link"
href="http://www.kitware.com/"
target=_blank>www.kitware.com</A><BR><BR>Visit other Kitware open-source
projects at <A
title="http://www.kitware.com/opensource/opensource.html CTRL + Click to follow link"
href="http://www.kitware.com/opensource/opensource.html"
target=_blank>http://www.kitware.com/opensource/opensource.html</A><BR><BR>Please
keep messages on-topic and check the VTK FAQ at: <A
href="http://www.vtk.org/Wiki/VTK_FAQ"
target=_blank>http://www.vtk.org/Wiki/VTK_FAQ</A><BR><BR>Follow this link to
subscribe/unsubscribe:<BR><A
title="http://www.vtk.org/mailman/listinfo/vtkusers CTRL + Click to follow link"
href="http://www.vtk.org/mailman/listinfo/vtkusers"
target=_blank>http://www.vtk.org/mailman/listinfo/vtkusers</A></BLOCKQUOTE></DIV></DIV><BR></FONT></DIV><BR><BR>__________
Information from ESET NOD32 Antivirus, version of virus signature database
5260 (20100707) __________<BR><BR>The message was checked by ESET NOD32
Antivirus.<BR><BR><A
title="http://www.eset.com/ CTRL + Click to follow link"
href="http://www.eset.com/">http://www.eset.com</A><BR></DIV>_______________________________________________<BR>Powered
by <A href="http://www.kitware.com/">www.kitware.com</A><BR><BR>Visit other
Kitware open-source projects at <A
href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</A><BR><BR>Please
keep messages on-topic and check the VTK FAQ at: <A
href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</A><BR><BR>Follow
this link to subscribe/unsubscribe:<BR><A
href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</A><BR></BLOCKQUOTE></DIV><BR></DIV></FONT></DIV></BODY></HTML>