def main():
    
    #Generated phantom with added noise
    # Extract the tracts from the atlas' folder
    tracts = get_tracts(folder_atlas)
    # Generate the phantom
    [synthetic_vol, synthetic_voln, values_synthetic_data, tracts_sum] = phantom_generation(tracts, std_noise, range_tract, true_value)
    # Save the phantom without added noise to niftii image
    save_3D_nparray_nifti(synthetic_vol, WM_phantom)
    # Save the phantom with added noise to niftii image
    save_3D_nparray_nifti(synthetic_voln, WM_phantom_noise)
    # Save the sum of the tracts to nifti image
    save_3D_nparray_nifti(tracts_sum, tracts_sum_img)
    # adjust geometry between saved images and tracts
    fname_tract = glob.glob(folder_atlas + '/*' + '.nii.gz')
    sct.run('fslcpgeom ' + fname_tract[0] + ' ' + WM_phantom)
    sct.run('fslcpgeom ' + fname_tract[0] + ' ' + WM_phantom_noise)
    sct.run('fslcpgeom ' + fname_tract[0] + ' ' + tracts_sum_img)
#=======================================================================================================================
# phantom generation
#=======================================================================================================================
dataset/ETHPy150Open neuropoly/spinalcordtoolbox/dev/atlas/validate_atlas/generate_phantom.py/main/original