Exemplo n.º 1
0
def parse_mac_to_geom(config_file):
    config = load_config(config_file)
    execute = 'castor-GATEMacToGeom'
    cmd = execute

    cmd = _append_str(cmd, '-m', config['macro_file'])
    cmd = _append_str(cmd, '-o', config['output'])

    return cmd
Exemplo n.º 2
0
def parse_root_to_castor(config_file):
    config = load_config(config_file)
    execute = 'castor-GATERootToCastor'
    cmd = execute
    c = config['input']
    if c['list'] is not None:
        cmd = _append_str(cmd, '-il', c['list'])
    elif c['file'] is not None:
        cmd = _append_str(cmd, '-i', c['file'])
    else:
        raise ValueError('No input root data file(s) for this convertion!')
    cmd = _append_str(cmd, '-o', config['output'])
    cmd = _append_str(cmd, '-m', config['macro_file'])
    cmd = _append_str(cmd, '-s', config['scanner_alias'])

    return cmd
Exemplo n.º 3
0
def parse_recon(config_file):
    config = load_config(config_file)
    execute = 'castor-recon'
    cmd = execute

    cmd = _append_str(cmd, '-df', config['datafile'])
    cmd = _append_str(cmd, '-opti', config['optimization'])

    i = config['iteration']
    iter_str = str(i['nb_iter']) + ':' + str(i['subsets'])
    cmd = _append_str(cmd, '-it', iter_str)
    cmd = _append_str(cmd, '-proj', config['projector'])

    if config['convolution'] is not None:
        c = config['convolution']
        conv_str = c['filter'] + ',' + _append_list(c['size']) + '::psf'
        cmd = _append_str(cmd, '-conv', conv_str)

    cmd = _append_str(cmd, '-dim', _append_list(config['dimension']))
    cmd = _append_str(cmd, '-vox', _append_list(config['voxel_size']))
    cmd = _append_str(cmd, '-dout', config['data_out'])
    return cmd
Exemplo n.º 4
0
def parse_listmode_to_castor(config_file):
    return load_config(config_file)
Exemplo n.º 5
0
def geo2mac(config: dict):
    from srf.external.castor.io import load_config
    make_mac(load_config(config))