1. A method for automatically segmenting a liver in digital medical images, comprising the steps of: providing a 3-dimensional (3D) digital image I to be segmented, said image comprising a plurality of intensities associated with a 3D grid of points; providing a set of N training shapes {φ i } i=1,. .. , N for a liver trained from a set of manually segmented images; selecting a seed point to initialize said segmentation; representing a level set function φ α (θx+h) of a liver boundary Γ in said image as ϕ α ⁡ ( x ) = ϕ 0 + ∑ i = 1 n ⁢ α i ⁢ V i ⁡ ( x ) , wherein ⁢ ⁢ ϕ 0 ⁡ ( x ) = 1 N ⁢ ∑ i = 1 N ⁢ ϕ i ⁡ ( x ) is a mean shape, {V i (x)} i=1,. .. , n are eigenmodes wherein n<N, α i are shape parameters corresponding to each training shape φ i , and h ε R 3 and θ ε [0,2π] 3 are translation and rotation parameters that align said training shapes; defining a first energy functional in terms of said level set functions φ α (θx+h), wherein said first energy functional is E ⁡ ( α , h , θ ) = - ∫ Ω ⁢ ( H ⁢ ( ϕ α ⁡ ( θ ⁢ ⁢ x + h ) ) ⁢ log ⁢ ⁢ p i ⁢ ⁢ n ⁢ ⁢ ( I ⁡ ( x ) ) + ( 1 + H ⁡ ( ϕα ⁡ ( θ ⁢ ⁢ x + h ) ) ) ⁢ log ⁢ ⁢ p out ⁡ ( I ⁡ ( x ) ) ) ⁢ ⅆ x - log ( 1 2 ⁢ ⁢ π ⁢ N ⁢ ⁢ σ ⁢ ∑ i = 1 N ⁢ exp ( - ( α - α i ) 2 2 ⁢ ⁢ σ 2 ) ) wherein H is a Heaviside function whose value is 1 inside said boundary and 0 otherwise, the log term is a shape prior distribution with standard deviation σ, and p in , p out are image intensity histogram functions inside and outside said boundary, respectively; minimizing said first energy functional to determine said shape, translation, and rotation parameters, wherein said shape, translation, and rotation parameters determine a shape template for said liver segmentation; defining a second energy functional of said shape template and a registration mapping weighted by image intensity histogram functions inside and outside said boundary; minimizing said second energy functional to determine said registration mapping, wherein said registration mapping recovers local deformations of said liver; and setting σ to twice an average Euclidean distance between each training shape and its closet neighbor in a subspace with dimension n.