def main():
    
    contrast = 'T1'
    label = label_class(contrast)
    
    try:
        opts, args = getopt.getopt(sys.argv[1:],'hi:c:s')
    except getopt.GetoptError as err:
        print str(err)
        usage()
    for opt, arg in opts:
        if opt == '-h':
            usage()
        elif opt in ('-i'):
            label.input_anat = arg
        elif opt in ('-c'):
            label.output_labled_centerline = arg
        elif opt in ('-s'):
            label.output_labled_surface = arg

    # Display usage if a mandatory argument is not provided
    if label.input_anat == '' or label.output_labled_centerline == '':
        print '\n \n All mandatory arguments are not provided \n \n'
        usage()

    input_anat = label.input_path + label.input_anat + '.nii'
    if label.segmentation_do==1:
        input_centerline = label.output_path + label.segmentation_centerline + '.nii'
        input_surface = label.output_path + label.segmentation_surface + '.nii'
    else:
        input_centerline = label.input_path + label.input_centerline + '.nii'
        input_surface = label.input_path + label.input_surface + '.nii'

    output_centerline_vertebra = label.output_path + label.output_labled_centerline
    output_surface_vertebra = label.output_path + label.output_labled_surface
    surface_do = label.surface_do

    # check existence of input files
    sct.check_file_exist(input_anat)

    if contrast == 'T1':
        labeling_vertebrae_T1(label,input_anat,input_centerline,input_surface,output_centerline_vertebra,output_surface_vertebra,surface_do)
    else:
        labeling_vertebrae_T2(label,input_anat,input_centerline,input_surface,output_centerline_vertebra,output_surface_vertebra,surface_do)


#=======================================================================================================================
# labeling_vertebrae_T1 function
#=======================================================================================================================
dataset/ETHPy150Open neuropoly/spinalcordtoolbox/dev/vertebral_labeling/batch_labeling.py/main/original