def label_mapping(label):
    """Label mapping from TransUNet paper setting. It only has 9 classes, which
    are 'background', 'aorta', 'gallbladder', 'left_kidney', 'right_kidney',
    'liver', 'pancreas', 'spleen', 'stomach', respectively. Other foreground
    classes in original dataset are all set to background.

    More details could be found here: https://arxiv.org/abs/2102.04306
    """
    maped_label = np.zeros_like(label)
    maped_label[label == 8] = 1
    maped_label[label == 4] = 2
    maped_label[label == 3] = 3
    maped_label[label == 2] = 4
    maped_label[label == 6] = 5
    maped_label[label == 11] = 6
    maped_label[label == 1] = 7
    maped_label[label == 7] = 8
    return maped_label
Label mapping from TransUNet paper setting. It only has 9 classes, which
    are 'background', 'aorta', 'gallbladder', 'left_kidney', 'right_kidney',
    'liver', 'pancreas', 'spleen', 'stomach', respectively. Other foreground
    classes in original dataset are all set to background.

    More details could be found here: https://arxiv.org/abs/2102.04306
    
segmentation/tools/dataset_converters/synapse.py