Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4b6f573
Add in beam hardening entries to the config file.
Oct 23, 2022
d692dbd
Modifications to integrate the beam hardening code.
Oct 24, 2022
d856a89
Bug fixes for first working beam hardening reconstructions.
Oct 24, 2022
3cebd3d
Edits to fix bugs that arose with try reconstructions.
Oct 25, 2022
8d4f03e
Merge branch 'main' into beamhardening
Feb 15, 2023
7ea4ec5
Bug fix to make exposure ratio calculation work.
Feb 15, 2023
d41e5a9
Stashing changes for now
Feb 15, 2023
dc63356
Small typo in utils.py
Feb 15, 2023
6af18fb
Bug fixes for two issues:
Feb 16, 2023
c501c13
Merge branch 'beamhardening' of https://github.com/aps-7bm/tomocupy i…
nikitinvv May 31, 2023
298b1bb
Merge pull request #39 from tomography/main
nikitinvv May 31, 2023
0304356
adjust functions
nikitinvv May 31, 2023
f8e7f9e
update tests
nikitinvv May 31, 2023
01fd129
Merge pull request #1 from tomography/aps-7bm-beamhardening
aps-7bm May 31, 2023
020a674
Add environment.yml to make setting up the conda env easier.
Jun 7, 2023
43ac3fe
Merge remote-tracking branch 'upstream/main'
Jun 7, 2023
8ac59f9
Modifications to use first principles source calculations for
Aug 29, 2023
8bbff76
More changes to allow reconstructions to run
Aug 30, 2023
0e1b94d
Refactor test_all.py to allow exceptions to be raised.
Sep 5, 2023
1657a85
Revisions to tests/test_full.py to be more robust.
Sep 6, 2023
be3e860
Add tests for beam hardening, including test data.
Sep 7, 2023
0af7094
Merge remote-tracking branch 'upstream/main'
Aug 18, 2025
0319b12
Fixes to process/proc_functions.py from merging.
Sep 9, 2025
724838f
Changes to align with upstream/main
Sep 10, 2025
25982c3
Further changes to align with upstream/main
Sep 10, 2025
8795b86
Re-add logging.py after renaming it to match with upstream/main
Sep 10, 2025
697f320
Further changes to align with upstream/main
Sep 10, 2025
af99586
Commit to start reconciling with upstream
Nov 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/tomocupy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ def update_hdf_process(fname, args=None, sections=None):
hdf_file.require_dataset(dataset, shape=(1,), dtype=dt)
log.info(name + ': ' + str(value))
try:
hdf_file[dataset][0] = np.string_(str(value))
hdf_file[dataset][0] = np.bytes_(str(value))
except TypeError:
log.error(
"Could not convert value {}".format(value))
Expand Down
1 change: 0 additions & 1 deletion src/tomocupy/processing/proc_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def darkflat_correction(self, data, dark, flat):
dark0 = cp.mean(dark0, axis=0)
res = (data.astype(args.dtype, copy=False)-dark0) / \
(flat0-dark0+flat0*1e-5)

return res

def minus_log(self, data):
Expand Down
13 changes: 8 additions & 5 deletions tests/test_full.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@

prefix = 'tomocupy recon --file-name data/test_data.h5 --reconstruction-type full --rotation-axis 782.5 --nsino-per-chunk 4'
prefix2 = 'tomocupy recon --file-name data/Downsampled_WB.h5 --reconstruction-type full --nsino-per-chunk 4 --rotation-axis 808 --sample-material Pb '
prefix3 = '--filter-1-auto True --filter-2-auto True --filter-3-auto True --sample-density 11.34 --dezinger 3 '
prefix3 = '--read-pixel-size --read-scintillator --filter-1-auto True --filter-2-auto True --filter-3-auto True --sample-density 11.34 --dezinger 3 '
prefix4 = '--filter-1-density 1.85 --filter-2-density 8.9 --filter-3-density 8.9'
prefix5 = '--filter-1-density 0.0 --filter-2-density 0.0 --filter-3-density 0.0'
cmd_dict = {
f'{prefix} ': 28.307,
f'{prefix2} {prefix3} {prefix5} --beam-hardening-method standard --calculate-source standard': 3251.278,
f'{prefix2} {prefix3} {prefix4} --beam-hardening-method standard': 3250.038,
f'{prefix2} {prefix3} {prefix4} --beam-hardening-method standard --calculate-source standard': 3250.038,
f'{prefix2} {prefix3} {prefix4} --beam-hardening-method standard --calculate-source standard --e-storage-ring 3.0': 1590.9,
f'{prefix} --reconstruction-algorithm lprec ': 27.992,
f'{prefix} --reconstruction-algorithm linerec ': 28.341,
f'{prefix} --dtype float16': 24.186,
Expand All @@ -38,9 +42,9 @@
f'{prefix} --bright-ratio 10': 32.631,
f'{prefix} --end-column 1535': 28.293,
f'{prefix} --end-column 1535 --binning 3': 1.82,
f'{prefix2} {prefix3} {prefix5} --beam-hardening-method standard --calculate-source standard': 3255.912,
f'{prefix2} {prefix3} {prefix4} --beam-hardening-method standard': 3248.832,
f'{prefix2} {prefix3} {prefix4} --beam-hardening-method standard --calculate-source standard': 3254.634,
f'{prefix2} {prefix3} {prefix5} --beam-hardening-method standard --calculate-source standard': 3256.6,
f'{prefix2} {prefix3} {prefix4} --beam-hardening-method standard': 3250.0,
f'{prefix2} {prefix3} {prefix4} --beam-hardening-method standard --calculate-source standard': 3255.3,
f'{prefix2} {prefix3} {prefix4} --beam-hardening-method standard --calculate-source standard --e-storage-ring 3.0 --b-storage-ring 0.3': 822.178,
}

Expand Down Expand Up @@ -87,6 +91,5 @@ def test_full_recon(self):
self.assertAlmostEqual(ssum, cmd[1], places=0)



if __name__ == '__main__':
unittest.main(testLoader=SequentialTestLoader(), failfast=True)