USSR: A Unified Framework for Simultaneous Smoothing, Segmentation, and Registration of Multiple Images