Two-level method for 3D non-rigid registration - with an application to statistical atlases construction