Skip to content

Commit

Permalink
use listmode time frame for output frame definition if all events are…
Browse files Browse the repository at this point in the history
… used (UCL#1519)

use the time frame information (where available) for the listmode data
to set the frame definition for the output of LmToProjData if all events
are used, issuing a warning otherwise

---------

Co-authored-by: Kris Thielemans <KrisThielemans@users.noreply.github.com>
  • Loading branch information
danieldeidda and KrisThielemans authored Nov 19, 2024
1 parent d74fcc1 commit 4b87c30
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions documentation/release_6.3.htm
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ <h3>New functionality</h3>
<li>
<tt>stir_timings</tt> has now an extra option to parse a par-file for a projector-pair.
</li>
<li>
Duration in sinogram interfile/exam_info obtained from <tt>lm_to_projdata</tt> has the correct value if we unlist all the events. This is not true for ROOT files<br>
<a href=https://github.com/UCL/STIR/pull/1519>PR #1519</a>
</li>
</ul>


Expand Down
11 changes: 9 additions & 2 deletions src/listmode_buildblock/LmToProjData.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,15 @@ LmToProjData::set_up()
else if (frame_defs.get_num_frames() < 1)
{
// make a single frame starting from 0. End value will be ignored.
vector<pair<double, double>> frame_times(1, pair<double, double>(0, 0));
frame_defs = TimeFrameDefinitions(frame_times);
frame_defs = lm_data_ptr->get_exam_info_sptr()->get_time_frame_definitions();
if (frame_defs.get_num_time_frames() == 0)
{
vector<pair<double, double>> frame_times(1, pair<double, double>(0, 0));
frame_defs = TimeFrameDefinitions(frame_times);
}
if (num_events_to_store != 0)
warning(
"LmToProjData: num_events_to_store has been selected. The frame duration in the Interfile header will be incorrect!");
}

return Succeeded::yes;
Expand Down

0 comments on commit 4b87c30

Please sign in to comment.