Login  Register

Re: Can not set Threshold at 1

Posted by Michael Schmid on Oct 21, 2014; 4:03pm
URL: http://imagej.273.s1.nabble.com/Can-not-set-Threshold-at-1-tp5010131p5010134.html

Hi Zhengyu,

one more remark:

Even if you don't see the correct pixels painted red, most operations using the threshold do the correct thing.

So if you have a 16-bit image and set the Threshold at from 1 to 1, operations like 'Create Mask' or the Wand tool select the area where the pixel value is exactly one. (for the Wand tool, of course you have to know where to click, which might be a problem is you don't see it).

What exactly do you have in mind? Seeing where a given cell number can be found in something like the 'Count Masks' created by Analyze Particles?
If you use Analyze Particles with "record starts" enabled, one could e.g. create a macro that recovers the starting coordinates of a given particle, uses the Wand to select it, and then use Overlay.addSelection("", 0, "red") to show it red.


Michael
________________________________________________________________


On Oct 21, 2014, at 15:13, Gabriel Landini wrote:

> 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

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