Login  Register

Re: Can not set Threshold at 1

Posted by Gabriel Landini on Oct 21, 2014; 1:13pm
URL: http://imagej.273.s1.nabble.com/Can-not-set-Threshold-at-1-tp5010131p5010132.html

On Tuesday 21 Oct 2014 12:56:47 you wrote:

> I have a 16-bit image with labeled cells.  Pixel values for cell 1 is 1, and
> pixel values for cell 2 is 2, and so on. The background pixel value is
> zero.  There are about 5000 cells in this image. When I tried to make a
> binary image to mask all cells using thresholding ( set threshold at 1).
> Surprisingly, the whole image becomes red (I set the threshold mode as
> RED), and I found that the minimum threshold I could use is 16.  I would
> like to use setThreshold( 1, 5000), but it does not seem to do in that way.
>
> Is there any people could help me to explain why this happens, and how to
> set the threshold at 1? Should I use plugin to do it? I am currently using
> ImageJ 1.47 and I found FIJI has the same issue too.

This is because the thresholder uses a 256-bin histogram out of the 16 bit
image to pack it into a manageable size, so in the first bin there are more
than one pixel value.

You perhaps need to do it by hand: go pixel by pixel and set it to the highest
value and the rest to 0.
Or use the changeValues(v1, v2, v3) macro function.

Hope this helps

Gabriel

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