20 #ifndef __stir_listmode_CListRecordECAT962_H__ 21 #define __stir_listmode_CListRecordECAT962_H__ 34 #include "boost/static_assert.hpp" 35 #include "boost/cstdint.hpp" 59 inline bool is_prompt()
const {
return delayed == 0; }
60 inline Succeeded set_prompt(
const bool prompt =
true)
66 return Succeeded::yes;
71 void get_sinogram_and_ring_coordinates(
int& view,
int& tangential_pos_num,
unsigned int& ring_a,
unsigned int& ring_b)
const;
74 void set_sinogram_and_ring_coordinates(
const int view_num,
75 const int tangential_pos_num,
76 const unsigned int ring_a,
77 const unsigned int ring_b);
91 #if STIRIsNativeByteOrderBigEndian 93 unsigned block_A_ring_bit1 : 1;
94 unsigned block_B_ring_bit1 : 1;
95 unsigned block_A_ring_bit0 : 1;
96 unsigned block_B_ring_bit0 : 1;
97 unsigned block_B_detector : 3;
98 unsigned block_A_detector : 3;
100 unsigned delayed : 1;
101 unsigned multiple : 1;
108 unsigned multiple : 1;
109 unsigned delayed : 1;
110 unsigned scatter : 1;
111 unsigned block_A_detector : 3;
112 unsigned block_B_detector : 3;
113 unsigned block_B_ring_bit0 : 1;
114 unsigned block_A_ring_bit0 : 1;
115 unsigned block_B_ring_bit1 : 1;
116 unsigned block_A_ring_bit1 : 1;
127 CListEventECAT962() :
131 Succeeded init_from_data_ptr(
const void *
const ptr)
133 const char *
const data_ptr =
reinterpret_cast<const char *
const >(ptr);
134 std::copy(data_ptr, data_ptr+
sizeof(this->raw), reinterpret_cast<char *>(&this->raw));
135 return Succeeded::yes;
137 inline bool is_prompt()
const {
return this->data.delayed == 0; }
138 inline Succeeded set_prompt(
const bool prompt =
true)
139 {
if (prompt) this->data.delayed=0;
else this->data.delayed=1;
return Succeeded::yes; }
157 inline unsigned long get_time_in_millisecs()
const {
return static_cast<unsigned long>(time); }
158 inline Succeeded set_time_in_millisecs(
const unsigned long time_in_millisecs)
160 time = ((1U << 28) - 1) &
static_cast<unsigned>(time_in_millisecs);
162 return Succeeded::yes;
164 inline unsigned int get_gating()
const {
return gating; }
165 inline Succeeded set_gating(
unsigned int g)
168 return gating == g ? Succeeded::yes : Succeeded::no;
172 #if STIRIsNativeByteOrderBigEndian 194 DataType get_data()
const {
return this->event_data; }
199 shared_ptr<Scanner>(
new Scanner(Scanner::E962)))
202 bool is_time()
const {
return time_data.type == 1U; }
203 bool is_gating_input()
const {
return this->is_time(); }
204 bool is_event()
const {
return time_data.type == 0U; }
206 virtual const CListEvent& event()
const {
return *
this; }
207 virtual ListTime& time() {
return *
this; }
208 virtual const ListTime& time()
const {
return *
this; }
214 return dynamic_cast<CListRecordECAT962 const*
>(&e2) != 0 && raw == static_cast<CListRecordECAT962 const&>(e2).raw;
218 inline unsigned long get_time_in_millisecs()
const {
return time_data.get_time_in_millisecs(); }
219 inline Succeeded set_time_in_millisecs(
const unsigned long time_in_millisecs)
221 return time_data.set_time_in_millisecs(time_in_millisecs);
223 inline unsigned int get_gating()
const {
return time_data.get_gating(); }
224 inline Succeeded set_gating(
unsigned int g) {
return time_data.set_gating(g); }
227 inline bool is_prompt()
const {
return event_data.is_prompt(); }
230 virtual Succeeded init_from_data_ptr(
const char*
const data_ptr,
236 const bool do_byte_swap)
239 std::copy(data_ptr, data_ptr + 4, reinterpret_cast<char*>(&raw));
241 ByteOrder::swap_order(raw);
242 return Succeeded::yes;
245 size_of_record_at_ptr(
const char*
const ,
const std::size_t ,
const bool )
const 257 BOOST_STATIC_ASSERT(
sizeof(boost::int32_t) == 4);
Declarations of class stir::ListTime which is used for list mode data.
This file declares the stir::ByteOrder class.
Declaration of class stir::Succeeded.
Declaration of class stir::ProjDataInfoCylindricalNoArcCorr.
A class for storing and using a timing 'event' from a listmode file.
Definition: CListRecordECAT962.h:154
Class for storing and using a coincidence event from a listmode file.
Definition: CListRecordECAT962.h:56
Succeeded set_prompt(const bool prompt=true)
Changes the event from prompt to delayed or vice versa.
Definition: CListRecordECAT962.h:228
Declaration of class stir::ProjDataInfoCylindrical.
Class for records in a PET list mode file.
Definition: CListRecord.h:66
A class for storing some info on the scanner.
Definition: Scanner.h:107
Class for storing and using a coincidence event from a list mode file.
Definition: CListRecord.h:52
unsigned int get_gating() const
get gating-related info
Definition: CListRecordECAT962.h:223
Declaration of the stir::round functions.
Definition of class stir::CListEventCylindricalScannerWithViewTangRingRingEncoding.
Definition of STIRIsNativeByteOrderBigEndian and STIRIsNativeByteOrderLittleEndian preprocessor symbo...
A class for a general element of a listmode file.
Definition: CListRecordECAT962.h:187
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
Helper class for listmode events when using 2d sinograms and ring-pairs is most efficient.
Definition: CListEventCylindricalScannerWithViewTangRingRingEncoding.h:61
Declaration of routines which convert ECAT things into our building blocks and vice versa...