Re: How to scale image in idl? [message #6218] |
Thu, 16 May 1996 00:00 |
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  |
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  |
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  |
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  |
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
|
|
|