Login  Register

Re: Rescaled Images in a 32 bit Stack

Posted by Maria Calvo-2 on Mar 10, 2010; 2:06pm
URL: http://imagej.273.s1.nabble.com/Rescaled-Images-in-a-32-bit-Stack-tp3689034p3689036.html

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]
___________________________________