STIR 6.4.0
ListModeData.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2003 - 2011-06-24, Hammersmith Imanet Ltd
3 Copyright (C) 2011-07-01 - 2014, Kris Thielemans
4 Copyright (C) 2019, National Physical Laboratory
5 Copyright (C) 2019, University College of London
6 This file is part of STIR.
7
8 SPDX-License-Identifier: Apache-2.0
9
10 See STIR/LICENSE.txt for details
11*/
20
21#ifndef __stir_listmode_ListModeData_H__
22#define __stir_listmode_ListModeData_H__
23
24#include <string>
25#include <ctime>
27#include "stir/ExamData.h"
30#include "stir/error.h"
31#ifdef BOOST_NO_STDC_NAMESPACE
32namespace std
33{
34using ::time_t;
35}
36#endif
37
38START_NAMESPACE_STIR
39class ListRecord;
40class Succeeded;
41
123{
124public:
127
129 typedef unsigned int SavedPosition;
130
132 ListModeData();
133
134 ListModeData(shared_ptr<const ExamInfo> exam_info_sptr, shared_ptr<const ProjDataInfo> proj_data_info_sptr)
135 : ExamData(exam_info_sptr),
136 DataWithProjDataInfo(proj_data_info_sptr)
137 {}
138
139 ~ListModeData() override;
140
142
150 virtual std::string get_name() const = 0;
151
152#if 0
154
160 virtual
161 std::time_t
162 get_scan_start_time_in_secs_since_1970() const;
163#endif
164
166
169
170 shared_ptr<ListRecord> get_empty_record_sptr() const
171 {
172 return this->get_empty_record_helper_sptr();
173 }
174
177 {
178 return get_next(event);
179 }
180
182 virtual Succeeded reset() = 0;
183
185
203
205
207
209
212 const Scanner& get_scanner() const;
213
215 virtual bool has_delayeds() const = 0;
217
222 virtual inline unsigned long int get_total_number_of_events() const
223 {
224 error("ListModeData: The function get_total_number_of_events() is currently not supported for this file format.");
225 return 0;
226 }
227
228protected:
229 virtual shared_ptr<ListRecord> get_empty_record_helper_sptr() const = 0;
230 virtual Succeeded get_next(ListRecord& event) const = 0;
231 virtual void set_proj_data_info_sptr(shared_ptr<const ProjDataInfo>);
232};
233
234END_NAMESPACE_STIR
235
236#endif
declaration of stir::DataWithProjDataInfo
declaration of stir::ExamData
Declarations of classes stir::ListRecord which is used for list mode data.
Declaration of class stir::RegisteredParsingObject.
DataWithProjDataInfo()
Default constructor sets internal member to 0.
Definition DataWithProjDataInfo.cxx:20
ExamData()
ExamData.
Definition ExamData.cxx:21
The base class for reading list mode data.
Definition ListModeData.h:123
shared_ptr< ListRecord > get_empty_record_sptr() const
Get a pointer to an empty record.
Definition ListModeData.h:170
ListModeData hierarchy_base_type
typedef used by read_from_file
Definition ListModeData.h:126
const Scanner & get_scanner() const
Get reference to scanner.
Definition ListModeData.cxx:34
virtual Succeeded set_get_position(const SavedPosition &)=0
Set the position for reading to a previously saved point.
unsigned int SavedPosition
Use this typedef for save/set_get_position.
Definition ListModeData.h:129
virtual bool has_delayeds() const =0
Return if the file stores delayed events as well (as opposed to prompts)
virtual SavedPosition save_get_position()=0
Save the current reading position.
virtual std::string get_name() const =0
Returns the name of the list mode data.
virtual Succeeded get_next_record(ListRecord &event) const
Gets the next record in the listmode sequence.
Definition ListModeData.h:176
virtual unsigned long int get_total_number_of_events() const
Returns the total number of events in the listmode file.
Definition ListModeData.h:222
virtual Succeeded reset()=0
Call this function if you want to re-start reading at the beginning.
ListModeData()
Default constructor.
Definition ListModeData.cxx:27
A class for a general element of a list mode file.
Definition ListRecord.h:45
A class for storing some info on the scanner.
Definition Scanner.h:108
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition Succeeded.h:44
Declaration of stir::error()
void error(const char *const s,...)
Print error with format string a la printf and throw exception.
Definition error.cxx:42