-
Notifications
You must be signed in to change notification settings - Fork 29
Enabling PET reconstruction from list mode data #1103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 22 commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
51fed6c
implemented basic-functionality listmode data class in C++ and Python
evgueni-ovtchinnikov c4be9dd
added objective function type for lismode reconstruction
evgueni-ovtchinnikov 0063f78
introduced abstract base class PETScanData for all raw data objects
evgueni-ovtchinnikov b143cfc
[ci skip] interfaced PETScanData into Python
evgueni-ovtchinnikov b209f33
Minimal backbone for LM recons
NikEfth 31ef16c
New test for LM data (test6)
NikEfth b38b35b
fix
NikEfth 036c7c2
Merge branch 'HEAD' into lm-recon
NikEfth 65f9fe0
Working test6
NikEfth 97f76cd
Generalize the paths in test6
NikEfth 26d36fc
Minor renaming
NikEfth db4479d
simplify link library to Boost
paskino debcd5b
Merge branch 'master' into HEAD
paskino b59524c
remove dangling endif
paskino f65e1de
Merge pull request #1 from paskino/edo_lm-recon
NikEfth e4632db
[ci skip] moved data folder TBPET out of SIRF repo
evgueni-ovtchinnikov ea18b8d
removed unused stuff from cstir_test6.cpp
evgueni-ovtchinnikov 7a33289
restored backward compatibility of run_test6.cpp
evgueni-ovtchinnikov 7e0e299
implemented C interface for list mode reconstruction objective function
evgueni-ovtchinnikov 47eb909
started interfacing reconstruction from listmode into Python
evgueni-ovtchinnikov 08f0425
implemented minimal Python interface for reconstruction from listmode…
evgueni-ovtchinnikov 4dd2de7
resolved some issues raised by Kris
evgueni-ovtchinnikov 50ef6d4
small amendments in STIR.py
evgueni-ovtchinnikov eb2ae63
removed cstir_test6 from ctest tests
evgueni-ovtchinnikov 27e5d15
minor fixes to listmode classes
KrisThielemans ef4c9eb
removed some unneeded data_sptr() methods
evgueni-ovtchinnikov 608f39a
replaced cache_path quick fix with a more proper handling
evgueni-ovtchinnikov 8b96919
Merge remote-tracking branch 'origin/master' into lm-recon
KrisThielemans 05083e8
[ci skip] corrected copyrights in cSTIR/tests/test6.cpp
evgueni-ovtchinnikov ed30e6b
make listmode recon compatible with STIR 5.1.0
KrisThielemans 4fa6220
Merge branch 'master' into lm-recon
KrisThielemans cd0c423
rename PETScanData to ScanData(Python) or STIRScanData (C++)
KrisThielemans ab26634
Merge remote-tracking branch 'origin/master' into lm-recon
KrisThielemans dd4e33e
No longer derive ListmodeData from DataContainer
KrisThielemans a66667b
update listmode test (WIP)
KrisThielemans 5698103
Derive DataContainer from ContainerBase
KrisThielemans 61e692d
speed-up listmode recon test and use SIRF example data
KrisThielemans 27eec3d
attended to Codacy issues
evgueni-ovtchinnikov 81f1389
attended to further Codacy issues
evgueni-ovtchinnikov 6ed55d8
fix ListmodeData hierarchy and add get_info to STIR containers
KrisThielemans b98c6d0
renamed ListmodeData to STIRListmodeData for consistency
KrisThielemans 713ad10
add set_acquisition_model to listmode obj-fun
KrisThielemans 835b499
minor doc corrections
KrisThielemans 9ce3b51
listmode recon improvements
KrisThielemans f009fbf
Merge remote-tracking branch 'origin/master' into lm-recon
KrisThielemans bb42564
minor fix in demo
KrisThielemans 56fbace
fix storing filename of listmode file
KrisThielemans b384409
add SIRF_DATA_PATH to STIR C++ test
KrisThielemans 95b3a24
fixed bugs and issues found in lmrecontest2
evgueni-ovtchinnikov bf361ff
[ci skip] got rid of gpu stuff in reconstruct_from_listmode.py
evgueni-ovtchinnikov 752c077
[ci skip] removed osem_lm_reconstruction.py, superseded by listmode_r…
evgueni-ovtchinnikov e4ac001
[ci skip] updated CHANGES.md
evgueni-ovtchinnikov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| '''OSEM reconstruction from listmode demo. | ||
|
|
||
|
|
||
| Usage: | ||
| osem_lm_reconstruction [--help | options] <data_path> | ||
|
|
||
| Options: | ||
| -e <engn>, --engine=<engn> reconstruction engine [default: STIR] | ||
| ''' | ||
|
|
||
|
|
||
| __version__ = '0.1.0' | ||
| from docopt import docopt | ||
| args = docopt(__doc__, version=__version__) | ||
|
|
||
|
|
||
| # import engine module | ||
| exec('from sirf.' + args['--engine'] + ' import *') | ||
|
|
||
|
|
||
| data_path = args['<data_path>'] + '/' | ||
|
|
||
|
|
||
| def main(): | ||
|
|
||
| # direct all engine's information and warnings printing to files | ||
| msg_red = MessageRedirector('info.txt', 'warn.txt') | ||
|
|
||
| cache_path = data_path; | ||
| sens_filename = cache_path + "sens_0.hv"; | ||
| #print(sens_filename) | ||
| tmpl_projdata_filename = data_path + "tmpl_scanner.hs"; | ||
| #print(tmpl_projdata_filename) | ||
|
|
||
| acq_tmpl = AcquisitionData(tmpl_projdata_filename) | ||
| #print(acq_tmpl.dimensions()) | ||
|
|
||
| img_data = ImageData(sens_filename) | ||
| #print(img_data.dimensions()) | ||
|
|
||
| #obj_fun = PoissonLogLikelihoodWithLinearModelForMeanAndListModeDataWithProjMatrixByBin() | ||
| obj_fun = make_Poisson_loglikelihood( \ | ||
| likelihood_type='LinearModelForMeanAndListModeDataWithProjMatrixByBin') | ||
| obj_fun.set_cache_path(cache_path, True) | ||
| obj_fun.set_skip_lm_input_file(True); | ||
| obj_fun.set_skip_balanced_subsets(True); | ||
| obj_fun.set_acquisition_data(acq_tmpl); | ||
| obj_fun.set_skip_balanced_subsets(True); | ||
| obj_fun.set_max_ring_difference(60); | ||
| obj_fun.set_cache_max_size(1500000000); | ||
|
|
||
| #print(obj_fun.get_cache_path()) | ||
| #print(obj_fun.get_cache_max_size()) | ||
| #print(obj_fun.get_subsensitivity_filenames()) | ||
|
|
||
| num_subiterations = 11 | ||
| recon = OSMAPOSLReconstructor() | ||
| recon.set_objective_function(obj_fun) | ||
| recon.set_num_subiterations(num_subiterations) | ||
| recon.set_output_filename_prefix(data_path + "/my_output"); | ||
| recon.set_save_interval(1); | ||
|
|
||
| print('setting up, please wait...') | ||
| recon.set_up(img_data) | ||
|
|
||
| print('reconstructing, please wait...') | ||
| recon.reconstruct(img_data) | ||
|
|
||
| img_out = recon.get_output() | ||
| print(img_out.dimensions()) | ||
|
|
||
| # if anything goes wrong, an exception will be thrown | ||
| # (cf. Error Handling section in the spec) | ||
| try: | ||
| main() | ||
| print('\n=== done with %s' % __file__) | ||
|
|
||
| except error as err: | ||
| # display error information | ||
| print('%s' % err.value) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.