An automatic threshold selection method is proposed for biomedical image analysis based on a histogram coding scheme. The threshold values can be determined based on the well-known Lloyd–Max scalar quantization rule, which is optimal in the sense of achieving minimum mean-square-error distortion. An iterative self-organizing learning rule is derived to determine the threshold levels. The rule does not require any prior information about the histogram, hence is fully automatic. Experimental results show that this new approach is easy to implement yet is highly efficient, robust with respect to noise, and yields reliable estimates of the threshold levels.