1. A method of segmenting a digitized image using a computer system comprising the steps of: providing a digitized image comprising a plurality of intensities corresponding to a domain of nodes on an N-dimensional grid; generating prior probabilities for a set of segments by defining a set of training nodes and estimating said prior probability density from a set of training images, wherein the prior probability λ i s that a node v i is generated from a distribution corresponding to a segment g s is generated through λ i s = 1 Z s ⁢ ∑ q = g s ⁢ exp ⁡ ( ( I i - t q ) 2 σ ) , wherein the sum is over all segments, σ is a free parameter, I i is the intensity of node v i , t q is the intensity of training node labeled by q, Z s is a normalizing constant for segment g s equal to Z s = ∑ p = 0 255 ⁢ ∑ q = g s ⁢ exp ⁡ ( ( p - t q ) 2 σ ) , wherein the sum over p is over all intensity levels, and initializing probabilities that each node belongs to each segment; defining a weight between each pair of adjacent nodes in the image based on the intensity difference of each said node pair; formulating a set of equations that minimize an energy functional of the probabilities and weights, and solving said set of equations using the computer system for the probability that each node belongs to each segment.