

def main():
    tracts = get_tracts(folder_atlas)
    nb_tracts = len(tracts)
    tracts_sum = add_tracts(tracts, tracts_to_sum_index)
    save_3D_nparray_nifti(tracts_sum, 'tmp.WM_all.nii.gz', (folder_atlas + '/WMtract__00.nii.gz'))
    sct.run('fslmaths tmp.WM_all.nii.gz  -thr 0.5 -bin tmp.WM_all_bin.nii.gz')
    sct.run('fslmaths tmp.WM_all_bin.nii.gz  -kernel boxv 5x5x1 -dilM tmp.WM_all_bin_dil.nii.gz')
    sct.run(((('fslmaths tmp.WM_all_bin_dil -sub tmp.WM_all ' + folder_atlas) + '/') + file_csf))
    text_label = ((('\n' + str(nb_tracts)) + ', CSF, ') + file_csf)
    open(((folder_atlas + '/') + file_label), 'a+b').write(text_label)

dataset/ETHPy150Open neuropoly/spinalcordtoolbox/dev/atlas/create_atlas/create_masks_csf_and_gm.py main/original