REF: improved code for label removal
REF: improved code for label removal

Former-commit-id: 9cd0d753651f966934d7ae467f046a78f761242e
Former-commit-id: 127c466667b8617541850f99a48625654daaa738
3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox,3324fr/spinalcordtoolbox