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 to {φ 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); 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; and minimizing said second energy functional to determine said registration mapping, wherein said registration mapping recovers local deformations of said liver.