Skip to content

Commit

Permalink
Some logging when running astra recon
Browse files Browse the repository at this point in the history
  • Loading branch information
jadball committed Nov 12, 2024
1 parent 6a8b426 commit 36ebde2
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions ImageD11/nbGui/S3DXRD/run_astra_recon.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
def main(h5name, dsfile, group_name):
print('Loading dataset')
# load the dataset
ds = ImageD11.sinograms.dataset.load(dsfile)


print('Loading grain sinograms from disk')
grainsinos = read_h5(h5name, ds, group_name=group_name)

for gs in grainsinos:

print('Reconstructing grain sinograms')
for inc, gs in enumerate(grainsinos):
gs.recon(method="astra", astra_method="EM_CUDA")
print('Reconstructed ' + inc+1 + '/' + len(grainsinos))

# mask recon after running
print('Masking reconstructions')
for gs in grainsinos:
gs.recons['astra'] = np.where(gs.recon_mask, gs.recons['astra'], 0)


print('Reconstructions finished')
print('Writing grains to disk')
write_h5(h5name, grainsinos, overwrite_grains=True, group_name=group_name)


Expand Down

0 comments on commit 36ebde2

Please sign in to comment.