To facilitate hepatic surgical planning, we have developed a new system for the automatic 3D delineation of anatomical and pathological hepatic structures from a spiral CT scan. This system also extracts functional information useful for surgery planning, such as portal vein labeling and anatomical segment delineation following the conventional Couinaud definition. From a 2 mm thick enhanced spiral CT scan, a first stage automatically delineates the skin, bones, lungs and kidneys, by combining the use of thresholding, mathematical morphological methods and distance maps. Next, a reference 3D model is immerged in the image and automatically deformed to the liver contour. Then an automatic Gaussians fitting on the imaging histogram allows to threshold the intensities of parenchyma, vessels and lesions. The next stage improves this first classification by an original topological and geometrical analysis, providing an automatic and precise delineation of lesions and veins. Finally, a topological and geometrical analysis based on medical knowledge provides the hepatic functional information invisible in medical imaging: portal vein labeling and hepatic anatomical segments. Clinical validation performed on more than 30 patients shows that this method allows a delineation of anatomical structures, often more sensitive and more specific than manual delineation by a radiologist.