Login  Register

Re: Enhance Contrast not idempotent? (was: Re: 8-bit to RGB changes data?)

Posted by Ed Siefker on Apr 13, 2016; 3:40pm
URL: http://imagej.273.s1.nabble.com/8-bit-to-RGB-changes-data-tp5016110p5016121.html

How strange.  This is what I get running that macro:

Display range is 0 to 35
Display range is 0 to 85
Display range is 0 to 35
Display range is 0 to 85
Display range is 0 to 35


On Wed, Apr 13, 2016 at 8:28 AM, Michael Schmid <[hidden email]> wrote:

> Hi Ed,
>
> sorry, I cannot reproduce this. Running 'Enhance contrast' repeatedly always
> results in the same setting of the display range. Try this macro:
>
> for (i=0; i<5; i++) {
>   run("Enhance Contrast...", "saturated=0.1");
>   getMinAndMax(min, max);
>   print("Display range is "+min+" to "+max);
> }
>
> The 'Auto' button of the B&C panel is not idempotent: when pressing it more
> than once, the display range is narrowed (a very nice feature!)
>
> Also, 'Enhance Contrast' is not idempotent when you select the checkbox to
> equalize the histogram (this modifies the image data).
>
> Michael
> ________________________________________________________________
> Michael Schmid                    email: [hidden email]
> On 2016-04-12 22:08, Ed Siefker wrote:
>>
>> Thanks, running 'setMinAndMax(0, 255)' before the conversion seems to
>> work.
>>
>> This brings me to another question.  Why isn't 'Enhance Contrast'
>> idempotent?
>> Repeated application of Enhance Contrast with the same parameters
>> e.g. run("Enhance Contrast...", "saturated=0.1");
>> results in repeated changing of the image.
>>
>> Given a histogram, isn't there exactly one value above which 0.1% of
>> values are
>> found?
>>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html