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

use listmode time frame for output frame definition if all events are used #1519

Merged
merged 7 commits into from
Nov 19, 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
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();
KrisThielemans marked this conversation as resolved.
Show resolved Hide resolved
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
Loading