OPT: optimized the function for a larger panel of label files and corrected some approximation
OPT: optimized the function for a larger panel of label files and corrected some approximation

Former-commit-id: b392c3c3cfd0ab43359e06a5ec435d0a060135ab
Former-commit-id: ed818c02d275d3fd757f1c1af489e2dc5164815d
3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox