Re: WRITE_TIFF [message #14791] |
Mon, 29 March 1999 00:00 |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Joseph B. Gurman (gurman@gsfc.nasa.gov) writes about his problems
getting the ORDER keyword to work with TIFF files:
Dick and I have pretty much given up on the ORDER keyword
with TIFF files. As far as we can tell, it's mostly
ignored by almost all software that we routinely use.
We have had to resort to reversing the image order
physically, so that the image appears correct in the
software in which we want to display it.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: WRITE_TIFF [message #14792 is a reply to message #14791] |
Mon, 29 March 1999 00:00  |
David Foster
Messages: 341 Registered: January 1996
|
Senior Member |
|
|
Joseph B. Gurman wrote:
>
> IDL> write_tiff, file + strmid(strtrim(10000 + i, 2), 1, 4), b0, 0, red =
> r, green = g, blue = b
>
> (that is, I explicitly tell write_tiff to assume the order is "0").
>
> Then, on the same system, I try:
>
> IDL> c = read_tiff('file.0957', r, g, b, order = order) & print, order
>
> The result I get is "4," not "0."
>
> If I were only using IDL, I would not be concerned, but when I try
> reading the same file on a Mac using Adobe Photoshop 5.0.2, I get an
> inverted (top to bottom) image.
>
> To confuse myself yet further, I decided to try to write the same
> image with an order paramater of "1." Once again, the order was read
> correctly with READ_TIFF, but once again, the image on the Mac was
> inverted.
From the OnLine help:
READ_TIFF:
ORDER
Set this keyword to a named variable that will contain the order
value from the TIFF file. This value is returned as 0 for images
written
bottom to top, and 1 for images written top to bottom. If an order
value does not appear in the TIFF file, an order of 1 is returned.
The ORDER keyword can return any of the following additional values
(depending on the source of the TIFF file):
1 top to bottom, left to right
2 top to bottom, right to left
3 bottom to top, right to left
4 bottom to top, left to right
5 top to bottom, left to right
6 top to bottom, right to left
7 bottom to top, right to left
8 bottom to top, left to right
WRITE_TIFF:
Order
This argument should be 0 if the image is stored from bottom to top
(the default). For images stored from top to bottom, this argument
should be 1.
CautionNot all TIFF readers honor the value of the Order argument.
IDL writes the value into the file, but many known readers ignore this
value. In such cases, we recommend that you convert the image to top
to bottom order with the REVERSE function and then set Order to 1.
Dave
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2240
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
|
|
|