Esempio n. 1
0
def main():
    options = get_parser().parse_args()
    # load data
    dataset = load_standard_dataset(options.dataset)

    test_data = dataset.get_data_pairs('test', 100)
    test_data = list(test_data)[options.start:options.start + options.count]

    obs = list([item[0] for item in test_data])
    gt = list([item[1] for item in test_data])

    test_data = DataPairs(obs, gt, name='test')

    # load reconstructor
    fbp = fbp_reconstructor(options.dataset)
    tv = tvadam_reconstructor(options.dataset, name='TV')
    diptv = diptv_reconstructor(options.dataset)
    learnedgd = learnedgd_reconstructor(options.dataset, size_part=1.0)
    fbpunet = fbpunet_reconstructor(options.dataset, size_part=1.0)
    iradonmap = iradonmap_reconstructor(options.dataset, size_part=1.0)
    learnedpd = learnedpd_reconstructor(options.dataset, size_part=1.0)

    # compute and plot reconstructions
    plot_reconstructors_tests(
        [fbp, tv, diptv, iradonmap, fbpunet, learnedgd, learnedpd],
        ray_trafo=dataset.ray_trafo,
        test_data=test_data,
        save_name='{}-all-{}'.format(options.dataset, options.start),
        fig_size=(9, 6.5),
        cmap=options.cmap)
def main():
    options = get_parser().parse_args()
    # load data
    dataset = load_standard_dataset(options.dataset)
    test_data = dataset.get_data_pairs('test', 3000)

    # index = [0, 2, 68]
    index = range(options.start, options.start + options.count)
    obs = [test_data[i][0] for i in index]
    gt = [test_data[i][1] for i in index]
    test_data = DataPairs(obs, gt, name='test')

    data_size = options.size_part

    # load reconstructors
    diptv = diptv_reconstructor(options.dataset)
    learnedpd = learnedpd_reconstructor(options.dataset, data_size)
    learnedpd_dip = learnedpd_dip_reconstructor(options.dataset, data_size)

    # compute example reconstructions
    plot_reconstructors_tests([diptv, learnedpd, learnedpd_dip],
                              dataset.ray_trafo,
                              test_data,
                              save_name='{}-learnedpd-dip-{}-{}'.format(
                                  options.dataset, data_size, options.start),
                              fig_size=(9, 3),
                              cmap=options.cmap)
Esempio n. 3
0
def main():
    options = get_parser().parse_args()
    # load data
    dataset = load_standard_dataset(options.dataset, ordered=False)
    test_data = dataset.get_data_pairs('test', 1000)

    sizes = [0.0001, 0.01, 1.00]
    reconstructors = []

    for size_part in sizes:
        reconstructors.append(
            get_reconstructor(options.method,
                              dataset=options.dataset,
                              size_part=size_part,
                              pretrained=True))

    for i in range(options.start, options.count):
        obs, gt = test_data[i]
        test_data = DataPairs([obs], [gt], name='test')

        # compute and plot reconstructions
        plot_reconstructors_tests(reconstructors,
                                  dataset.ray_trafo,
                                  test_data,
                                  save_name='{}-{}-test-{}'.format(
                                      options.dataset, options.method, i),
                                  fig_size=(9, 3),
                                  cmap='bone')
Esempio n. 4
0
def main():
    options = get_parser().parse_args()
    # load data
    dataset = load_standard_dataset(options.dataset)

    test_data = dataset.get_data_pairs('test', 100)
    test_data = list(test_data)[options.start:options.start + options.count]

    obs = list([item[0] for item in test_data])
    gt = list([item[1] for item in test_data])

    test_data = DataPairs(obs, gt, name='test')

    # load reconstructor
    fbp = fbp_reconstructor(options.dataset)
    tv = tv_reconstructor(options.dataset, name='TV')
    tvadam = tvadam_reconstructor(options.dataset, name='TV-Adam')

    # compute and plot reconstructions
    plot_reconstructors_tests([fbp, tv, tvadam],
                              ray_trafo=dataset.ray_trafo,
                              test_data=test_data,
                              save_name='{}-tv-tvadam-{}'.format(
                                  options.dataset, options.start),
                              fig_size=(9, 3),
                              cmap=options.cmap)