Login  Register

Bug in Background Subtracter

Posted by Koen van dijken on Jul 17, 2016; 8:37am
URL: http://imagej.273.s1.nabble.com/Bug-in-Background-Subtracter-tp5016896.html

While finalising a new plugin I discovered a bug in Background Subtracter.
In my own plugin I encounter a similar problem and do not know how to fix
it. To reproduce the bug in Background Subtracter take the following steps:

Bug in Background subtracter:

1: Load a tiff with three (double) channels
2: Image -> Color -> Split channels
3: for each slice (R, G and B): Image -> Type -> 32 bit
4: Image -> Color -> Merge channels
5: Process -> Subtract background

You can also download this sample file from my dropbox:

https://www.dropbox.com/s/r0wbvft0xh6wucr/merge32-1.tif?dl=0

, load it into ImageJ and proceed with step 5.

Now two of the three resulting channels will show black. They have sensible
data but probably some min and max are off and so do not show properly.

I noticed that by doing Image -> Adjust -> Window/Level -> Reset on the
defective slice the image springs back and shows. I traced through the
source of ij.plugin.frame.ContrastAdjuster.reset(ImagePlus, ImageProcessor)
but did not succeed in taking similar steps in my own plugin to get the
same result.

Does anybody know how to reset a stack of 32-bit images to show properly
after the values of the images have changed so much they fall outside their
previous bounds? I suspect some series of ip.resetMinAndMax() but just that
does not do.

Greetings from Holland,

Koen

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