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).