Re: How to set the background value to the same value for a stack of images

Posted by Michael Schmid on
URL: http://imagej.273.s1.nabble.com/How-to-set-the-background-value-to-the-same-value-for-a-stack-of-images-tp5018903p5018911.html

Hi anonymous,

Michael's macro assumes that area and brightness of the foreground
objects are roughly the same for all stack slices and there is mostly
background in the image.

If this is not the case, for 8-bit images you could try using the Modal
Gray Value instead of the Mean. Omit the "n*getResult("StdDev",(i-1)".
Unfortunately, for 16-bit images the Modal Gray Value gives unreliable
results because of binning the pixel values to 256 bins; some bins
contain more 16-bit values than others. In that case, you have to
retrieve the 16-bit histogram and process it yourself.

You could also try using the Minimum or Maximum gray value (depends on
whether you have a dark or bright background) instead of the Mean, but
this is very sensitive to noise and outliers. A better alternative would
be creating a duplicate of the stack, smoothing it or filtering by a
median filter, and using the min or max gray value of this filtered stack.

Please also note that Michael's macro is for images without pixel value
calibration, and there should be no active selection (ROI) when it is
run - you might add 'run("Select None");' to ensure this is the case.

- Another Michael
________________________________________________________________
On 16/06/2017 19:16, jklwp007 wrote:
> Hi,
>
> Thank you for your quick replying. I tried this on a couple of my images,
> but it did not uniform the background. Should I change any parameter in that
> macro?
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.com/How-to-set-the-background-value-to-the-same-value-for-a-stack-of-images-tp5018903p5018910.html

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