Preserve the dimensionality of the warping fields
Preserve the dimensionality of the warping fields

Fix empty inverse warping field when converting the warp template file.
Also refactored the code and added a default value to the `param` parameter.

Fixes issue #1069 
3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox