this function should have a specific test with small nifti images.