REF: cleaner code for preprocessing
REF: cleaner code for preprocessing

Former-commit-id: d68e727a1af2b66ccfe7092ec166183c6f143811
Former-commit-id: 26ad6e6008a8391e24f9bd1081d9e84612d9df4c
3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox