Integrating temporal information with a non-rigid method of motion correction for functional magnetic resonance images