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

Home » Public Forums » archive » Re: IDL - fundamental question about image display
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: IDL - fundamental question about image display [message #39350] Thu, 13 May 2004 08:17
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Francois writes:

> Why does IDL invert (upside-down) an image when using the command tv or
> tvscl ?
>
> I have a TIFF file that is correct in all other software. But when I read it
> with IDL 6.0 using read_tiff,
> it is reverse when using tv or tvscl.

Oh, surely not *all* other software! :-)

This is just a convention. IDL chooses (by default) to
set the (0,0) point in the lower-left corner. Other
software (perhaps the majority, I don't know) puts
the (0,0) point in the upper-left corner. I'm sure
there were good reasons for the choice 20 years ago.
Perhaps a different choice would be made today.

In any case, you can choose the other convention by
setting the ORDER keyword on TV or TVSCL, or for all
images by setting the !ORDER system variable. Doing so
is OK for displaying images, but plays absolute havoc
when you are trying to interact with them, *especially*
if they have a coordinate system associated with them,
as I have painfully learned the past couple of weeks.

In that case, I think you are better off just flipping
the image when you read it and let IDL do its thing:

image = Read_Tiff(filename)
image = Reverse(image, 2)

And when you write TIFF files from within IDL:

Write_Tiff, filename, Reverse(image,2)

You sorta get used to doing it, if you know what
I mean. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Previous Topic: Object Graphics
Next Topic: IDLgrModel tranformation matrix

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

Current Time: Fri Oct 10 03:09:41 PDT 2025

Total time taken to generate the page: 0.16146 seconds