20 #ifndef __stir_listmode_CListRecordECAT966_H__ 21 #define __stir_listmode_CListRecordECAT966_H__ 33 #include "boost/static_assert.hpp" 34 #include "boost/cstdint.hpp" 59 void get_sinogram_and_ring_coordinates(
int& view,
int& tangential_pos_num,
unsigned int& ring_a,
unsigned int& ring_b)
const;
62 void set_sinogram_and_ring_coordinates(
const int view_num,
const int tangential_pos_num,
const int ring_a,
const int ring_b);
79 #if STIRIsNativeByteOrderBigEndian 81 unsigned block_B_ring : 3;
82 unsigned block_A_ring : 3;
83 unsigned block_B_detector : 3;
84 unsigned block_A_detector : 3;
93 unsigned block_A_detector : 3;
94 unsigned block_B_detector : 3;
95 unsigned block_A_ring : 3;
96 unsigned block_B_ring : 3;
108 DataType get_data()
const {
return this->data; }
113 shared_ptr<Scanner>(
new Scanner(Scanner::E966)))
116 Succeeded init_from_data_ptr(
const void*
const ptr)
118 const char*
const data_ptr =
reinterpret_cast<const char* const
>(ptr);
119 std::copy(data_ptr, data_ptr +
sizeof(this->raw), reinterpret_cast<char*>(&this->raw));
120 return Succeeded::yes;
122 inline bool is_prompt()
const {
return this->data.delayed == 0; }
126 this->data.delayed = 0;
128 this->data.delayed = 1;
129 return Succeeded::yes;
149 #if STIRIsNativeByteOrderBigEndian 167 Succeeded init_from_data_ptr(
const void*
const ptr)
169 const char*
const data_ptr =
reinterpret_cast<const char* const
>(ptr);
170 std::copy(data_ptr, data_ptr +
sizeof(this->raw), reinterpret_cast<char*>(&this->raw));
171 return Succeeded::yes;
173 bool is_time()
const {
return this->data.type == 1U; }
174 inline unsigned long get_time_in_millisecs()
const {
return static_cast<unsigned long>(this->data.time); }
175 inline Succeeded set_time_in_millisecs(
const unsigned long time_in_millisecs)
177 this->data.time = ((1U << 28) - 1) &
static_cast<unsigned>(time_in_millisecs);
179 return Succeeded::yes;
181 inline unsigned int get_gating()
const {
return this->data.gating; }
182 inline Succeeded set_gating(
unsigned int g)
184 this->data.gating = g & 0xf;
185 return this->data.gating == g ? Succeeded::yes : Succeeded::no;
205 bool is_time()
const {
return this->time_data.is_time(); }
206 bool is_gating_input()
const {
return this->is_time(); }
207 bool is_event()
const {
return !this->is_time(); }
213 virtual const CListTimeECAT966& gating_input()
const {
return this->time_data; }
217 return dynamic_cast<CListRecordECAT966 const*
>(&e2) != 0 && raw == dynamic_cast<CListRecordECAT966 const&>(e2).raw;
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->time_data.init_from_data_ptr(&raw);
235 if (!this->is_time())
236 return this->event_data.init_from_data_ptr(&raw);
238 return Succeeded::yes;
242 size_of_record_at_ptr(
const char*
const ,
const std::size_t ,
const bool )
const Declarations of class stir::ListTime which is used for list mode data.
This file declares the stir::ByteOrder class.
Declaration of class stir::Succeeded.
A class for decoding a raw timing 'event' from a listmode file from the ECAT 966 scanner.
Definition: CListRecordECAT966.h:146
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 decoding storing and using a raw coincidence event from a listmode file from the ECAT 966 s...
Definition: CListRecordECAT966.h:54
Succeeded set_prompt(const bool prompt=true)
Changes the event from prompt to delayed or vice versa.
Definition: CListRecordECAT966.h:123
unsigned int get_gating() const
get gating-related info
Definition: CListRecordECAT966.h:181
Declaration of the stir::round functions.
Definition of class stir::CListEventCylindricalScannerWithViewTangRingRingEncoding.
A class for storing and using a timing 'event' from a listmode file from the ECAT 966 scanner...
Definition: CListRecordECAT966.h:164
Definition of STIRIsNativeByteOrderBigEndian and STIRIsNativeByteOrderLittleEndian preprocessor symbo...
Class for storing and using a coincidence event from a listmode file from the ECAT 966 scanner...
Definition: CListRecordECAT966.h:103
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
A class for a general element of a listmode file.
Definition: CListRecordECAT966.h:200
Declaration of routines which convert ECAT things into our building blocks and vice versa...
Declaration of class stir::DetectionPositionPair.