def correct_wmseg(res_gmseg, original_im, name_wm_seg, hdr):
    '''
    correct WM seg edges using input SC seg
    *** NOT USED ANYMORE***
    '''
    wmseg_dat = (0 > original_im.data).astype(int) - res_gmseg.data

    # corrected_wm_seg = Image(param=(wmseg_dat > 0).astype(int))
    corrected_wm_seg = Image(param=wmseg_dat)

    corrected_wm_seg.file_name = name_wm_seg + '_corrected'
    corrected_wm_seg.ext = '.nii.gz'
    corrected_wm_seg.hdr = hdr
    corrected_wm_seg.save()

    # sct.run('fslmaths ' + corrected_wm_seg.file_name + '.nii.gz -thr 0 ' + corrected_wm_seg.file_name + '.nii.gz')
    sct.run('sct_maths -i ' + corrected_wm_seg.file_name + '.nii.gz -thr 0 -o ' + corrected_wm_seg.file_name + '.nii.gz')

    return corrected_wm_seg


########################################################################################################################
# ----------------------------------------------- OTHER UTILS FUNCTIONS ---------------------------------------------- #
########################################################################################################################

# ------------------------------------------------------------------------------------------------------------------
dataset/ETHPy150Open neuropoly/spinalcordtoolbox/scripts/msct_gmseg_utils.py/correct_wmseg/swapped operands of `>`