Skip to content
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

Enabling to read TOF-bin order from Interfile Header #1389

Merged
merged 2 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions documentation/release_6.1.htm
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ <h3>New functionality</h3>
<ul>
<li>
Add TOF capability of the parallelproj projector (see <a href=https://github.com/UCL/STIR/pull/1356>PR #1356</a>)
Read TOF bin order from interfile header (see <a href=https://github.com/UCL/STIR/pull/1389> PR #1389</a>)
</li>
</ul>

Expand Down
15 changes: 14 additions & 1 deletion src/IO/InterfileHeader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,8 @@ InterfilePDFSHeader::InterfilePDFSHeader()
#if STIR_VERSION < 070000
add_alias_key("Maximum number of (unmashed) TOF time bins", "Number of TOF time bins");
#endif
timing_poss_sequence.clear();
add_key("TOF bin order", &timing_poss_sequence);
size_of_timing_pos = -1.f;
add_key("Size of unmashed TOF time bins (ps)", &size_of_timing_pos);
#if STIR_VERSION < 070000
Expand Down Expand Up @@ -701,7 +703,7 @@ InterfilePDFSHeader::find_storage_order()
// TOF
if (matrix_labels[4] == "timing positions")
{
num_timing_poss = matrix_size[4][0];
this->num_timing_poss = matrix_size[4][0];
}
else
{
Expand Down Expand Up @@ -1023,6 +1025,17 @@ InterfilePDFSHeader::post_processing()
<< endl;
#endif

// TOF order
if (this->timing_poss_sequence.size())
{
if (this->timing_poss_sequence.size() != static_cast<std::vector<int>::size_type>(this->num_timing_poss))
{
warning("Inconsistent number of TOF bins (" + std::to_string(this->num_timing_poss)
+ ") and size of the 'TOF bin order' list (" + std::to_string(this->timing_poss_sequence.size()) + ").");
// return true;
}
}

// handle scanner

shared_ptr<Scanner> guessed_scanner_ptr(Scanner::get_scanner_from_name(get_exam_info().originating_system));
Expand Down
Loading