18 #ifndef __stir_listmode_CListRecordECAT8_32bit_H__ 19 #define __stir_listmode_CListRecordECAT8_32bit_H__ 28 #include "boost/static_assert.hpp" 29 #include "boost/cstdint.hpp" 53 #if STIRIsNativeByteOrderBigEndian 77 DataType get_data()
const {
return this->data; }
88 Succeeded init_from_data_ptr(
const void*
const ptr)
90 const char*
const data_ptr =
reinterpret_cast<const char* const
>(ptr);
91 std::copy(data_ptr, data_ptr +
sizeof(this->raw), reinterpret_cast<char*>(&this->raw));
92 return Succeeded::yes;
94 inline bool is_prompt()
const override {
return this->data.delayed == 1; }
98 this->data.delayed = 1;
100 this->data.delayed = 0;
101 return Succeeded::yes;
111 std::vector<int> segment_sequence;
112 std::vector<int> timing_poss_sequence;
113 std::vector<int> sizes;
122 #if STIRIsNativeByteOrderBigEndian 124 unsigned deadtimeetc : 2;
129 unsigned deadtimeetc : 2;
134 class CListDataAnyECAT8_32bit
137 Succeeded init_from_data_ptr(
const void*
const ptr)
139 const char*
const data_ptr =
reinterpret_cast<const char* const
>(ptr);
140 std::copy(data_ptr, data_ptr +
sizeof(this->raw), reinterpret_cast<char*>(&this->raw));
141 return Succeeded::yes;
143 bool is_time()
const {
return this->data.type == 1U && this->data.deadtimeetc == 0U; }
144 bool is_other()
const {
return this->data.type == 1U && this->data.deadtimeetc != 0U; }
145 bool is_event()
const {
return this->data.type == 0U; }
162 Succeeded init_from_data_ptr(
const void*
const ptr)
164 const char*
const data_ptr =
reinterpret_cast<const char* const
>(ptr);
165 std::copy(data_ptr, data_ptr +
sizeof(this->raw), reinterpret_cast<char*>(&this->raw));
166 return Succeeded::yes;
168 bool is_time()
const {
return this->data.type == 1U && this->data.deadtimeetc == 0U; }
169 inline unsigned long get_time_in_millisecs()
const override {
return static_cast<unsigned long>(this->data.time); }
170 inline Succeeded set_time_in_millisecs(
const unsigned long time_in_millisecs)
override 172 this->data.time = ((1U << 30) - 1) &
static_cast<unsigned>(time_in_millisecs);
174 return Succeeded::yes;
200 bool is_time()
const override {
return this->any_data.is_time(); }
205 bool is_event()
const override {
return this->any_data.is_event(); }
213 return dynamic_cast<CListRecordECAT8_32bit const*
>(&e2) != 0 && raw == dynamic_cast<CListRecordECAT8_32bit const&>(e2).raw;
218 : event_data(proj_data_info_sptr)
221 virtual Succeeded init_from_data_ptr(
const char*
const data_ptr,
227 const bool do_byte_swap)
230 std::copy(data_ptr, data_ptr + 4, reinterpret_cast<char*>(&raw));
232 ByteOrder::swap_order(raw);
233 this->any_data.init_from_data_ptr(&raw);
235 if (this->any_data.is_time())
236 return this->time_data.init_from_data_ptr(&raw);
237 else if (this->any_data.is_event())
238 return this->event_data.init_from_data_ptr(&raw);
240 return Succeeded::yes;
244 size_of_record_at_ptr(
const char*
const ,
const std::size_t ,
const bool )
const 252 CListDataAnyECAT8_32bit any_data;
Class for storing and using a coincidence event from a list mode file for a cylindrical scanner...
Definition: CListEventCylindricalScannerWithDiscreteDetectors.h:31
This file declares the stir::ByteOrder class.
Declaration of class stir::Succeeded.
Class for decoding storing and using a raw coincidence event from a listmode file from the ECAT 966 s...
Definition: CListRecordECAT8_32bit.h:47
Declaration of class stir::ProjDataInfoCylindrical.
Succeeded set_prompt(const bool prompt=true) override
Changes the event from prompt to delayed or vice versa.
Definition: CListRecordECAT8_32bit.h:95
Class for records in a PET list mode file.
Definition: CListRecord.h:66
A class for storing and using a timing 'event' from a listmode file from the ECAT 8_32bit scanner...
Definition: CListRecordECAT8_32bit.h:159
A class for decoding a raw events that is neither time or coincidence in a listmode file from the ECA...
Definition: CListRecordECAT8_32bit.h:119
Class for storing and using a coincidence event from a listmode file from Siemens scanners using the ...
Definition: CListRecordECAT8_32bit.h:72
Declaration of the stir::round functions.
Definition of STIRIsNativeByteOrderBigEndian and STIRIsNativeByteOrderLittleEndian preprocessor symbo...
A class for a general element of a listmode file for a Siemens scanner using the ECAT8 32bit format...
Definition: CListRecordECAT8_32bit.h:195
Declarations of class stir::CListEventCylindricalScannerWithDiscreteDetectors.
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition: Succeeded.h:43
Declarations of classes stir::CListRecord, and stir::CListEvent which are used for list mode data...
A class for storing and using a timing record from a listmode file.
Definition: ListTime.h:46
A class for storing 2 coordinates-sets of a detection, together with a timing-position index (for TOF...
Definition: DetectionPositionPair.h:40
Declaration of class stir::DetectionPositionPair.