Exemplo n.º 1
0
 def test_3dto4d(self):
     options = tu.set_experiment("tomo_3dto4d")
     # plugin = 'savu.plugins.corrections.i12_dark_flat_field_correction'
     plugin = "savu.plugins.filters.no_process_plugin"
     data_dict = {"in_datasets": ["tomo"], "out_datasets": ["test"]}
     all_dicts = [self.get_loader_dict(), data_dict, {}]
     exp = run_protected_plugin_runner_no_process_list(options, plugin, data=all_dicts)
     self.assertEqual(exp.index["in_data"]["test"].get_shape(), (181, 10, 192, 4))
Exemplo n.º 2
0
 def test_tomo1(self):
     options = tu.set_experiment('tomo')
     plugin = 'savu.plugins.basic_operations.basic_operations'
     data_dict = {'in_datasets': ['tomo', 'tomo'], 'out_datasets': ['test'],
                  'operations': ['tomo + tomo'],  'pattern': 'PROJECTION'}
     saver_dict = {}
     all_dicts = [{}, data_dict, saver_dict]
     run_protected_plugin_runner_no_process_list(options, plugin,
                                                 data=all_dicts)
Exemplo n.º 3
0
 def test_tomo1(self):
     options = tu.set_experiment('tomo')
     plugin = 'savu.plugins.test_plugin'
     loader_dict = {}
     data_dict = {'in_datasets': ['tomo', 'tomo'], 'out_datasets': ['test']}
     saver_dict = {}
     all_dicts = [loader_dict, data_dict, saver_dict]
     run_protected_plugin_runner_no_process_list(options, plugin,
                                                 data=all_dicts)
Exemplo n.º 4
0
 def test_i12tomo(self):
     options = tu.set_experiment('i12tomo')
     plugin = 'savu.plugins.corrections.i12_dark_flat_field_correction'
     data_dict = {'in_datasets': ['tomo'], 'out_datasets': ['test']}
     all_dicts = [self.get_loader_dict(), data_dict, {}]
     exp = run_protected_plugin_runner_no_process_list(options, plugin,
                                                       data=all_dicts)
     self.assertEqual(exp.index['in_data']['test'].get_shape(),
                      (181, 10, 192, 4))
Exemplo n.º 5
0
 def test_3dto4d_previewing1(self):
     options = tu.set_experiment("tomo_3dto4d")
     plugin = "savu.plugins.filters.no_process_plugin"
     selection = ["mid:mid+1:1:5", "0:end:1:1", "0:end:1:1", "mid:mid+1:1:1"]
     loader_dict = self.get_loader_dict()
     loader_dict["preview"] = selection
     data_dict = {"in_datasets": ["tomo"], "out_datasets": ["test"]}
     all_dicts = [loader_dict, data_dict, {}]
     exp = run_protected_plugin_runner_no_process_list(options, plugin, data=all_dicts)
     self.assertEqual(exp.index["in_data"]["test"].get_shape(), (5, 10, 192, 1))
Exemplo n.º 6
0
 def test_i12tomo(self):
     options = tu.set_experiment('i12tomo')
     plugin = 'savu.plugins.corrections.i12_dark_flat_field_correction'
     data_dict = {'in_datasets': ['tomo'], 'out_datasets': ['test']}
     all_dicts = [self.get_loader_dict(), data_dict, {}]
     exp = run_protected_plugin_runner_no_process_list(options,
                                                       plugin,
                                                       data=all_dicts)
     self.assertEqual(exp.index['in_data']['test'].get_shape(),
                      (181, 10, 192, 4))
Exemplo n.º 7
0
    def test_create_smaller_data_block(self):
        options = tu.set_experiment('tomo')
        plugin = 'savu.plugins.reshape.downsample_filter'
        tu.set_plugin_list(options, plugin)

        out_data_name = options['plugin_list'][1]['data']['out_datasets'][0]
        plugin_runner = PluginRunner(options)
        exp = plugin_runner._run_plugin_list()

        self.assertEqual(exp.index['in_data'][out_data_name].get_shape(),
                         (91, 68, 80))
Exemplo n.º 8
0
    def framework_options_setup(self):
        key1 = 'reconstruction_type'
        key2 = 'number_of_iterations'
        key3 = 'in_datasets'
        key4 = 'out_datasets'
        params = {key1: 'FBP;CGLS', key2: '1;2;3', key3: 'tomo', key4: 'tomo'}

        options = tu.set_experiment('tomo')
        plugin = 'savu.plugins.reconstructions.astra_recons.astra_recon_cpu'
        tu.set_plugin_list(options, plugin, [{}, params, {}])
        return options
    def framework_options_setup(self):
        key1 = 'reconstruction_type'
        key2 = 'number_of_iterations'
        key3 = 'in_datasets'
        key4 = 'out_datasets'
        params = {key1: 'FBP;CGLS', key2: '1;2;3', key3: 'tomo', key4: 'tomo'}

        options = tu.set_experiment('tomo')
        plugin = 'savu.plugins.reconstructions.astra_recons.astra_recon_cpu'
        tu.set_plugin_list(options, plugin, [{}, params, {}])
        return options
Exemplo n.º 10
0
    def test_create_smaller_data_block(self):
        options = tu.set_experiment('tomo')
        plugin = 'savu.plugins.reshape.downsample_filter'
        tu.set_plugin_list(options, plugin)

        out_data_name = options['plugin_list'][1]['data']['out_datasets'][0]
        plugin_runner = PluginRunner(options)
        exp = plugin_runner._run_plugin_list()

        self.assertEqual(exp.index['in_data'][out_data_name].get_shape(),
                         (91, 68, 80))
Exemplo n.º 11
0
 def test_tomo4(self):
     options = tu.set_experiment('tomo')
     plugin = 'savu.plugins.test_plugin'
     preview = ['10:-10:10:1', '10:-10:10:1', '10:-10:10:1']
     loader_dict = {'preview': preview}
     data_dict = {'in_datasets': ['tomo', 'tomo'], 'out_datasets': ['test']}
     all_dicts = [loader_dict, data_dict, {}]
     exp = run_protected_plugin_runner_no_process_list(options, plugin,
                                                       data=all_dicts)
     exp = self.assertEqual(exp.index['in_data']['test'].get_shape(),
                           (8, 12, 15))
Exemplo n.º 12
0
 def create_chunking_instance(self, current_list, nnext_list, nProcs):
     current = self.create_pattern('a', current_list)
     nnext = self.create_pattern('b', nnext_list)
     options = tu.set_experiment('tomoRaw')
     options['processes'] = range(nProcs)
     # set a dummy process list
     options['process_file'] = \
         tu.get_test_process_path('basic_tomo_process.nxs')
     exp = Experiment(options)
     test_dict = {'current': current, 'next': nnext}
     chunking = Chunking(exp, test_dict)
     return chunking
Exemplo n.º 13
0
 def test_tomo4(self):
     options = tu.set_experiment('tomo')
     plugin = 'savu.plugins.basic_operations.basic_operations'
     preview = ['10:-10:10:1', '10:-10:10:1', '10:-10:10:1']
     loader_dict = {'preview': preview}
     data_dict = {'in_datasets': ['tomo', 'tomo'], 'out_datasets': ['test'],
                  'operations': ['tomo + tomo'],  'pattern': 'PROJECTION'}
     all_dicts = [loader_dict, data_dict, {}]
     exp = run_protected_plugin_runner_no_process_list(options, plugin,
                                                       data=all_dicts)
     exp = self.assertEqual(exp.index['in_data']['test'].get_shape(),
                            (8, 12, 15))
 def test_tomo3(self):
     options = tu.set_experiment('tomo')
     plugin = 'savu.plugins.basic_operations.basic_operations'
     preview = ['10:-1:10:1', '10:-1:10:1', '10:-1:10:1']
     loader_dict = {'preview': preview}
     data_dict = {'in_datasets': ['tomo', 'tomo'], 'out_datasets': ['test'],
                  'operations': ['tomo + tomo'],  'pattern': 'PROJECTION'}
     all_dicts = [loader_dict, data_dict, {}]
     exp = run_protected_plugin_runner_no_process_list(options, plugin,
                                                       data=all_dicts)
     exp = self.assertEqual(exp.index['in_data']['test'].get_shape(),
                            (9, 13, 15))
Exemplo n.º 15
0
    def framework_options_setup(self):
        key1 = "preview"
        key2 = "FBP_filter"
        key3 = "center_of_rotation"
        key4 = "in_datasets"
        key5 = "out_datasets"
        params = {key1: [":", "0", ":"], key2: "ram-lak;hamming", key3: "85.0;85.5;86.0", key4: "tomo", key5: "tomo"}

        options = tu.set_experiment("tomo")
        plugin = "savu.plugins.reconstructions.astra_recons.astra_recon_cpu"
        tu.set_plugin_list(options, plugin, [{}, params, {}])
        return options
Exemplo n.º 16
0
 def create_chunking_instance(self, current_list, nnext_list, nProcs):
     current = self.create_pattern('a', current_list)
     nnext = self.create_pattern('b', nnext_list)
     options = tu.set_experiment('tomoRaw')
     options['processes'] = range(nProcs)
     # set a dummy process list
     options['process_file'] = \
         tu.get_test_process_path('basic_tomo_process.nxs')
     exp = Experiment(options)
     test_dict = {'current': current, 'next': nnext}
     chunking = Chunking(exp, test_dict)
     return chunking
Exemplo n.º 17
0
    def framework_options_setup(self):
        key1 = 'interpolation'
        key2 = 'iterations'
        key3 = 'in_datasets'
        key4 = 'out_datasets'
        key5 = 'sino_pad_width'
        params = {key1: 'nearest;linear', key2: '1;2;3', key3: 'tomo',
                  key4: 'tomo', key5: 0}

        options = tu.set_experiment('tomo')
        plugin = 'savu.plugins.reconstructions.scikitimage_sart'
        tu.set_plugin_list(options, plugin, [{}, params, {}])
        return options
Exemplo n.º 18
0
 def test_3dto4d_previewing1(self):
     options = tu.set_experiment('tomo_3dto4d')
     plugin = 'savu.plugins.filters.no_process_plugin'
     selection = \
         ['mid:mid+1:1:5', '0:end:1:1', '0:end:1:1', 'mid:mid+1:1:1']
     loader_dict = self.get_loader_dict()
     loader_dict['preview'] = selection
     data_dict = {'in_datasets': ['tomo'], 'out_datasets': ['test']}
     all_dicts = [loader_dict, data_dict, {}]
     exp = run_protected_plugin_runner_no_process_list(options,
                                                       plugin,
                                                       data=all_dicts)
     self.assertEqual(exp.index['in_data']['test'].get_shape(),
                      (5, 10, 192, 1))
    def framework_options_setup(self):
        key1 = 'preview'
        key2 = 'projector'
        key3 = 'centre_of_rotation'
        key4 = 'in_datasets'
        key5 = 'out_datasets'
        key6 = 'force_zero'
        params = {key1: [':', '0', ':'], key2: 'line;strip',
                  key3: '85.0;85.5;86.0', key4: 'tomo', key5: 'tomo',
                  key6: '[None, None]'}

        options = tu.set_experiment('tomo')
        plugin = 'savu.plugins.reconstructions.astra_recons.astra_recon_cpu'
        tu.set_plugin_list(options, plugin, [{}, params, {}])
        return options
Exemplo n.º 20
0
    def framework_options_setup(self):
        key1 = 'n_iterations'
        key2 = 'algorithm'
        key3 = 'in_datasets'
        key4 = 'out_datasets'
        params = OrderedDict({
            key1: '1;2;3',
            key2: 'FBP;CGLS',
            key3: 'tomo',
            key4: 'tomo'
        })

        options = tu.set_experiment('tomo')
        plugin = 'savu.plugins.reconstructions.astra_recons.astra_recon_cpu'
        tu.set_plugin_list(options, plugin, [{}, params, {}])
        return options
Exemplo n.º 21
0
    def test_reload(self):
        process_list = 'loaders/savu_nexus_loader_test1.nxs'
        options1 = tu.initialise_options(data_file, experiment, process_list)
        run_protected_plugin_runner(options1)

        #read the output file using SavuNexusLoader
        path_to_rec = options1['out_path'] + 'test_processed.nxs'
        self.test_folder2 = tempfile.mkdtemp(suffix='my_test2/')
        options2 = tu.set_experiment('tomo')
        options2['data_file'] = path_to_rec
        options2['out_path'] = os.path.join(self.test_folder2)
        options2['process_file'] = tu.get_test_process_path(
            'loaders/savu_nexus_loader_test2.nxs')
        run_protected_plugin_runner(options2)

        tu.cleanup(options1)
        tu.cleanup(options2)
Exemplo n.º 22
0
    def framework_options_setup(self):
        key1 = 'interpolation'
        key2 = 'iterations'
        key3 = 'in_datasets'
        key4 = 'out_datasets'
        key5 = 'sino_pad_width'
        params = {
            key1: 'nearest;linear',
            key2: '1;2;3',
            key3: 'tomo',
            key4: 'tomo',
            key5: 0
        }

        options = tu.set_experiment('tomo')
        plugin = 'savu.plugins.reconstructions.scikitimage_sart'
        tu.set_plugin_list(options, plugin, [{}, params, {}])
        return options
Exemplo n.º 23
0
    def framework_options_setup(self):
        key1 = 'preview'
        key2 = 'FBP_filter'
        key3 = 'center_of_rotation'
        key4 = 'in_datasets'
        key5 = 'out_datasets'
        params = {
            key1: [':', '0', ':'],
            key2: 'ram-lak;hamming',
            key3: '85.0;85.5;86.0',
            key4: 'tomo',
            key5: 'tomo'
        }

        options = tu.set_experiment('tomo')
        plugin = 'savu.plugins.reconstructions.astra_recons.astra_recon_cpu'
        tu.set_plugin_list(options, plugin, [{}, params, {}])
        return options
Exemplo n.º 24
0
    def framework_options_setup(self):
        key1 = 'preview'
        key2 = 'projector'
        key3 = 'centre_of_rotation'
        key4 = 'in_datasets'
        key5 = 'out_datasets'
        key6 = 'force_zero'
        params = {
            key1: [':', '0', ':'],
            key2: 'line;strip',
            key3: '85.0;85.5;86.0',
            key4: 'tomo',
            key5: 'tomo',
            key6: '[None, None]'
        }

        options = tu.set_experiment('tomo')
        plugin = 'savu.plugins.reconstructions.astra_recons.astra_recon_cpu'
        tu.set_plugin_list(options, plugin, [{}, params, {}])
        return options
Exemplo n.º 25
0
 def test_simple_recon(self):
     options = tu.set_experiment('tomo')
     plugin = 'savu.plugins.reconstructions.simple_recon'
     run_protected_plugin_runner_no_process_list(options, plugin)
Exemplo n.º 26
0
 def test_cgls_recon(self):
     options = tu.set_experiment("tomo")
     plugin = "savu.plugins.reconstructions.cgls_recon"
     run_protected_plugin_runner_no_process_list(options, plugin)
Exemplo n.º 27
0
 def test_median_filter(self):
     options = tu.set_experiment('tomo')
     plugin = 'savu.plugins.filters.median_filter'
     run_protected_plugin_runner_no_process_list(options, plugin)
Exemplo n.º 28
0
 def test_astra_recon_cpu_stxm(self):
     options = tu.set_experiment('tomo')
     plugin = 'savu.plugins.reconstructions.astra_recons.astra_recon_cpu'
     run_protected_plugin_runner_no_process_list(options, plugin)
Exemplo n.º 29
0
 def rest_ring_artefact_removal(self):
     options = tu.set_experiment('tomo')
     plugin = 'savu.plugins.filters.ring_artefact_removal'
     run_protected_plugin_runner_no_process_list(options, plugin)
Exemplo n.º 30
0
 def test_downsample_correction(self):
     options = tu.set_experiment('tomo')
     plugin = 'savu.plugins.filters.downsample_filter'
     run_protected_plugin_runner_no_process_list(options, plugin)
Exemplo n.º 31
0
 def test_denoise_bregman_test(self):
     options = tu.set_experiment('tomo')
     plugin = 'savu.plugins.filters.denoising.denoise_bregman_filter'
     run_protected_plugin_runner_no_process_list(options, plugin)
Exemplo n.º 32
0
 def test_simple_recon(self):
     options = tu.set_experiment('tomo')
     plugin = 'savu.plugins.reconstructions.simple_recon'
     run_protected_plugin_runner_no_process_list(options, plugin)
Exemplo n.º 33
0
 def test_astra_recon_cpu_stxm(self):
     options = tu.set_experiment('tomo')
     plugin = 'savu.plugins.reconstructions.astra_recons.astra_recon_cpu'
     run_protected_plugin_runner_no_process_list(options, plugin)
Exemplo n.º 34
0
 def test_band_pass(self):
     options = tu.set_experiment('tomo')
     plugin = 'savu.plugins.filters.band_pass'
     run_protected_plugin_runner_no_process_list(options, plugin)
Exemplo n.º 35
0
 def test_astra_recon_gpu(self):
     options = tu.set_experiment('tomo', process_names='GPU0')
     plugin = astra_recons.__name__ + '.astra_recon_gpu'
     run_protected_plugin_runner_no_process_list(options, plugin)
Exemplo n.º 36
0
 def test_band_pass(self):
     options = tu.set_experiment('tomo')
     plugin = 'savu.plugins.filters.band_pass'
     run_protected_plugin_runner_no_process_list(options, plugin)
Exemplo n.º 37
0
 def test_downsample_correction(self):
     options = tu.set_experiment('tomo')
     plugin = 'savu.plugins.filters.downsample_filter'
     run_protected_plugin_runner_no_process_list(options, plugin)
Exemplo n.º 38
0
 def test_dezing_filter(self):
     options = tu.set_experiment('tomoRaw')
     plugin = 'savu.plugins.filters.dezinger_simple'
     run_protected_plugin_runner_no_process_list(options, plugin)
 def test_basic_operations(self):
     process_file = tu.get_test_process_path('basic_operations_test.nxs')
     options = tu.set_experiment('tomo')
     options['process_file'] = process_file
     run_protected_plugin_runner(options)
Exemplo n.º 40
0
 def test_sinogram_alignment(self):
     options = tu.set_experiment('tomo')
     plugin = 'savu.plugins.filters.sinogram_alignment'
     run_protected_plugin_runner_no_process_list(options, plugin)
Exemplo n.º 41
0
 def test_basic_operations(self):
     process_file = tu.get_test_process_path('basic_operations_test.nxs')
     options = tu.set_experiment('tomo')
     options['process_file'] = process_file
     run_protected_plugin_runner(options)
Exemplo n.º 42
0
 def test_sinogram_alignment(self):
     options = tu.set_experiment('tomo')
     plugin = 'savu.plugins.filters.sinogram_alignment'
     run_protected_plugin_runner_no_process_list(options, plugin)
Exemplo n.º 43
0
 def rest_ring_artefact_removal(self):
     options = tu.set_experiment('tomo')
     plugin = 'savu.plugins.filters.ring_artefact_removal'
     run_protected_plugin_runner_no_process_list(options, plugin)
Exemplo n.º 44
0
 def test_paganin1(self):
     options = tu.set_experiment('tomoRaw')
     plugin = 'savu.plugins.paganin_filter'
     run_protected_plugin_runner_no_process_list(options, plugin)
Exemplo n.º 45
0
 def test_median_filter(self):
     options = tu.set_experiment('tomo')
     plugin = 'savu.plugins.filters.median_filter'
     run_protected_plugin_runner_no_process_list(options, plugin)
Exemplo n.º 46
0
 def test_denoise_bregman_test(self):
     options = tu.set_experiment('tomo')
     plugin = 'savu.plugins.filters.denoise_bregman_filter'
     run_protected_plugin_runner_no_process_list(options, plugin)
 def "r6"(self):
     options = tu.set_experiment("r7")
     plugin = "r8"
     run_protected_plugin_runner_no_process_list(options, plugin)
Exemplo n.º 48
0
 def test_dezing_filter(self):
     options = tu.set_experiment('tomoRaw')
     plugin = 'savu.plugins.filters.dezinger_simple'
     run_protected_plugin_runner_no_process_list(options, plugin)
Exemplo n.º 49
0
 def test_astra_recon_gpu(self):
     options = tu.set_experiment('tomo', process_names='GPU0')
     plugin = astra_recons.__name__ + '.astra_recon_gpu'
     run_protected_plugin_runner_no_process_list(options, plugin)
Exemplo n.º 50
0
 def test_astra_recon_cpu_stxm(self):
     options = tu.set_experiment("tomo")
     plugin = astra_recons.__name__ + ".astra_recon_cpu"
     run_protected_plugin_runner_no_process_list(options, plugin)