Skip to content

Commit

Permalink
GEHDF5 listmode: guarantee record-size in internal processing
Browse files Browse the repository at this point in the history
Previous code was leading to a stack corruption in debug mode,
although I don't understand why. In any case, this is more correct.
  • Loading branch information
KrisThielemans committed Jan 12, 2024
1 parent af885b2 commit d796b40
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/include/stir/listmode/CListRecordGEHDF5.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ dynamic_cast<CListRecordGEHDF5 const *>(&e2) != 0 &&
det_pos.pos1().axial_coord() = event_data.loXtalAxialID;
det_pos.pos2().tangential_coord() = this->get_uncompressed_proj_data_info_sptr()->get_scanner_sptr()->get_num_detectors_per_ring() - 1 - event_data.hiXtalTransAxID;
det_pos.pos2().axial_coord() = event_data.hiXtalAxialID;
det_pos.timing_pos() = event_data.deltaTime;
det_pos.timing_pos() = event_data.get_tof_bin();
}

//! This routine sets in a coincidence event from detector "indices"
Expand All @@ -285,9 +285,9 @@ dynamic_cast<CListRecordGEHDF5 const *>(&e2) != 0 &&
union
{
detail::CListAnyRecordDataGEHDF5 rec;
boost::uint16_t raw;
boost::uint16_t raw[4];
};
std::copy(data_ptr, data_ptr+2, &raw);
std::copy(data_ptr, data_ptr+2, &raw[0]);
switch(rec.eventLength)
{
case detail::LENGTH_6_EVT: return std::size_t(6);
Expand Down

0 comments on commit d796b40

Please sign in to comment.