How does Thresholder-Manual Work?

45 views
Skip to first unread message

Ardalan Alizadeh

unread,
Aug 8, 2014, 12:35:56 PM8/8/14
to icy-so...@googlegroups.com
Hey guys,

I am new user of Icy and I am wondering how does manual Thresholder plugin work? Can you please give me some information about the method of thresholding and filtering in this plugin?

Many thanks,

Ardalan

Alexandre Dufour

unread,
Aug 8, 2014, 12:41:38 PM8/8/14
to icy-so...@googlegroups.com
Hi Ardalan,

The Thresholder plugin will basically cut the image histogram into various classes (the number of which is given by the number of intensity thresholds you indicate, separated by spaces). Each class is then exported either into a region of interest (ROI) or as a label into a new image.

Of course, you don’t have to indicate the thresholds manually, you can’t also switch to the “KMeans” option, where you indicate the number of intensity classes, and the plugin will work out the best possible separation (i.e. thresholds) between these classes.

Does that answer your question?

Alexandre

IcyLyd

unread,
Aug 8, 2014, 1:25:36 PM8/8/14
to icy-so...@googlegroups.com
Hi Ardalan,
By analogy if you usually threshold your image with ImageJ/FIJI, here in Icy by entering one value (for example 100) in the manual threshold box you will keep all the pixel with value above 100
that means from 100 to max.
The entered value is thus equivalent to the lower limit of your class.
IcyLyd

Ardalan Alizadeh

unread,
Aug 9, 2014, 12:00:30 PM8/9/14
to icy-so...@googlegroups.com
Thank you for your prompt answer. So, in the manual Thresholder, the first number indicates the number of levels in histogram and the second number (with space between them) cuts the value of each pixel to upper or below the threshold? Is it something like that? Why the result is not binary image? I think I didn't get the idea of classes which you mentioned.

Did you consider other types of preprocessing and filtering with this thresholder?

Ardalan Alizadeh

unread,
Aug 9, 2014, 12:04:58 PM8/9/14
to icy-so...@googlegroups.com
Many thanks for your answers. Is there a help or other resources for Icy users to find out some more details about the technical implementation and methods used in plugins without going to source codes?

Alexandre Dufour

unread,
Aug 11, 2014, 6:15:42 AM8/11/14
to icy-so...@googlegroups.com
Hi Ardalan

> Thank you for your prompt answer. So, in the manual Thresholder, the first
> number indicates the number of levels in histogram and the second number
> (with space between them) cuts the value of each pixel to upper or below
> the threshold? Is it something like that? Why the result is not binary
> image? I think I didn't get the idea of classes which you mentioned.

There seems to be a bit of confusion in your understanding, so here's
another way to describe how it works, which might make more sense. Let's
assume you have a single channel 8-bit image (values ranging from 0 to
255).

1) Default mode (Method = "MANUAL")
Here you have to indicate in "Manual Thresholds" your threshold (or
multiple values separated by spaces).

If you indicate only a single value (e.g. 155), the result will be a
"traditional" binary image such that:
- [image values between 0 and 155] => 0
- [image values between 156 and 255] => 1

If you now indicate 2 values (e.g. the default values suggest 100 & 200),
the result will be a pseudo-binary (aka labeled) image such that:
- [image values between 0 and 100] => 0
- [image values between 101 and 200] => 1
- [image values between 201 and 255] => 2
Using 2 thresholds can be useful when you have an image containing a dark
background, and a combination of dim and bright structures that you wish
to isolate.

You can of course indicate as many values (more than 2), and the result
will follow the same pattern: you will produce a pseudo-binary image with
each label describing a range of intensity ("class" is the technical term
for each intensity range, or area in the histogram)


2) Automated mode (Method = "KMeans")
In this mode, you do *not* have to indicate the threshold values yourself.
However, you have to indicate how many "classes" (i.e. areas in the
histogram) you which to distinguish.

If you indicate "2" (the minimum possible value), you are in fact telling
the method to split the histogram in 2 areas (or 2 classes), and therefore
the plugin should calculate the (one) threshold value that best separates
them. In the example above, it could automatically calculate a value of
155, but it could have given you 157 if it believes this is statistically
a better value given your histogram.

If you indicate "3", you are now asking to find 3 classes in the
histogram, the plugin will therefore calculate 2 threshold values (that
separate the 3 classes). Again this is equivalent to giving (manually) 2
thresholds as in the example above.

In more details, the algorithm used in this mode to automatically
calculate the final threshold value(s) is called "KMeans", and basically
will try to statistically optimise the position of the threshold in the
histogram such that the final classes are as dense as possible, and as
well separated as possible (it basically maximises the inter-class
variance).


> Did you consider other types of preprocessing and filtering with this
> thresholder?


What do you mean by "pre-processing" of "filtering"? This may just be a
terminology issue, but the plug-in does not conduct any pre-processing or
filtering on the image data (it just transforms an image into binary or
pseudo-binary format). There are many other plug-ins for filtering (look
for instance at the Filter Toolbox).

If you were in fact referring to other *algorithms* to calculate
thresholds automatically, then there is another plugin called "Best
Threshold" that contains other algorithms. Note however that these other
methods are only able to calculate a single threshold value, so they will
always produce a binary image.

I hope this makes things more clear. If this explanation is however still
not enough, I suggest you give us a bit more details on what you are
attempting to do (and perhaps post a sample image).

All the best,
Alexandre

PS: in response to your latest post, each and every plugin in Icy has an
associated webpage on the website that *should* detail the algorithm that
is used, without having you to go to the source code. If such
documentation is missing, make sure you leave a comment on the plugin page
to ask for it (and leave a rating accordingly).

Ardalan Alizadeh

unread,
Aug 11, 2014, 10:27:26 AM8/11/14
to icy-so...@googlegroups.com

Hi Alexandre,

Thank you very much for your complete answer. This information is more than enough for me and it is clear for me how it works.

Best regards,

Ardalan
Reply all
Reply to author
Forward
0 new messages