Rescaled Images in a 32 bit Stack

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Rescaled Images in a 32 bit Stack

Maria Calvo-2
Hello everybody,

We have a "problem" when doing Stacks with images (32 bits) that have
diferent ranges of their pixel values . ImageJ takes one range of one image
to decide the color scale. But then, ImageJ aplies this color-scale to all
the images of the Stack, so that if there is any image that is more intense
than the first one, this last one is very saturated or otherwise it can be
almost all dark, even if this image alone (this is when is not in a stack)
looks very well.
The image appearance can be restored by threshold reseting, but then the
other images in the stack are rescaled again.

Is it because image depth is infinite (32 bits)? Can this be avoided somehow?

I hope you can help us. Thanks a lot.


Maria Calvo and Pol Solans

--


___________________________________

Dra. Maria Calvo

Unitat de Microscòpia Confocal
Serveis Cientificotècnics-C.Casanova
Facultat de Medicina
Universitat de Barcelona- IDIBAPS
C/ Casanova 143
Barcelona 08036

Tel: 34 934037159/39930
Fax: 34 934039946
E-mail: [hidden email]
___________________________________
Reply | Threaded
Open this post in threaded view
|

Re: Rescaled Images in a 32 bit Stack

Rasband, Wayne (NIH/NIMH) [E]
On Mar 9, 2010, at 10:53 AM, Maria Calvo wrote:

> Hello everybody,
>
> We have a "problem" when doing Stacks with images (32 bits) that have
> diferent ranges of their pixel values . ImageJ takes one range of one image
> to decide the color scale. But then, ImageJ aplies this color-scale to all
> the images of the Stack, so that if there is any image that is more intense
> than the first one, this last one is very saturated or otherwise it can be
> almost all dark, even if this image alone (this is when is not in a stack)
> looks very well.
> The image appearance can be restored by threshold reseting, but then
> the other images in the stack are rescaled again.
>
> Is it because image depth is infinite (32 bits)? Can this be avoided somehow?
>
> I hope you can help us. Thanks a lot.

You can avoid this problem by converting the n image stack to an n channel hyperstack. This example macro creates a 25 channel hyperstack containing images with pixel value ranges that vary from 0-1 to 0-15594.

  n = 25;
  newImage("Demo", "32-bit Ramp", 512, 512, n);
  run("Macro...", "code=v=v*pow(z+1,3) stack"); // Process>Math>Macro
  run("Stack to Hyperstack...",
    "channels="+n+" slices=1 frames=1 display=Grayscale");
  for (i=1; i<=n; i++) {
    Stack.setChannel(i);
    resetMinAndMax;
    getStatistics(pixels, mean, min, max);
    print(i+": "+min+"-"+max);
  }
Reply | Threaded
Open this post in threaded view
|

Re: Rescaled Images in a 32 bit Stack

Maria Calvo-2
Dear Wayne Rasband,
Thank you for the answer, we will try that,
Cheers,
MariaCalvo

Rasband, Wayne (NIH/NIMH) [E] escribió:

> On Mar 9, 2010, at 10:53 AM, Maria Calvo wrote:
>
>  
>> Hello everybody,
>>
>> We have a "problem" when doing Stacks with images (32 bits) that have
>> diferent ranges of their pixel values . ImageJ takes one range of one image
>> to decide the color scale. But then, ImageJ aplies this color-scale to all
>> the images of the Stack, so that if there is any image that is more intense
>> than the first one, this last one is very saturated or otherwise it can be
>> almost all dark, even if this image alone (this is when is not in a stack)
>> looks very well.
>> The image appearance can be restored by threshold reseting, but then
>> the other images in the stack are rescaled again.
>>
>> Is it because image depth is infinite (32 bits)? Can this be avoided somehow?
>>
>> I hope you can help us. Thanks a lot.
>>    
>
> You can avoid this problem by converting the n image stack to an n channel hyperstack. This example macro creates a 25 channel hyperstack containing images with pixel value ranges that vary from 0-1 to 0-15594.
>
>   n = 25;
>   newImage("Demo", "32-bit Ramp", 512, 512, n);
>   run("Macro...", "code=v=v*pow(z+1,3) stack"); // Process>Math>Macro
>   run("Stack to Hyperstack...",
>     "channels="+n+" slices=1 frames=1 display=Grayscale");
>   for (i=1; i<=n; i++) {
>     Stack.setChannel(i);
>     resetMinAndMax;
>     getStatistics(pixels, mean, min, max);
>     print(i+": "+min+"-"+max);
>   }
>
>  


--


___________________________________

Dra. Maria Calvo

Unitat de Microscòpia Confocal
Serveis Cientificotècnics-C.Casanova
Facultat de Medicina
Universitat de Barcelona- IDIBAPS
C/ Casanova 143
Barcelona 08036

Tel: 34 934037159/39930
Fax: 34 934039946
E-mail: [hidden email]
___________________________________