Skip to content

Commit

Permalink
Enabling to read TOF-bin order from Interfile Header (#1389)
Browse files Browse the repository at this point in the history
Reading TOF-bin order from Interfile Header
  • Loading branch information
NicoleJurjew authored Feb 16, 2024
1 parent ba98628 commit 0da0f08
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
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

0 comments on commit 0da0f08

Please sign in to comment.