diff tomo.py @ 28:c7211931fc99 draft

"planemo upload for repository https://github.com/rolfverberg/galaxytools commit 99f399daf512578b317aca74314e0246faa65cec"
author rv43
date Mon, 18 Apr 2022 21:26:01 +0000
parents 9d631a5e118f
children 59c5c0b53579
line wrap: on
line diff
--- a/tomo.py	Mon Apr 18 21:18:05 2022 +0000
+++ b/tomo.py	Mon Apr 18 21:26:01 2022 +0000
@@ -1183,8 +1183,7 @@
         center = sinogram.shape[1]/2
 
         # try automatic center finding routines for initial value
-        num_core=1
-        #tomo_center = tomopy.find_center_vo(sinogram, ncore=1)
+        #num_core=1
         tomo_center = tomopy.find_center_vo(sinogram, ncore=num_core)
         center_offset_vo = tomo_center-center
         if self.test_mode:
@@ -1973,7 +1972,7 @@
                     assert(stack.get('preprocessed', False) == True)
                     assert(stack.get('reconstructed', False) == True)
                     continue
-            print(f'OK4 {i} b')
+            print(f'OK4 {i} b size = {self.tomo_stacks[i].size}')
             stack['reconstructed'] = False
             if not self.tomo_stacks[i].size:
                 self.tomo_stacks[i], available = self._loadTomo('red stack', index,
@@ -1983,7 +1982,9 @@
                 stack[i]['preprocessed'] = False
                 load_error = True
                 continue
+            print(f'lower_row = {lower_row} upper_row = {upper_row} self.tomo_stacks[i].shape[0] = {self.tomo_stacks[i].shape[0]}')
             assert(0 <= lower_row < upper_row < self.tomo_stacks[i].shape[0])
+            print(f'OK4 {i} c')
             center_offsets = [lower_center_offset-lower_row*center_slope,
                     upper_center_offset+(self.tomo_stacks[i].shape[0]-1-upper_row)*center_slope]
             t0 = time()
@@ -1991,7 +1992,7 @@
                     thetas, center_offsets=center_offsets, sigma=0.1, num_core=num_core,
                     algorithm='gridrec', run_secondary_sirt=True, secondary_iter=25)
             logging.info(f'Reconstruction of stack {index} took {time()-t0:.2f} seconds!')
-            print(f'OK4 {i} c')
+            print(f'OK4 {i} d')
             if self.galaxy_flag:
                 x_slice = int(self.tomo_stacks[i].shape[0]/2) 
                 title = f'{basetitle} {index} xslice{x_slice}'
@@ -2025,7 +2026,7 @@
             if combine_stacks and index in combine_stacks.get('stacks', []):
                 combine_stacks['stacks'].remove(index)
             self.cf.saveFile(self.config_out)
-            print(f'OK4 {i} d')
+            print(f'OK4 {i} e')
 
         # Save reconstructed tomography stack to file
         print('OK5')