OPT: adapted crop_from_square_mask for 2D images
OPT: adapted crop_from_square_mask for 2D images

Former-commit-id: 43aa6b0cbbd591c4e1bbabd510579d92514ebb0e [formerly 53b3b86026458c29ed41cb1db0a09da9479a7e27]
Former-commit-id: 62eac3009c256105131be01d301677a3f036e14c
Former-commit-id: 7507bff6226a2fc8ac19bbf779a0e2420afcb2e7
neuropoly/spinalcordtoolbox,neuropoly/spinalcordtoolbox,neuropoly/spinalcordtoolbox,neuropoly/spinalcordtoolbox,neuropoly/spinalcordtoolbox,neuropoly/spinalcordtoolbox,neuropoly/spinalcordtoolbox