comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: How to scale image in idl?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: How to scale image in idl? [message #6218] Thu, 16 May 1996 00:00
Thomas A. McGlynn is currently offline  Thomas A. McGlynn
Messages: 23
Registered: March 1996
Junior Member
David Foster wrote:
>
> peter@hpl.hp.com (Peter Webb) wrote:
>>
>> Watcher (dliu@cs.tufts.edu) wrote:
>> : I've used tv and tvscl to display the image, however it is too honest to
>> : the size of the image itself. Is there a way to scale the image so that
>> : it fits the display window?
>>
>> Use CONGRID to interpolate the image matrix to the window size.
>
> You can also use EXPAND to change the size of an image. It's similar
> to CONGRID and I don't know which one is faster. They have slightly
> different options available.
>
> If the window size is an integer multiple of the image size
> then use the REBIN function as it is significantly faster,
> especially for large images.
>
> Dave Foster
> UCSD Brain Image Analysis Lab
> foster@bial1.ucsd.edu

But if you use REBIN (and maybe CONGRID) read the documentation carefully
and see if what happens to the last column/row is acceptable. When
data is expanded by an integral factor, the last column/row will be repeated
the integral number of times even if the other pixels are being interpolated.
I find the behaviour counter-intuitive but it is fully documented.

Tom McGlynn
tam@silk.gsfc.nasa.gov
Re: How to scale image in idl? [message #6221 is a reply to message #6218] Thu, 16 May 1996 00:00 Go to previous message
Rachel Howe is currently offline  Rachel Howe
Messages: 6
Registered: May 1996
Junior Member
Watcher wrote:
>
> I've used tv and tvscl to display the image, however it is too honest to
> the size of the image itself. Is there a way to scale the image so that
> it fits the display window?
>
> Thank you.
>
> Daben

You can use EXPAND,image,xsize,ysize,newimage

where xsize and ysize are the desired dimensions of the new image
in pixels. (It works even if xsize and ysize are less than the
original size of image, though obviously with some loss of
information).

Rachel


Re: How to scale image in idl? [message #6231 is a reply to message #6218] Wed, 15 May 1996 00:00 Go to previous message
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
Watcher wrote:
>
> I've used tv and tvscl to display the image, however it is too honest to
> the size of the image itself. Is there a way to scale the image so that
> it fits the display window?

Get yourself a copy of the ESRG library from

ftp://ftp.crseo.ucsb.edu/pub/idl

and check out the the TVIM procedure. I now use it almost exclusively
instead of TV or TVSCL.

Cheers,
Liam.
Re: How to scale image in idl? [message #6233 is a reply to message #6231] Wed, 15 May 1996 00:00 Go to previous message
David Foster is currently offline  David Foster
Messages: 341
Registered: January 1996
Senior Member
peter@hpl.hp.com (Peter Webb) wrote:
>
> Watcher (dliu@cs.tufts.edu) wrote:
> : I've used tv and tvscl to display the image, however it is too honest to
> : the size of the image itself. Is there a way to scale the image so that
> : it fits the display window?
>
> Use CONGRID to interpolate the image matrix to the window size.

You can also use EXPAND to change the size of an image. It's similar
to CONGRID and I don't know which one is faster. They have slightly
different options available.

If the window size is an integer multiple of the image size
then use the REBIN function as it is significantly faster,
especially for large images.

Dave Foster
UCSD Brain Image Analysis Lab
foster@bial1.ucsd.edu
Re: How to scale image in idl? [message #6240 is a reply to message #6231] Tue, 14 May 1996 00:00 Go to previous message
peter is currently offline  peter
Messages: 80
Registered: February 1994
Member
Watcher (dliu@cs.tufts.edu) wrote:
: I've used tv and tvscl to display the image, however it is too honest to
: the size of the image itself. Is there a way to scale the image so that
: it fits the display window?

Use CONGRID to interpolate the image matrix to the window size.

Peter
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Problem when using polyfill with maps
Next Topic: (no subject)

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:06:39 PDT 2025

Total time taken to generate the page: 0.00465 seconds