MATLAB Answers


Image Segmenter app - Manual Threshold - how is calculated?

Asked by tafa
on 17 Jul 2019
Latest activity Commented on by tafa
on 17 Jul 2019
I just want to know how exactly the Image Segmenter app set the Manual Threshold method in Threshold option. When I load different dicom images after segmented area of interest it is precisely value I want to achieve. I thought when I export it to the editor I will get the code for that, but only is like: BW = IMG > 65. Is anyone know how is done or how to achieve? I attached image examples.


Sign in to comment.

1 Answer

Answer by Image Analyst
on 17 Jul 2019
 Accepted Answer

The threshold while using the "Manual Threshold" option is set by you moving the slider. If it makes a guess at the threshold to start with, it's probably by running the graythresh() function.
When you export code, it will use the threshold that you have selected because it assumes you will want to use that fixed threshold for all the rest of your images.
If you want to change the 65 to something else, you can do that in your code.
If you want your user to interactively adjust the threshold, you might look at my interactive thresholding app: in my File Exchange

  1 Comment

I figured out how it is proceed. It is simple (min+max)/2 equation. In my case after segmentation of lung area I have minimum value always as zero since the black is outisde of it (background). So basically it is only max value from the loaded image divided by 2.
Thanks anyway for the response Image Analyst! I appreciate your helpful answers.

Sign in to comment.