-
Notifications
You must be signed in to change notification settings - Fork 107
Time Of Flight reconstruction #304
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 218 commits
Commits
Show all changes
420 commits
Select commit
Hold shift + click to select a range
d3aa6fc
Merge remote-tracking branch 'upstream/master' into tof_sino_UCL
NikEfth cb2c46c
Two more changes asked by Codacy
NikEfth a4b815e
Number of time frames and function declaration (#12)
ALEXJAZZ008008 7c5ec7b
Fix for TOF-PSF reconstruction
NikEfth de8282b
Merge remote-tracking branch 'upstream/master' into tof_sino_UCL
NikEfth 3a25017
Merge remote-tracking branch 'upstream/master' into tof_sino_UCL
NikEfth 6d6b44b
Merge with master
NikEfth 2c068c2
fix ProjData::get_num_sinograms() for TOF
KrisThielemans a296248
Merge branch 'master' into tof_sino_UCL
KrisThielemans 8fa3169
fix sensitivity calculation for lm recon
NikEfth 000a398
Merge remote-tracking branch 'origin/tof_sino_UCL' into tof_sino_UCL
NikEfth 53085f0
Fixed test_zoom_images
NikEfth 31dea95
fix: python
NikEfth 3f4c94d
added ProjData::get_num_non_tof_sinograms and fixed SWIG for tof
KrisThielemans f22abd6
removed unused ForwardProjectorByBin::forward_project(Bin&,...)
KrisThielemans 8683ef7
removed unused variable
KrisThielemans fafeefd
implemented codacy recommendations
KrisThielemans 2b0691e
enable tests for filling TOF data
KrisThielemans 4645c15
corrected some diagnostic messages in test_proj_data_in_memory
KrisThielemans 99c8f7f
check TOF range in ProjDataInfo::operator==
KrisThielemans e4e5804
[TOF] fixed bug in max_unmashed_tof_pos_num
KrisThielemans d0753e3
renamed Scanner::get_num_max_of_timing_poss to get_max_num_timing_poss
KrisThielemans 5a45c96
remove compiler warnings in ProjDataFromStream
KrisThielemans b1402b3
fix ProjDataInfo comparison
NikEfth b70a0c1
fix on previous commit
NikEfth 2bd6cf8
Delete a small duplicate
NikEfth d88e98c
Merge remote-tracking branch 'origin/release_4' into tof_sino_UCL
KrisThielemans 0f0cccb
correct ProjData::get_num_non_tof_sinograms()
KrisThielemans 521be8d
If failed to find a TOF bin return min rather than centre
NikEfth 854d121
Merge branch 'tof_sino_UCL' of git@github.com:NikEfth/STIR.git
NikEfth fc1ca43
Merge remote-tracking branch 'refs/remotes/upstream/master'
NikEfth fa0daaa
Merge branch 'master' into tof_sino_UCL
NikEfth 66df042
Update LmToProjData.cxx and CListEventCylindricalScannerWithDiscreteD…
NikEfth 9ac474e
Merge branch 'tof_sino_UCL' of git@github.com:NikEfth/STIR.git
NikEfth 7f778d1
Curently Passes:
NikEfth dc0b293
Update and Pass run_test_simulate_and_recon.sh
NikEfth 11d9b04
Compiles with GESinga TOF support and stir.i updates.
NikEfth b3f91c0
T.B.C. this value allows the test_ArcCorrection to pass
NikEfth 76994be
Yet another scanner generation fix.
NikEfth 03012cd
Revert "T.B.C. this value allows the test_ArcCorrection to pass"
NikEfth 4a2be32
Reduce the threshold on overlap_interpolate.inl to fix a numerical in…
NikEfth df86c03
Merge remote-tracking branch 'origin/master' into tof_sino_UCL
KrisThielemans 29c2c9c
Merge remote-tracking branch 'origin/master' into tof_sino_UCL
KrisThielemans 970264b
hopefully more clear printing of TOF info
KrisThielemans 31c3990
allow SSRB tof_mashing for proj_data_info
KrisThielemans 9b0c2c0
Merge branch 'master' into tof_sino_UCL
KrisThielemans 9fcf096
list_proj_data_info and test fixes
KrisThielemans f0c8efa
another fix for run_test_zoom_image.sh
KrisThielemans eb8ecd9
Merge remote-tracking branch 'origin/master' into tof_sino_UCL
KrisThielemans 17daf28
made nonTOF GE Signa consistent with TOF version
KrisThielemans 6be8e07
Merge ucl/master into tof_sino_ucl
robbietuk 0981510
Add TOF info to DMI 5-ring
robbietuk aa5f26e
Merge pull request #19 from robbietuk/TOF/UpdateMaster
NikEfth 72ffac3
Update build-test.yml
KrisThielemans c2e95ab
Allow view_segment + TOF bin OpenMP (#22)
robbietuk f2fe075
Simplify apply_tof_kernel_and_symm_transformation geometric computati…
robbietuk 0ab8655
Apply suggestions from code review on TOF PR
KrisThielemans 74baab9
remove file checked in by accident [ci skip]
KrisThielemans ec0bdcd
[CMAKE] remove outdated DISABLE_HDF5_SUPPORT line [ci skip]
KrisThielemans f78bd17
fix error introduced in code review suggestion
KrisThielemans e066ead
TOF erf interpolation class (FastErf) (#24)
robbietuk 16518f9
Merge remote-tracking branch 'origin/master' into tof_sino_UCL
KrisThielemans 6976945
re-enable forward projection without caching if nonTOF
KrisThielemans 439f62c
remove the Discovery STE nonTOF scanner
KrisThielemans 7437adf
update run_test_time_of_flight.sh but still broken
KrisThielemans 8a34b4a
added extra test on TOF projdata
KrisThielemans 68b7dc6
Merge branch 'master' into tof_sino_UCL
robbietuk 37919a6
[ci skip] Set defaults scanner parameters for TOF fields
robbietuk 78a7c1c
default TOF mashing factor to 1 when reading ROOT files
KrisThielemans 6b8ae02
fix Scanner after merge onto TOF
KrisThielemans 1a4faf2
remove remaining half_block in ROOT code
KrisThielemans aa50db5
fix ProjDataInfoSubsetByView for TOF
KrisThielemans f5478c6
Merge pull request #28 from robbietuk/TOF/MergeUCLSTIR
KrisThielemans 60f2d37
Some changes for positron range: one medium
eliseemond 974f148
Files for STIR+ROOT check (symmetries, unlisting etc.)
eliseemond 581c2cd
The .hroot files were missing
eliseemond 2884a4d
Gate/STIR time resolution calibration
eliseemond cb75a8c
Update README.md
eliseemond 7e10e2c
README.md for ROOT consistency check for TOF
eliseemond f8dee64
Move ROOT-STIR-consistency into recon_tests and enable test [ci skip]
robbietuk 8d8d5b4
Remove consistency configuration and generation files
robbietuk f59a3ce
Redesign of test_view_offset_root to include TOF tests
robbietuk 140b217
Rename test_view_offset_root -> test_consistency_with_root
robbietuk b449748
Remove old test test_consistency_root
robbietuk ecb4fd4
[ci skip] Significant fixes for test_consistency_with_root tests
robbietuk a7ac52f
[ci skip] The data is TOF by default and guass_sigma_in_mm is not nee…
robbietuk 3ae0730
Rename debug tool and cleanup content for non-TOF tests
robbietuk 21ec98e
Update test data output ti *voxel_data*.txt in .gitignore
robbietuk 9f4f2f7
[ci skip] TOF debug_consistency_with_root improvements
robbietuk e244cb4
changed TOF-test threshold to 3D & added 3D plot of all sources in 1 …
NicoleJurjew 84cee72
adapted TOF-test threshold to 3.3
NicoleJurjew 4cc2120
add documentation and changee variable names and plot legend
NicoleJurjew 910ce5e
Merge pull request #26 from NicoleJurjew/adapt_root_consistency_thres…
robbietuk 85d9472
Rename `test_consistency_with_root` to `test_consistency_with_GATE`
robbietuk 855de84
Class and method documentation and code->method refactoring
robbietuk 3df95b1
[ci skip] CTests save data as CSV with tolerance information.
robbietuk c43e68f
[ci skip] Change python data extraction to use csv
robbietuk ee64995
TOF threshold is a function of TOF resolution.
robbietuk e802219
fixes to comments [ci skip]
KrisThielemans 0d59a1d
minor fixes to comments [ci skip]
KrisThielemans 1422b9d
Merge pull request #30 from robbietuk/TOF/test_consistency_with_root
KrisThielemans dc5016c
fix TOF get_det_pos_pair_for_bin
KrisThielemans e576981
minor fixes for CListEventCylindricalScannerWithViewTangRingRingEncod…
KrisThielemans 3c9545b
fixes for Bin
KrisThielemans c3630f1
add RunTests functionality for Bin
KrisThielemans 7debbcf
remove CListEvent::get_swapped() and CListEventROOT::is_swapped()
KrisThielemans 769fecd
fix DetectionPositionPair::timing_pos
KrisThielemans 61de2b1
more fixes and tests for TOF-bin swapping
KrisThielemans d02feaa
remove untested/unused ProjDataInfoCylindrical* functions
KrisThielemans f41d184
[GHA] port changes from master for test workflow
KrisThielemans b6bfb67
Merge pull request #31 from KrisThielemans/TOF_fix_get_det_pos_pair_f…
KrisThielemans b6eb9ce
Use Bin TOF position in cache
NikEfth 579227a
Rework get_proj_matrix_elems_for_one_bin and simply apply_tof_kernel
robbietuk 9ee89b4
find_basic_bin `-1 * timing_pos_num` if do_symmetry_swap_s && tangen…
robbietuk 4489198
Add SymmetryOperation_PET_CartesianGrid_swap_xmx_ymy_tmt
robbietuk 9f82c8a
Improve test by inspecting elems_with_sym.bin is same as bin
robbietuk f452d10
Changes to DataSymmetries, if shift_z, set axial_pos_shift to axial p…
robbietuk 1910184
Fix timing_pos_num changes for SymOp swap_xmx_ymy_zq
robbietuk c35cb4b
Add more tests and fix TOF scanner config
robbietuk 176d080
Turn off data symmetries if tof enabled
robbietuk 2b00be5
[ci skip] Disabled all but shift_z, improve test logic, add new scanner
robbietuk 7416289
Remove error on non-cached forward projector with TOF
robbietuk 27fdcb8
[ci skip] Cleanup and remove tmt symmetry class
robbietuk 79d97c4
Simplify apply_tof_kernal loop
robbietuk 6ee85ab
[ci skip] white space fixes
robbietuk 5f2ce06
more bits for ProjMatrixByBin cache_key
KrisThielemans 0e3dc9c
minor simplification in TOF kernel application
KrisThielemans 1237a85
comment-out failing TOF det_pos test for now
KrisThielemans 02af7d2
corrected assert [skip appveyor]
KrisThielemans 332ea57
Correct bit shift
robbietuk 3506af1
fix ProjData::fill_from in TOF case
KrisThielemans 0690d0f
add to test_proj_data_info.cxx
KrisThielemans 0af3702
simplify and fix ProjData::fill_from/copy_to
KrisThielemans 580b78e
Merge pull request #40 from KrisThielemans/fix_fill_from
KrisThielemans da618ed
add TOF sim/recon to recon_test_pack
KrisThielemans 19595b9
recon_test_pack: fix simulation scripts for TOF
KrisThielemans cc8ba97
recon_test_pack: fix run_test_simulate_and_recon.sh for TOF
KrisThielemans 6bacfb0
rewrite of ProjDataFromStream offsets, adding support for "by sinogra…
KrisThielemans 323806d
re-enable test_tof_proj_data_info_det_pos as now fixed
KrisThielemans 91f19a4
Merge remote-tracking branch 'nikos/tof_sino_UCL' into TOF/Symmetries…
KrisThielemans bcab3d6
sensitivity fixes for the TOF case
KrisThielemans 2606b76
Merge pull request #25 from robbietuk/TOF/Symmetries/Main
KrisThielemans 98643e3
add missing TOF loops in ProjData*
KrisThielemans 2876fcb
fix ProjDataInfo::set_tof_mash_factor
KrisThielemans c5af80e
fix subsets for TOF
KrisThielemans 370d7fe
add TOF loop in extract_segments
KrisThielemans 75e275f
Merge remote-tracking branch 'origin/master' into merge_master_to_TOF…
KrisThielemans 932e7ba
fix TOF lm-recon and add test
KrisThielemans 6f24052
Merge remote-tracking branch 'origin/master' into merge_master_to_TOF…
KrisThielemans 855f065
correct mCT TOF info
KrisThielemans a94ec57
add info for Siemens Vision 600
KrisThielemans a01dee3
add parsing of Siemens TOF data
KrisThielemans 74d0473
change order of TOF bins in Siemens Interfile data
KrisThielemans e308ba2
fix Siemens TOF order when parsing interfile headers
KrisThielemans 6575566
define STIR_TOF preprocessor/cmake variable
KrisThielemans ca03154
enable additive-sino for TOF listmode recon wtih caching
KrisThielemans d3d0c52
add TOF bin to output of list_lm_events
KrisThielemans be953b3
ECAT8_32 bit read TOF information
KrisThielemans fa27110
[GHA] increase disk space on GitHub actions runner
KrisThielemans cb3934c
unlist all TOF bins in one go by default
KrisThielemans 8dfba7b
add TOF loops in inverse_SSRB
NicoleJurjew 59d1c58
add loops over TOF in interpolate_projdata
NicoleJurjew 3c29ea5
reverse TOF bin order for Siemens files
NicoleJurjew 1d7ecf4
explicitly use segment 0 only in scatter upsampling
NicoleJurjew b3dad73
Merge pull request #5 from NicoleJurjew/fix_inverseSSRB
KrisThielemans c5ce566
Merge pull request #44 from KrisThielemans/merge_master_to_TOF_2023_0…
KrisThielemans 51642dc
merging latest master, in particular new templated CListEventScannerW…
f89c53b
Merging master: correction of conflict in text
danieldeidda 1f28f91
Merging master: update CListRecordROOT.cxx
danieldeidda 62cebdd
reinstate some lines that were lost in merge
KrisThielemans 7fdedf0
fix CListEventScannerWithDiscreteDetectors regressions introduced in …
KrisThielemans b0062ad
disabled buggy unmashed_tof_bin functionality
KrisThielemans 91d707b
one more regression fix
KrisThielemans b19b7cf
added functionality to test DetectionPosition
KrisThielemans c086a1e
added lower-level test on CListEventROOT TOF swapping
KrisThielemans f3f940b
Merge pull request #47 from KrisThielemans/fixPreviousMerge
KrisThielemans e480580
Merge remote-tracking branch 'origin/master' into merge_master_to_TOF…
KrisThielemans 747fa97
Merge remote-tracking branch 'origin/master' into merge_master_to_TOF…
KrisThielemans 60762a9
[SWIG] define STIR_TOF
KrisThielemans 1732376
Merge pull request #48 from KrisThielemans/merge_master_to_TOF_2023_0…
KrisThielemans 9b9eca9
small code clean-up
KrisThielemans 4432943
commented out run_tof_test_function in LmToProjData
KrisThielemans 93fe32b
tiny bit of extra documentation and clean-up
KrisThielemans 08bb7a5
Merge remote-tracking branch 'origin/master' (v5.2.0) into TOF branch
KrisThielemans d3870ed
remove erroneous asserts introduced in previous merge
KrisThielemans 04b6623
[GHA] corrected tmate session if statement
KrisThielemans 56804ac
[GHA] always enable tmate temporarily
KrisThielemans a4b4493
[GHA] add .v and .s to upload (if recon_test_pack failure)
KrisThielemans b71683e
remove .ahv files as not used
KrisThielemans 229c07a
handle "compressed" projdatainfo as input
KrisThielemans b579414
set default for energy fields when reading .hroot
KrisThielemans f27262c
set test files to have odd number of TOF bins
KrisThielemans 6f03c22
fix ProjDataInfo::operator== and >= to check tof_mash_factor
KrisThielemans 36d25e3
fix BinNormalisationFromProjData::set_up to cope with mixing TOF data
KrisThielemans bd49727
remove (now) unused use_tof member and keyword
KrisThielemans 2ea7e18
more helpful error message in find_STIR_config_file
KrisThielemans 351c29d
Fix handling of non-TOF sensitivity calculation for projdata
KrisThielemans 3d93969
Merge pull request #55 from KrisThielemans/TOFcompressedlistmode
KrisThielemans e3a4e28
recon_test_pack: fix run_root_GATE.sh and associated files
KrisThielemans 5e6b25d
let constructors error if max_num_nonarccorrected_data is smaller tha…
KrisThielemans 4222556
fix scatter templates: set max_num_nonarccorrected bins
KrisThielemans 8af448b
minor changes in list-mode tests
KrisThielemans f017c9a
upgrade STIR_VERSION to 6.0.0
KrisThielemans 3846284
minor corrections in GATE test files
KrisThielemans 6b7a85e
tell git *.l and *.root are binary
KrisThielemans 01075f6
Merge remote-tracking branch 'nikos/tof_sino_UCL' into merge_master_a…
KrisThielemans 06bb31d
use ROOT tests with TOF mashing = 1
KrisThielemans 12e0fff
Merge pull request #52 from KrisThielemans/merge_master_at_v5.2.0_to_TOF
KrisThielemans 52808c3
fix TOF swap in find_cartesian_coordinates_given_scanner_coordinates
KrisThielemans 64962b6
correct typos in test
KrisThielemans 7e6dcf1
Merge pull request #50 from KrisThielemans/TOF_swap_fix
KrisThielemans d458d36
set VERSION.txt to 6.0.0 as well
KrisThielemans 809e59d
removed script as obsolete and not working anyway
KrisThielemans 910490f
Siemens Vision to Vision 600
KrisThielemans c7a2b15
removed full_event from CListRecord
KrisThielemans dd7cca8
Interfile parsing fixes for TOF and clarifications
KrisThielemans 386a797
reinstate check on axial_pos range
KrisThielemans b0fac1e
clean-up of now obsolete TOF functionality
KrisThielemans b068bc8
removed unused/unimplemented method
KrisThielemans 0e5b7b3
remove member that clashes with the one in the base class
KrisThielemans 2bcdc3e
reinstated deleting of arrays in SPECTUB destructor
KrisThielemans 005f70a
removed get_bin_ptr and made get_bin()/get_densel() return const&
KrisThielemans 51d8c0b
removed remnants of non-functional methods
KrisThielemans 1d38eb9
removed unused function
KrisThielemans f396331
removed unused class
KrisThielemans 3ef019c
replaced get_scanner_sptr() with get_scanner() for ListModeData
KrisThielemans db42d85
added Vereos but disabled for now as unchecked [ci skip]
KrisThielemans d5aae0d
Merge pull request #59 from KrisThielemans/minor_TOF_fixes
KrisThielemans c653a1b
Merge remote-tracking branch 'origin/master' into merge_master_to_TOF…
KrisThielemans d60ba7b
Merge pull request #61 from KrisThielemans/merge_master_to_TOF_2024_0…
KrisThielemans a82bd90
tiny bit of TOF release notes [ci skip]
KrisThielemans 3e1561a
add KeyParser::add_alias_key
KrisThielemans 4192f33
changed TOF-related keywords for Interfile parsing
KrisThielemans 22949cb
update glossary for TOF and a few other things [ci skip]
KrisThielemans fde976a
Merge pull request #62 from KrisThielemans/TOF_interfile_keywords
KrisThielemans 27a2516
make ProjDataInfo*NoArcCorr::get_bin_for_det_pair private
KrisThielemans 572509a
document that get_bin_for_det_pair takes mashed_tof_bin arg
KrisThielemans 6f63046
Merge pull request #63 from KrisThielemans/get_bin_for_det_pair_private
KrisThielemans 4a285ad
remove defaults for some TOF-range to avoid unexpected problems
KrisThielemans 53dbdc1
some TOF Codacy warning fixes for the GATE consistency test
4088ec3
removed some test-scanners from Scanner
KrisThielemans ddd3e0c
TOF Interfile header writing fix
KrisThielemans a93870d
change defaults in ProjDataInfo::ask_parameters and remove span=0
KrisThielemans 2cccf63
changed Interfile header keyword to "TOF timing resolution (ps)"
KrisThielemans 293d0f6
decrease precision in checking of TOF keywords
KrisThielemans 0818f69
nicer formatting of Scanner::parameter_info
KrisThielemans be414b2
add example TOF interfile header
KrisThielemans d7330dc
use STIR6.0 when output an Interfile header to denote TOF changes
KrisThielemans c6b36ed
revert change and allow span=0 and use it in the scatter tests
KrisThielemans 0e11a8f
Merge pull request #66 from KrisThielemans/TOF_Interfile_scanner_fixes
KrisThielemans 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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
|---|---|---|
|
|
@@ -41,6 +41,7 @@ template_sino=my_DSTE_3D_rd1_template.hs | |
| cat > my_input.txt <<EOF | ||
| Discovery STE | ||
| 1 | ||
| 0 | ||
| n | ||
|
|
||
| 0 | ||
|
|
||
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,38 @@ | ||
| OSMAPOSLParameters := | ||
| objective function type:= PoissonLogLikelihoodWithLinearModelForMeanAndListModeDataWithProjMatrixByBin | ||
| PoissonLogLikelihoodWithLinearModelForMeanAndListModeDataWithProjMatrixByBin Parameters:= | ||
| list mode filename := PET_ACQ_small.l.hdr.STIR | ||
| max ring difference num to process := 2 | ||
| projector pair type := Matrix | ||
| Projector Pair Using Matrix Parameters := | ||
| Matrix type := Ray Tracing | ||
| Ray tracing matrix parameters := | ||
| ; use multiple (almost) parallel LORs for every bin in the sinogram | ||
| ; to avoid discretisation artefacts | ||
| number of rays in tangential direction to trace for each bin:= 3 | ||
| ; you could disable some symmetries if you have enough memory | ||
| ; this would for instance allow you to increase the number of subsets | ||
| ; do_symmetry_90degrees_min_phi:=0 | ||
| End Ray tracing matrix parameters := | ||
| End Projector Pair Using Matrix Parameters := | ||
|
|
||
| Bin Normalisation type := From ProjData | ||
| Bin Normalisation From ProjData := | ||
| normalisation projdata filename:= my_acfs.hs | ||
| End Bin Normalisation From ProjData:= | ||
|
|
||
| ;num_events_to_store := 100 | ||
| recompute sensitivity :=1 | ||
| use subset sensitivities:= 0 | ||
| sensitivity filename:= my_sens_t_lm_pr_seg2.hv | ||
| zoom := 1 | ||
|
|
||
| additive sinogram := my_MLrandoms_f1.hs | ||
|
|
||
| end PoissonLogLikelihoodWithLinearModelForMeanAndListModeDataWithProjMatrixByBin Parameters:= | ||
| enforce initial positivity condition:= 1 | ||
| number of subsets:= 1 | ||
| number of subiterations:= 1 | ||
| save estimates at subiteration intervals:= 1 | ||
| output filename prefix := my_output_t_lm_pr_seg2 | ||
| END := |
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
Empty file.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| #! /bin/sh | ||
| # A script to check to see if Time Of Flight data are binned and used properly | ||
| # | ||
| # Copyright (C) 2016, University of Leeds | ||
| # Copyright (C) 2017, University of Hull | ||
| # This file is part of STIR. | ||
| # | ||
| # This file is free software; you can redistribute it and/or modify | ||
| # it under the terms of the GNU Lesser General Public License as published by | ||
| # the Free Software Foundation; either version 2.1 of the License, or | ||
| # (at your option) any later version. | ||
|
|
||
| # This file is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| # GNU Lesser General Public License for more details. | ||
| # | ||
| # See STIR/LICENSE.txt for details | ||
| # | ||
| # Author Nikos Efthimiou | ||
| # | ||
|
|
||
| # Scripts should exit with error code when a test fails: | ||
| if [ -n "$TRAVIS" ]; then | ||
| # The code runs inside Travis | ||
| set -e | ||
| fi | ||
|
|
||
| echo This script should work with STIR version '>'3.0. If you have | ||
| echo a later version, you might have to update your test pack. | ||
| echo Please check the web site. | ||
| echo | ||
|
|
||
| if [ $# -eq 1 ]; then | ||
| echo "Prepending $1 to your PATH for the duration of this script." | ||
| PATH=$1:$PATH | ||
| fi | ||
|
|
||
| # first need to set this to the C locale, as this is what the STIR utilities use | ||
| # otherwise, awk might interpret floating point numbers incorrectly | ||
| LC_ALL=C | ||
| export LC_ALL | ||
|
|
||
| echo "=== create template sinogram. We'll use a test_scanner which is small and | ||
| has TOF info" | ||
| template_sino=my_test_scanner_template.hs | ||
| cat > my_input.txt <<EOF | ||
| test_scanner | ||
| 1 | ||
| 82 | ||
| N | ||
|
|
||
|
|
||
|
|
||
| EOF | ||
| create_projdata_template ${template_sino} < my_input.txt > my_create_${template_sino}.log 2>&1 | ||
| if [ $? -ne 0 ]; then | ||
| echo "ERROR running create_projdata_template. Check my_create_${template_sino}.log"; exit 1; | ||
| fi | ||
|
|
||
| export INPUT_ROOT_FILE=test_PET_GATE.root | ||
| export EXCLUDE_RANDOM=1 | ||
| export EXCLUDE_SCATTERED=1 | ||
|
|
||
| INPUT=root_header.hroot TEMPLATE=$template_sino OUT_PROJDATA_FILE=my_tof_sinogram lm_to_projdata --test_timing_positions lm_to_projdata.par > my_write_TOF_values_${template_sino}.log 2>&1 | ||
|
|
||
| if [ $? -ne 0 ]; then | ||
| echo "ERROR running lm_to_projdata --test_timing_positions. Check my_write_TOF_values_${template_sino}.log"; exit 1; | ||
| fi | ||
|
|
||
| echo "Comparing values in TOF sinogram ..." | ||
| list_projdata_info --all my_tof_sinogram_f179g1d0b0.hs > my_sino_values_$template_sino.log 2>&1 | ||
| if [ $? -ne 0 ]; then | ||
| echo "ERROR running list_projdata_info. Check my_sino_values_$template_sino.log"; | ||
| exit 1; | ||
| fi | ||
|
|
||
|
|
||
| TOF_bins=$(grep 'Total number of timing positions' my_sino_values_$template_sino.log | awk -F ':' '{ print $2 }') | ||
| echo "Total number of TOF bins:" $TOF_bins | ||
|
|
||
| Timming_Locations=$(grep 'Timing location' my_sino_values_$template_sino.log | awk -F ':' '{ print $2 }') | ||
| echo "Timming_Locations:" $Timming_Locations | ||
|
|
||
| Data_mins=$(grep 'Data min' my_sino_values_$template_sino.log | awk -F ':' '{ print $2 }') | ||
| echo "Data mins:" $Data_mins | ||
|
|
||
| Data_maxs=$(grep 'Data max' my_sino_values_$template_sino.log | awk -F ':' '{ print $2 }') | ||
| echo "Data maxs:" $Data_maxs | ||
|
|
||
| for i in $(seq 5) | ||
| do | ||
| if [ $(( $((i-1 - TOF_bins/2)) - Data_mins[i])) -ne 0 ]; then | ||
| echo "Wrong values in TOF sinogram. Error. $(( $(($((i-1)) -TOF_bins/2)) - Data_mins[i]))" | ||
| exit 1 | ||
| fi | ||
| done | ||
|
|
||
|
|
||
| echo | ||
| echo '--------------- End of Time-Of-Flight tests -------------' | ||
| echo | ||
| echo "Everything seems to be fine !" | ||
| echo 'You could remove all generated files using "rm -f my_* *.log"' | ||
| exit 0 | ||
|
|
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,6 +77,7 @@ template_sino=my_DSTE_3D_rd2_template.hs | |
| cat > my_input.txt <<EOF | ||
| Discovery STE | ||
| 1 | ||
| 0 | ||
| n | ||
|
|
||
| 0 | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| %% | ||
| %Plot TOF bins. | ||
| % Nikos Efthimiou. 2018/11/01 | ||
| % University of Hull | ||
|
|
||
| %This scripts loads LOR files, exported by test_time_of_flight to the disk and plots them. | ||
| %% | ||
| clc; clear all; | ||
| %Path to TOF files. | ||
| path_name ='/home/nikos/Desktop/conv_LOR/' | ||
KrisThielemans marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| pre_sort_files_in_path = dir(path_name) | ||
| nums = [] | ||
| names = [] | ||
|
|
||
| for i = 1: size(pre_sort_files_in_path) | ||
| cur_file = pre_sort_files_in_path(i).name | ||
| if strfind (cur_file, 'glor') | ||
| num = sscanf(cur_file,'glor_%d') | ||
| % The following number can change accordingly. | ||
| if ((mod(num,1)==0) || num == 500000000) | ||
| nums{end+1} = int32(num); | ||
| names{end+1} = cur_file; | ||
| end | ||
|
|
||
| end | ||
| end | ||
|
|
||
| clear cur_file | ||
| sorted_filenames = cell(numel(nums),2); | ||
| [Sorted_A, Index_A] = sort(cell2mat(nums)); | ||
| sorted_filenames(:,2) = names(Index_A); | ||
|
|
||
| % hold x values | ||
| x_values = []; | ||
| % hold the tof bins. | ||
| y_tf_values = []; | ||
| % hold the non tof LOR | ||
| y__ntf_values = []; | ||
|
|
||
| for i = 1 : size(sorted_filenames,1) | ||
| cur_file = sorted_filenames{i,2}; | ||
|
|
||
| if strfind (cur_file, 'glor') | ||
|
|
||
| if strfind(cur_file, '500000000') | ||
| cur_full_path = fullfile(path_name, cur_file); | ||
|
|
||
| A = importdata(cur_full_path); | ||
| y_ntf_values = A(:,2); | ||
| else | ||
| cur_full_path = fullfile(path_name, cur_file); | ||
|
|
||
| A = importdata(cur_full_path); | ||
|
|
||
| if size(x_values) == 0 | ||
| x_values = A(:,1); | ||
| end | ||
|
|
||
| y_tf_values = [y_tf_values A(:,2)]; | ||
|
|
||
| end | ||
| end | ||
| end | ||
|
|
||
| sum_of_all_bins = sum(y_tf_values,2); | ||
| x_v = x_values/0.299; | ||
|
|
||
| %% Create Plot | ||
| plot(x_v,y_tf_values(:,:), x_v, sum_of_all_bins, x_v, y_ntf_values) | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no TOF STE, so this makes no sense