Re: Problem with TIF image [message #53254] |
Sun, 01 April 2007 07:52  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
vijay writes:
> hi i am having simple problem while using the IDL, every time if i
> open any of the TIF image, the image gets transposed and rotated to
> 270 degrees. I had opened in TVSCL, ISURFACE, etc and I had tested
> with different images, but same problem is repeating. But when i open
> JPEG images the display is quite normal. The problem occurs only in
> the TIF images. tell me how to solve this problem.
IDL uses a convention that locates the pixel (0,0) at
the lower-left of the image. TIFF files (normally)
prefer a convention that locates the pixel (0,0) at
the upper-left of the image. As a result, you typically
have to reverse the Y dimension of an image before you
write it to a TIFF file. (Setting the ORDER keyword,
which purports to do this for you, doesn't.)
In your case, it appears you have to reverse the Y
dimension when you read the file. If the image is
pixel interleaved (I.e. a 3xmxn image), then it is
done like this:
image = Read_Tiff('mytiff.tif')
image = Reverse(image, 3)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: Problem with TIF image [message #53339 is a reply to message #53254] |
Mon, 02 April 2007 14:35  |
Jeff N.
Messages: 120 Registered: April 2005
|
Senior Member |
|
|
> write it to a TIFF file. (Setting the ORDER keyword,
> which purports to do this for you, doesn't.)
>
David,
Can you explain a little about what the problem is with the ORDER
keyword? I've seen you mention that it doesn't work a few times. I've
never had any trouble with it, but I have only needed to use it in
trivial situations.
Thanks,
Jeff
|
|
|