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

Home » Public Forums » archive » Re: write_tiff integer format
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
Re: write_tiff integer format [message #62423] Wed, 10 September 2008 22:13 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Geo logo writes:

> I am a newcomer of IDL, when I try use write_tiff to write a integer
> type tiff, the result always wrong.
>
> input = intarr(1000,1000)
> write_tiff, 'outimag.tif' , input
>
> the result would be a byte type tiff file, and when I use
>
> write_tiff, 'outimag.tif' , input,/short, result will be unsigned
> int
>
> write_tiff, 'outimag.tif' , input,/long, result will be long integer.
>
> could somebody help me about how to output a integer type tiff file.

The more relevant question might be, given that life totally
sucks, how does one convert back and forth between signed
and unsigned integers?

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: write_tiff integer format [message #62517 is a reply to message #62423] Thu, 11 September 2008 04:36 Go to previous message
Spon is currently offline  Spon
Messages: 178
Registered: September 2007
Senior Member
On Sep 11, 6:13 am, David Fanning <n...@dfanning.com> wrote:
> Geo logo writes:
>> I am a newcomer of IDL, when I try use write_tiff to write a integer
>> type tiff,  the result always wrong.
>
>> input = intarr(1000,1000)
>> write_tiff, 'outimag.tif' , input
>
>> the result would be a byte type tiff file, and when I use
>
>>  write_tiff, 'outimag.tif' , input,/short, result will be  unsigned
>> int
>
>> write_tiff, 'outimag.tif' , input,/long, result will be long integer.
>
>> could somebody help me about how to output a integer type tiff file.
>
> The more relevant question might be, given that life totally
> sucks, how does one convert back and forth between signed
> and unsigned integers?
>
> 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.")

So what happens when you do this? :

input = uintarr(1000,1000)
write_tiff, 'outimag.tif' , input
input = fix(input)

Not got access to IDL right now, but I don't know why it shouldn't
work
Chris
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL calls C calls IDL?
Next Topic: Re: Some questions about "axis"

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

Current Time: Wed Oct 08 19:04:43 PDT 2025

Total time taken to generate the page: 0.00761 seconds