Mercurial > repos > rv43 > tomo
comparison tomo.py @ 37:51dc93d0806a draft
"planemo upload for repository https://github.com/rolfverberg/galaxytools commit 87acf8a257d5d51cf249de085e555bb11d1dbd88"
| author | rv43 |
|---|---|
| date | Tue, 19 Apr 2022 18:13:10 +0000 |
| parents | 7ffde31e1e07 |
| children | c09b8ee8f68f |
comparison
equal
deleted
inserted
replaced
| 36:7ffde31e1e07 | 37:51dc93d0806a |
|---|---|
| 1145 t0 = time() | 1145 t0 = time() |
| 1146 # recon_sinogram = filters.gaussian(recon_sinogram, 3.0) | 1146 # recon_sinogram = filters.gaussian(recon_sinogram, 3.0) |
| 1147 recon_sinogram = spi.gaussian_filter(recon_sinogram, 0.5) | 1147 recon_sinogram = spi.gaussian_filter(recon_sinogram, 0.5) |
| 1148 recon_clean = np.expand_dims(recon_sinogram, axis=0) | 1148 recon_clean = np.expand_dims(recon_sinogram, axis=0) |
| 1149 del recon_sinogram | 1149 del recon_sinogram |
| 1150 logging.info('tomopy.misc.corr.remove_ring start') | 1150 logging.info(f'tomopy.misc.corr.remove_ring start on {num_core} cores') |
| 1151 recon_clean = tomopy.misc.corr.remove_ring(recon_clean, rwidth=17, ncore=num_core) | 1151 recon_clean = tomopy.misc.corr.remove_ring(recon_clean, rwidth=17, ncore=num_core) |
| 1152 logging.info('tomopy.misc.corr.remove_ring end') | 1152 logging.info('tomopy.misc.corr.remove_ring end') |
| 1153 logging.debug(f'filtering and removing ring artifact took {time()-t0:.2f} seconds!') | 1153 logging.debug(f'filtering and removing ring artifact took {time()-t0:.2f} seconds!') |
| 1154 return recon_clean | 1154 return recon_clean |
| 1155 | 1155 |
| 1183 # need index order column,theta for iradon, so take transpose | 1183 # need index order column,theta for iradon, so take transpose |
| 1184 sinogram_T = sinogram.T | 1184 sinogram_T = sinogram.T |
| 1185 center = sinogram.shape[1]/2 | 1185 center = sinogram.shape[1]/2 |
| 1186 | 1186 |
| 1187 # try automatic center finding routines for initial value | 1187 # try automatic center finding routines for initial value |
| 1188 logging.info('tomopy.find_center_vo start') | 1188 if num_core > 24: |
| 1189 #tomo_center = tomopy.find_center_vo(sinogram, ncore=num_core) | 1189 logging.info('tomopy.find_center_vo start on 24 cores') |
| 1190 tomo_center = tomopy.find_center_vo(sinogram, ncore=1) | 1190 tomo_center = tomopy.find_center_vo(sinogram, ncore=24) |
| 1191 else: | |
| 1192 logging.info(f'tomopy.find_center_vo start on {num_core} cores') | |
| 1193 tomo_center = tomopy.find_center_vo(sinogram, ncore=num_core) | |
| 1191 logging.info('tomopy.find_center_vo end') | 1194 logging.info('tomopy.find_center_vo end') |
| 1192 center_offset_vo = tomo_center-center | 1195 center_offset_vo = tomo_center-center |
| 1193 if self.test_mode: | 1196 if self.test_mode: |
| 1194 logging.info(f'Center at row {row} using Nghia Vo’s method = {center_offset_vo:.2f}') | 1197 logging.info(f'Center at row {row} using Nghia Vo’s method = {center_offset_vo:.2f}') |
| 1195 del sinogram_T | 1198 del sinogram_T |
