sct_maths: Check -dim for -erode/-dilate (#2740)
sct_maths: Check -dim for -erode/-dilate (#2740)

Adds a parsing check to require -dim flag on morphological operations 
with 2D kernels, which avoids crashing the respective functions
neuropoly/spinalcordtoolbox,neuropoly/spinalcordtoolbox,neuropoly/spinalcordtoolbox,neuropoly/spinalcordtoolbox,neuropoly/spinalcordtoolbox,neuropoly/spinalcordtoolbox,neuropoly/spinalcordtoolbox