Login  Register

Threshold bug

Posted by Ed White on Mar 11, 2016; 3:35pm
URL: http://imagej.273.s1.nabble.com/Threshold-bug-tp5015854.html

Hi all,

I think I've encountered a bug in the ImageJ threshold operation. I'm
wondering if this is a known issue and if anyone has a solution.

I have a 32bit image on which I perform a threshold using the Huang
algorithm. For my particular example using Huang applies a threshold to
pixel values between -3586.43 and 260.45. While previewing the threshold
(looking at the red overlay of thresheld pixels), I zoom in on the image
and check individual pixel values. To my surprise, I find that some pixels
slightly above the 260.45 threshold are red in the preview, as well as all
those below 260.45 (by slightly above, I've seen values up to 266
included). When I actually apply the threshold it seems to be done
properly; in other words, those pixels displayed in red that were above
260.45 are not included when the operation is preformed. To summarize, on
single images the bug appears to 'make red' some incorrect pixels while
previewing the threshold.

On image stacks the problem is more severe. In addition to displaying the
threshold incorrectly, it performs the threshold incorrectly. It uses the
'displayed' threshold that includes some pixels above the set threshold.
So, if I perform exactly the same threshold operation on a single image and
on an image stack containing the image, I get incorrect results on the
image stack (I've been careful to keep all settings the same and check
'Calculate threshold for each image').

Has anyone else encountered this problem before and know of a solution?

I'm running Fiji ImageJ 1.49q 64-bit on a Windows 7 machine.

Thanks,
Ed

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