print(db.empty_slice(1).shape) print(db.empty_block(1).shape) #print(db.block_xyz()) print(db.get_slice(1).shape) blo0 = db.empty_block() for blo in db: blo0 += numpy.log(blo + 1) del blo0 #%% Test IO import tomobox proj = tomobox.projections() # Work: #proj.io.read_flexray('/export/scratch3/kostenko/Fast_Data/rijksmuseum/tiling/al_dummy_vertical_tile_0') # Home: proj.io.read_flexray('D:/Data/al_dummy_vertical_tile_1') proj.display.slice() proj.display.projection() #%% Test process proj.process.flat_field() proj.process.log() proj.process.residual_rings() proj.process.salt_pepper()
# -*- coding: utf-8 -*- """ Test of the reconstructor. """ #%% Test IO import tomobox a = tomobox.projections(block_sizeGB = 1, swap = False) a.io.read_flexray('/export/scratch3/kostenko/Fast_Data/rijksmuseum/tiling/al_dummy_vertical_tile_0/') a.process.flat_field() a.process.log() a.display.slice(dim = 1) b = tomobox.projections(block_sizeGB = 1, swap = False) b.io.read_flexray('/export/scratch3/kostenko/Fast_Data/rijksmuseum/tiling/al_dummy_vertical_tile_1/') b.process.flat_field() b.process.log() b.display.slice(dim = 1) b.data.switch_to_swap(keep_data=True, swap_path = '/export/scratch3/kostenko/Fast_Data/swap', swap_name = 'swap_0') b.data.switch_to_swap(keep_data=True, swap_path = '/export/scratch3/kostenko/Fast_Data/swap', swap_name = 'swap_1') #%% QC: a.meta.geometry.report() b.meta.geometry.report()
""" #%% Test IO import tomobox import reconstruction import simulate #%% Create aphantom: #phantom = simulate.phantom.shepp3d([10, 256, 256]) phantom = simulate.phantom.checkers([10, 256, 256]) vol = tomobox.volume(array=phantom, img_pixel=[0.1, 0.1, 0.1], block_sizeGB=3) vol.display.slice() #%% Forward project: proj = tomobox.projections(block_sizeGB=3) proj.data.zeros([20, 100, 256]) proj.meta.geometry.init(100, 100, [0.1, 0.1], theta_n=100) recon = reconstruction.reconstruct(proj, vol) recon.forwardproject() proj.display.slice() #%% Test Back-projector: vol.data.zeros() #recon._projections_to_swap() recon.backproject(multiplier=1) vol.display.slice()
# -*- coding: utf-8 -*- """ Test of the reconstructor. No swap. Use """ #%% Test IO %pylab import tomobox import reconstruction # On weld scratch1 seems to be the ssd drive prj = tomobox.projections(block_sizeGB = 4, swap = False) #%% Read and process: bine = 1 prj.io.options['binning'] = bine prj.io.options['index_step'] = 1 prj.io.read_flexray('/export/scratch3/kostenko/Fast_Data/naturalis/oct2017_femora_trinil/whale_ear_1/') # Process: prj.process.flat_field() prj.process.log() prj.display.slice(dim = 1) #energy, spec = numpy.loadtxt('/export/scratch3/kostenko/Fast_Data/rijksmuseum/dummy/spectrum.txt') #prj.process.equivalent_thickness(energy, spec, 'Bone, Compact (ICRU)', 1.6) prj.meta.geometry.report()