Mercurial > repos > rv43 > tomo
changeset 17:7f723407beb3 draft
"planemo upload for repository https://github.com/rolfverberg/galaxytools commit d1744188635274aa3d0bb0e10fcb683602a23b59"
author | rv43 |
---|---|
date | Fri, 15 Apr 2022 20:26:25 +0000 |
parents | 44f168e1e14f |
children | b0a816c8f66c |
files | tomo.py tomo_reconstruct.py |
diffstat | 2 files changed, 11 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/tomo.py Wed Apr 13 16:05:50 2022 +0000 +++ b/tomo.py Fri Apr 15 20:26:25 2022 +0000 @@ -1877,6 +1877,7 @@ def reconstructTomoStacks(self, galaxy_param=None, num_core=None): """Reconstruct tomography stacks. """ + print('OK1') if num_core is None: num_core = self.num_core logging.debug('Reconstruct tomography stacks') @@ -1884,6 +1885,7 @@ assert(len(self.tomo_stacks) == self.config['stack_info']['num']) assert(len(self.tomo_stacks) == len(stacks)) assert(len(self.tomo_recon_stacks) == len(stacks)) + print('OK2') if self.galaxy_flag: assert(isinstance(galaxy_param, dict)) # Get rotation axis centers @@ -1899,6 +1901,7 @@ galaxy_param = None lower_center_offset = None upper_center_offset = None + print('OK3') # Get rotation axis rows and centers find_center = self.config['find_center'] @@ -1925,6 +1928,7 @@ center_slope = (upper_center_offset-lower_center_offset)/(upper_row-lower_row) # Set thetas (in radians) + print('OK4') theta_range = self.config['theta_range'] theta_start = theta_range['start'] theta_end = theta_range['end'] @@ -1933,6 +1937,7 @@ thetas = np.radians(np.linspace(theta_start, theta_end, int(num_theta/(num_theta_skip+1)), endpoint=False)) + print('OK5') # Reconstruct tomo stacks zoom_perc = self.config['preprocess'].get('zoom_perc', 100) if zoom_perc == 100: @@ -1960,6 +1965,7 @@ if not self.tomo_stacks[i].size: self.tomo_stacks[i], available = self._loadTomo('red stack', index, required=True) + print(f'self.tomo_stacks.shape = {self.tomo_stacks[i].shape}') if not self.tomo_stacks[i].size: logging.error(f'Unable to load tomography stack {index} for reconstruction') stack[i]['preprocessed'] = False @@ -1989,6 +1995,7 @@ # np.savetxt(self.output_folder+f'recon_stack_{index}.txt', # self.tomo_recon_stacks[i][row_slice,:,:], fmt='%.6e') self.tomo_stacks[i] = np.array([]) + print('OK6') # Update config and save to file stack['reconstructed'] = True @@ -1997,6 +2004,7 @@ combine_stacks['stacks'].remove(index) self.cf.saveFile(self.config_out) + print('OK7') # Save reconstructed tomography stack to file if self.galaxy_flag: t0 = time()
--- a/tomo_reconstruct.py Wed Apr 13 16:05:50 2022 +0000 +++ b/tomo_reconstruct.py Fri Apr 15 20:26:25 2022 +0000 @@ -61,7 +61,10 @@ # Reconstruct tomography stacks galaxy_param = {'center_offsets' : args.center_offsets, 'output_name' : args.output_data} + print(f'Here galaxy_param = {galaxy_param}') + logging.info(f'galaxy_param = {galaxy_param}') tomo.reconstructTomoStacks(galaxy_param) + print('Here') # Displaying memory usage logging.info(f'Memory usage: {tracemalloc.get_traced_memory()}')