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

Home » Public Forums » archive » 16 bit Tiff image
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
16 bit Tiff image [message #58946] Wed, 27 February 2008 10:51 Go to next message
Stefano Scardigli is currently offline  Stefano Scardigli
Messages: 7
Registered: February 2008
Junior Member
Hi all,

I'm new in using IDL and I'm using an old version too.
I have a strange problem in writing 16 bit TIFF files

this is the dump of my problem (I omitted the unuseful rows):

IDL Version 5.1 (OSF alpha). Research Systems, Inc.
IDL> img=read_tiff("V13A5.00.tif",/unsigned)
IDL> help,img
IMG LONG = Array[1000, 1000]
IDL> print,max(img)
65535
IDL> write_tiff,"prova.tiff",img
IDL> print,max(img)
255
IDL> img2=read_tiff("prova.tiff",/unsigned)
IDL> print,max(img2)
255
IDL> help,img
IMG BYTE = Array[1000, 1000]
IDL> help,img2
IMG2 BYTE = Array[1000, 1000]
IDL>

as you can see the file prova.tiff is a 8 bit image and also the array img
is changed from LONG to BYTE. I tried all the parameter of the write_tiff
procedure, but nothing change

many thanks to who will help me

Stefano Scardigli
Re: 16 bit Tiff image [message #58993 is a reply to message #58946] Fri, 29 February 2008 02:09 Go to previous messageGo to next message
Spon is currently offline  Spon
Messages: 178
Registered: September 2007
Senior Member
On Feb 29, 7:34 am, Stefano Scardigli <s.scardi...@libero.it> wrote:
> what a mess =:-O
>
> I'm on IDL 5.1 and I'm working on a remote server via ssh.
>
> I haven't QUERY_TIFF
> I haven't SWAP_ENDIAN_INPLACE
>

I think TIFF_DUMP was QUERY_TIFF's unwieldy predecessor. Perhaps you
have that, and can use the Offset information to open at least the
image within the file with OPENR / FSTAT / READU, reform the input
manually and use REVERSE instead of SWAP_ENDIAN?

I think all these features are likely to predate 5.0

Best of luck,
Chris
Re: 16 bit Tiff image [message #59067 is a reply to message #58993] Sun, 02 March 2008 02:56 Go to previous message
Stefano Scardigli is currently offline  Stefano Scardigli
Messages: 7
Registered: February 2008
Junior Member
Okay, it seems i have some problem with the original tiff:

IDL> tiff_dump,"Alexa555p81.h00.tif"
% Compiled module: TIFF_DUMP.
Tiff File: byte order=II, Version = 42
23 directory entries
*** NewSubfileType, tag = 254, Long, Count = 1
0
*** ImageWidth, tag = 256, Long, Count = 1
1978
*** ImageLength, tag = 257, Long, Count = 1
5761
*** BitsPerSample, tag = 258, Short, Count = 1
16
*** Compression, tag = 259, Short, Count = 1
1
*** PhotometricInterpretation, tag = 262, Short, Count = 1
1
*** ImageDescription, tag = 270, Ascii, Count = 555
% Subscript range values must be >= 0, < size: VAL.
% Error occurred at: TIFF_DUMP_FIELD 118 /afs/caspur.it/local/products/
vendor/idl/idl/lib/obsolete/tiff_dump.pro
% TIFF_DUMP 219 /afs/caspur.it/local/products/
vendor/idl/idl/lib/obsolete/tiff_dump.pro
% $MAIN$
% Execution halted at: TIFF_DUMP 219 /afs/caspur.it/local/
products/vendor/idl/idl/lib/obsolete/tiff_dump.pro
IDL>

//// but I can read it anyway ////

IDL> img=read_tiff("Alexa555p81.h00.tif",/unsigned)
IDL> help, img
IMG LONG = Array[1978, 5761]
IDL> print,max(img)
65535
IDL>

IDL> write_tiff,"prova.tif",fix(img),/LONG
IDL> help,img
IMG LONG = Array[1978, 5761]
IDL> print,max(img)
65535
IDL> tiff_dump,"prova.tif"
Tiff File: byte order=II, Version = 42
14 directory entries
*** NewSubfileType, tag = 254, Long, Count = 1
0
*** ImageWidth, tag = 256, Long, Count = 1
1978
*** ImageLength, tag = 257, Long, Count = 1
5761
*** BitsPerSample, tag = 258, Short, Count = 1
32
*** Compression, tag = 259, Short, Count = 1
1
*** PhotometricInterpretation, tag = 262, Short, Count = 1
1
*** StripOffsets, tag = 273, Long, Count = 1
8
*** Orientation, tag = 274, Short, Count = 1
4
*** SamplesPerPixel, tag = 277, Short, Count = 1
1
*** RowsPerStrip, tag = 278, Long, Count = 1
5761
*** StripByteCounts, tag = 279, Long, Count = 1
45581032
*** XResol, tag = 282, Rational, Count = 1
100.000
*** Yresol, tag = 283, Rational, Count = 1
100.000
*** PlanarConfiguration, tag = 284, Short, Count = 1
1
IDL>

and the resulting file seems to have less problems but I can not
understand the meaning of these tag and the result is the same with
different images.

IDL> img2=read_tiff("prova.tif",/UNSIGNED)
IDL> help, img2
IMG2 LONG = Array[1978, 5761]
IDL> print,max(img2)
255
IDL>




On Fri, 29 Feb 2008 02:09:35 -0800, Spon wrote:

> On Feb 29, 7:34 am, Stefano Scardigli <s.scardi...@libero.it> wrote:
>> what a mess =:-O
>>
>> I'm on IDL 5.1 and I'm working on a remote server via ssh.
>>
>> I haven't QUERY_TIFF
>> I haven't SWAP_ENDIAN_INPLACE
>>
>>
> I think TIFF_DUMP was QUERY_TIFF's unwieldy predecessor. Perhaps you
> have that, and can use the Offset information to open at least the image
> within the file with OPENR / FSTAT / READU, reform the input manually
> and use REVERSE instead of SWAP_ENDIAN?
>
> I think all these features are likely to predate 5.0
>
> Best of luck,
> Chris
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL 7 boot error
Next Topic: Re: Any interest in an IDL to Python interface?

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

Current Time: Wed Oct 08 11:50:57 PDT 2025

Total time taken to generate the page: 0.00935 seconds