BUG: fixed variable declaration before referencing
BUG: fixed variable declaration before referencing

Former-commit-id: e1c15e901ee6f7bbeb7f10e7b91849d58070b380 [formerly 02a8425c0c18b5ad6cc1192439ef3241d8428a58]
Former-commit-id: 75659ebc5b2423ffb058146038ce43879c32d386
Former-commit-id: b1411a4f5c34c0a3eb82d8545d10fc51486e7261
neuropoly/spinalcordtoolbox,neuropoly/spinalcordtoolbox,neuropoly/spinalcordtoolbox,neuropoly/spinalcordtoolbox,neuropoly/spinalcordtoolbox,neuropoly/spinalcordtoolbox,neuropoly/spinalcordtoolbox