Atlas based liver segmentation using nonrigid registration