About automatic thresholding program implemented in ImageJ

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

About automatic thresholding program implemented in ImageJ

Takamasa Kitaoji
Respected ImageJ researchers, I have some questions about automatic
thresholding program to ask you.
Questions are as follows;

Q1. How do I know the threshold automatically set based on each algorism is
reasonable or not?

Q2. Among 16 automatic thresholding algorisms, how do you decide which
algorithm to use for image analysis?

Q3. In image analysis by automatic thresholding method, I sometimes
encounter an error that the window of ImageJ shows“threshold not found
after 10000 iterations”. Are there any specific conditions when this kind
of error occurs? Is this some kind of bug?

I’m looking forward to hearing from you.

--
-----------------------------------------------------------------------------
Takamasa Kitaoji
Affiliations; Department of Neurology,
Graduate School of Medical Science,
 Kyoto Prefectural University of Medicine,
 Kyoto, Japan
Mail; [hidden email]
-----------------------------------------------------------------------------

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: About automatic thresholding program implemented in ImageJ

Herbie
Greetings Takamasa Kitaoji,

your questions appears being to the point but beware that my answers may
not be really satisfying...

A1. & A2.
Be aware of the fact that the automatic threshold schemes mainly serve
the purpose of getting *reproducible* results from *similar* images.
This means that if you have found a scheme that gives the expected
results for a typical sample image, you should not change the scheme for
other images of the same kind.
The decision if a threshold scheme is reasonable for a certain kind of
images is up to you.
Thresholding means perhaps the most dramatic information reduction for
signals that you can think of. It is up to you to decide what parts of
your images are to be maintained and which are not. According to your
decision, a scheme must be chosen.

A3.
This happens only for very few threshold schemes (perhaps only one) and
it is *not* a bug.
As far as I know, all automatic threshold schemes are based on the
information contained in the gray-value histograms of images. The
algorithms use the histograms to decide at which gray-value the
threshold is to be set. An iterative algorithm may not converge because
the histogram data doesn't allow it find a final single threshold value.

Regards

Herbie

::::::::::::::::::::::::::::::::::::::::::::::
Am 31.03.21 um 05:29 schrieb Takamasa Kitaoji:

> Respected ImageJ researchers, I have some questions about automatic
> thresholding program to ask you.
> Questions are as follows;
>
> Q1. How do I know the threshold automatically set based on each algorism is
> reasonable or not?
>
> Q2. Among 16 automatic thresholding algorisms, how do you decide which
> algorithm to use for image analysis?
>
> Q3. In image analysis by automatic thresholding method, I sometimes
> encounter an error that the window of ImageJ shows“threshold not found
> after 10000 iterations”. Are there any specific conditions when this kind
> of error occurs? Is this some kind of bug?
>
> I’m looking forward to hearing from you.
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: About automatic thresholding program implemented in ImageJ

Gabriel Landini
In reply to this post by Takamasa Kitaoji
On Wednesday, 31 March 2021 04:29:03 BST [hidden email] wrote:
> Q1. How do I know the threshold automatically set based on each algorism is
> reasonable or not?

Let me add to Herbie's reply that you could set a hand crafted result (eg a
binary image) which you consider "reasonable" (a ground truth set, if it
exists or a gold standard if it does not) and compare that to the results
obtained with various auto-thresholding algorithms. There are some statistics
that let you do such comparisons like the Dice and the Jaccard indexes
(globally to the image or individually to each blob detected) or other
reliability measures (FP, FN, TP, TN, etc) .

> Q2. Among 16 automatic thresholding algorisms, how do you decide which
> algorithm to use for image analysis?

Following the suggestion above you could compare the reliability measures
described above and choose the method that returns the closest values to the
ideal (ie that matches your ground truth or gold standard best).

See for example Figs 5 to 7 in:
https://onlinelibrary.wiley.com/doi/full/10.1111/jmi.12474

> Q3. In image analysis by automatic thresholding method, I sometimes
> encounter an error that the window of ImageJ shows“threshold not found
> after 10000 iterations”. Are there any specific conditions when this kind
> of error occurs? Is this some kind of bug?

Please have a look at the documentation of the autothresholding plguins here:

https://blog.bham.ac.uk/intellimic/g-landini-software/auto-threshold-and-auto-local-threshold/

That explains the warning of the MinError method and what is the result
returned in such cases (i.e. the the Mean threshold which is the initial
estimate of the iterative process).

Regards

Gabriel

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: About automatic thresholding program implemented in ImageJ

Takamasa Kitaoji
Dear Herbie and Gabriel

Thank you for your answer to my question.
I appreciate your instructive comments.

I would like to ask an additional question in relation to Q3.
In my experience, errors sometimes occurred when the three
methods(Intermodes, MinError, and Minimum) were applied, but not when the
other methods were applied.
Is it the same reason as the MinError method that errors also occasionally
occur when Intermodes or Minimum method is used?

Best regards

Kitaoji

2021年3月31日(水) 19:23 Gabriel Landini <[hidden email]>:

> On Wednesday, 31 March 2021 04:29:03 BST [hidden email] wrote:
> > Q1. How do I know the threshold automatically set based on each algorism
> is
> > reasonable or not?
>
> Let me add to Herbie's reply that you could set a hand crafted result (eg
> a
> binary image) which you consider "reasonable" (a ground truth set, if it
> exists or a gold standard if it does not) and compare that to the results
> obtained with various auto-thresholding algorithms. There are some
> statistics
> that let you do such comparisons like the Dice and the Jaccard indexes
> (globally to the image or individually to each blob detected) or other
> reliability measures (FP, FN, TP, TN, etc) .
>
> > Q2. Among 16 automatic thresholding algorisms, how do you decide which
> > algorithm to use for image analysis?
>
> Following the suggestion above you could compare the reliability measures
> described above and choose the method that returns the closest values to
> the
> ideal (ie that matches your ground truth or gold standard best).
>
> See for example Figs 5 to 7 in:
> https://onlinelibrary.wiley.com/doi/full/10.1111/jmi.12474
>
> > Q3. In image analysis by automatic thresholding method, I sometimes
> > encounter an error that the window of ImageJ shows“threshold not found
> > after 10000 iterations”. Are there any specific conditions when this kind
> > of error occurs? Is this some kind of bug?
>
> Please have a look at the documentation of the autothresholding plguins
> here:
>
>
> https://blog.bham.ac.uk/intellimic/g-landini-software/auto-threshold-and-auto-local-threshold/
>
> That explains the warning of the MinError method and what is the result
> returned in such cases (i.e. the the Mean threshold which is the initial
> estimate of the iterative process).
>
> Regards
>
> Gabriel
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>


--
-----------------------------------------------------------------------------
北大路 隆正
京都府立医科大学 神経内科学
〒602-0841 京都市上京区河原町通広小路上る梶井町465
TELL: 075-251-5111
e-mail: [hidden email]
-----------------------------------------------------------------------------

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: About automatic thresholding program implemented in ImageJ

Gabriel Landini
On Wednesday, 31 March 2021 12:48:19 BST [hidden email] wrote:
> I would like to ask an additional question in relation to Q3.
> In my experience, errors sometimes occurred when the three
> methods(Intermodes, MinError, and Minimum) were applied, but not when the
> other methods were applied.
> Is it the same reason as the MinError method that errors also occasionally
> occur when Intermodes or Minimum method is used?
>
Hi,
Yes the Minimum, Intermodes and MinErr methods can fail to find the
appropriate threshold (which look for a feature in an increasingly smoothed
histogram for the first two cases, or a convergence to a single value in the
third case).
That situation depends on the type of histogram the image has.

Looking at the source code, the IsoData algorithm under certain conditions
could fail to find a threshold.

Hope it helps,

Gabriel

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: About automatic thresholding program implemented in ImageJ

Takamasa Kitaoji
Thank you.
I will be careful to focus on the grayscale histogram of the original image
in case of errors.

2021年3月31日(水) 21:46 Gabriel Landini <[hidden email]>:

> On Wednesday, 31 March 2021 12:48:19 BST [hidden email] wrote:
> > I would like to ask an additional question in relation to Q3.
> > In my experience, errors sometimes occurred when the three
> > methods(Intermodes, MinError, and Minimum) were applied, but not when the
> > other methods were applied.
> > Is it the same reason as the MinError method that errors also
> occasionally
> > occur when Intermodes or Minimum method is used?
> >
> Hi,
> Yes the Minimum, Intermodes and MinErr methods can fail to find the
> appropriate threshold (which look for a feature in an increasingly
> smoothed
> histogram for the first two cases, or a convergence to a single value in
> the
> third case).
> That situation depends on the type of histogram the image has.
>
> Looking at the source code, the IsoData algorithm under certain conditions
> could fail to find a threshold.
>
> Hope it helps,
>
> Gabriel
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>


--
-----------------------------------------------------------------------------
北大路 隆正
京都府立医科大学 神経内科学
〒602-0841 京都市上京区河原町通広小路上る梶井町465
TELL: 075-251-5111
e-mail: [hidden email]
-----------------------------------------------------------------------------

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