moved downsampling into registration functions