Byte-Scaling Tiff Stacks [message #49346] |
Thu, 20 July 2006 07:54  |
Magdalena83
Messages: 2 Registered: July 2006
|
Junior Member |
|
|
I used readtiffstack.pro to read in a stack of tiffs, but I think IDL
cycles through the color tables several times because it isn't in 8-bit
format, producing a weird image. I have tried using
-->plot_image, sigrange(bytscl(image_name(*,*,0)))
to just view the first frame after being byte-scaled, and also I have
tried
-->scaledimage=bytscl(image_name)
plot_image, scaledimage(*,*,0)
but bytscl seems to do nothing.
What can I do to get my images properly byte-scaled? These are just
black and white images. Thanks
|
|
|
Re: Byte-Scaling Tiff Stacks [message #49420 is a reply to message #49346] |
Fri, 21 July 2006 12:34  |
btt
Messages: 345 Registered: December 2000
|
Senior Member |
|
|
Magdalena83 wrote:
> Thanks for replying; here are my answers for your inquiries:
>> Could you post to the news group the following...
>>
>> print, SIZE(image_name)
> 3 512 170 492 1 42823680
> print, MIN(image_name)
> 0
>> print, MAX(image_name)
> 255
>> DEVICE, GET_DECOMPOSED = thisDecomp
>> print, thisDecomp
> 0
>> Also, what do you mean by "black and white images"? Do you really mean
>> greyscale or do you mean bilevel (like 0 and 1 or 0 and 255)?
> Sorry, I meant 16-bit grayscale images.
>
> IDL can read them fine if I convert the tiffs to 8-bits in ImageJ
> beforehand, but I am worried that I will lose too much info by doing
> this. I believe that byte-scaling should fix the problem, but "bytscl"
> isn't working.
>
> Basically, I am looking for the best way to read in stacks of 16-bit
> tiff images so that I can perform alignment procedures on them and then
> FFT certain pixels to search for oscillations in intensity.
>
> The data was originally .fits format, but I flatted and dark-subtracted
> them in ImageJ, which can't write .fits files. Thus, I now have a stack
> of 2500 .tif frames ready to be aligned, but IDL doesn't read them
> correctly.
> Thanks for any advice you can give.
>
Hello again,
Well, BYTSCL really isn't what you are looking for. In basic useage
the BYTSCL looks for the min and max range of the input data and
linearly scales these (along with all the other values) to stretch from
0B to 255B. Your input data appears to already be in that range, so the
isn't anything that BYTSCL can do with the data.
If you want to scale the data into some other range (like 16 bit signed
-32,768 to +32,767) then you might want to use something like ....
http://www.dfanning.com/programs/scale_vector.pro
which lets you specify the top and bottom values for the intensity range
you want.
Ben
|
|
|
Re: Byte-Scaling Tiff Stacks [message #49425 is a reply to message #49346] |
Fri, 21 July 2006 11:36  |
Magdalena83
Messages: 2 Registered: July 2006
|
Junior Member |
|
|
Thanks for replying; here are my answers for your inquiries:
> Could you post to the news group the following...
>
> print, SIZE(image_name)
3 512 170 492 1 42823680
print, MIN(image_name)
0
> print, MAX(image_name)
255
> DEVICE, GET_DECOMPOSED = thisDecomp
> print, thisDecomp
0
>
> Also, what do you mean by "black and white images"? Do you really mean
> greyscale or do you mean bilevel (like 0 and 1 or 0 and 255)?
Sorry, I meant 16-bit grayscale images.
IDL can read them fine if I convert the tiffs to 8-bits in ImageJ
beforehand, but I am worried that I will lose too much info by doing
this. I believe that byte-scaling should fix the problem, but "bytscl"
isn't working.
Basically, I am looking for the best way to read in stacks of 16-bit
tiff images so that I can perform alignment procedures on them and then
FFT certain pixels to search for oscillations in intensity.
The data was originally .fits format, but I flatted and dark-subtracted
them in ImageJ, which can't write .fits files. Thus, I now have a stack
of 2500 .tif frames ready to be aligned, but IDL doesn't read them
correctly.
Thanks for any advice you can give.
|
|
|
Re: Byte-Scaling Tiff Stacks [message #49433 is a reply to message #49346] |
Fri, 21 July 2006 06:47  |
btt
Messages: 345 Registered: December 2000
|
Senior Member |
|
|
Magdalena83 wrote:
> I used readtiffstack.pro to read in a stack of tiffs, but I think IDL
> cycles through the color tables several times because it isn't in 8-bit
> format, producing a weird image. I have tried using
> -->plot_image, sigrange(bytscl(image_name(*,*,0)))
> to just view the first frame after being byte-scaled, and also I have
> tried
> -->scaledimage=bytscl(image_name)
> plot_image, scaledimage(*,*,0)
> but bytscl seems to do nothing.
>
> What can I do to get my images properly byte-scaled? These are just
> black and white images. Thanks
>
Hello,
You have thrown a lot of things out here - many of which I don't follow.
Could you post to the news group the following...
print, SIZE(image_name)
print, MIN(image_name)
print, MAX(image_name)
DEVICE, GET_DECOMPOSED = thisDecomp
print, thisDecomp
Also, what do you mean by "black and white images"? Do you really mean
greyscale or do you mean bilevel (like 0 and 1 or 0 and 255)?
Cheers,
Ben
|
|
|