Medical image registration based on random line sampling