Re: write_tiff integer format [message #62492] |
Fri, 12 September 2008 08:40 |
edward.s.meinel@aero.
Messages: 52 Registered: February 2005
|
Member |
|
|
On Sep 11, 12:05 pm, Jean H <jghas...@DELTHIS.ucalgary.ANDTHIS.ca>
wrote:
> Geo logo wrote:
>> 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.
>> Thanks
>
> well, from the help file is seems to be impossible.
> If you have negative values, you might want to save as float..
>
> Jean
Aw, you guys give up too easily. Hey, Rocky, watch me pull a rabbit
out of my hat. Nuthin' up my sleeve:
image = FIX(READ_TIFF(file_name))
Presto!
Similarly, David asks:
> The more relevant question might be, given that life totally
> sucks, how does one convert back and forth between signed
> and unsigned integers?
Try this --
x = INTARR(3)
x = [-5, 0, 5]
PRINT, x, UINT(x), FIX(UINT(x))
Ed "Bullwinkle" Meinel
|
|
|
Re: write_tiff integer format [message #62510 is a reply to message #62492] |
Thu, 11 September 2008 07:12  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Geo logo writes:
> My question is I wanted write a integer data type tiff file, but when
> I do this job, the result always byte type ,unsigned integer, or long
> integer. I wanted to know how to write an integer data type tiff file?
OK, I guess my argument was too subtle. Let's try this:
not gonna happen. At least with IDL. :-)
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 #62512 is a reply to message #62510] |
Thu, 11 September 2008 07:01  |
Geo logo
Messages: 3 Registered: September 2008
|
Junior Member |
|
|
On Sep 11, 7:36 am, Spon <christoph.b...@gmail.com> wrote:
> 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
On Sep 11, 7:36 am, Spon <christoph.b...@gmail.com> wrote:
> 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
My question is I wanted write a integer data type tiff file, but when
I do this job, the result always byte type ,unsigned integer, or long
integer. I wanted to know how to write an integer data type tiff file?
Thanks
|
|
|
Re: write_tiff integer format [message #62513 is a reply to message #62512] |
Thu, 11 September 2008 07:01  |
Geo logo
Messages: 3 Registered: September 2008
|
Junior Member |
|
|
On Sep 11, 7:36 am, Spon <christoph.b...@gmail.com> wrote:
> 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
My question is I wanted write a integer data type tiff file, but when
I do this job, the result always byte type ,unsigned integer, or long
integer. I wanted to know how to write an integer data type tiff file?
Thanks
|
|
|