Lung segmentation in chest radiographs using anatomical atlases with nonrigid registration