Re: write_tiff integer format [message #62423] |
Wed, 10 September 2008 22:13  |
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  |
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
|
|
|