Fourier Based Method For Simultaneous Segmentation And Nonlinear Registration