ENH: Factor out PreProcessRegistrationInputs.

From RegisterImageToTubesUsingRigidTransform into its own function to avoid
future duplication of code.