STIR 6.4.0
CListModeDataECAT.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2003- 2011, Hammersmith Imanet Ltd
3 Copyright (C) 2014, University College London
4 This file is part of STIR.
5
6 SPDX-License-Identifier: Apache-2.0
7
8 See STIR/LICENSE.txt for details
9*/
17
18#ifndef __stir_listmode_CListModeDataECAT_H__
19#define __stir_listmode_CListModeDataECAT_H__
20
23#ifdef HAVE_LLN_MATRIX
24# include "stir/IO/stir_ecat7.h"
25#else
26# include "stir/IO/stir_ecat_common.h" // for namespace macros
27#endif
28#include <iostream>
29#include <vector>
30
31START_NAMESPACE_STIR
32START_NAMESPACE_ECAT
33START_NAMESPACE_ECAT7
34
36
47template <class CListRecordT>
49{
50public:
52
57 CListModeDataECAT(const std::string& listmode_filename_prefix);
58
59 virtual std::string get_name() const;
60
61 virtual shared_ptr<CListRecord> get_empty_record_sptr() const;
62
63 virtual Succeeded get_next_record(CListRecord& record) const;
64
65 virtual Succeeded reset();
66
68
70
72
73 virtual bool has_delayeds() const { return true; }
74
75private:
76 std::string listmode_filename_prefix;
77 mutable unsigned int current_lm_file;
78 mutable shared_ptr<InputStreamWithRecords<CListRecordT, bool>> current_lm_data_ptr;
80 mutable std::vector<std::vector<std::streampos>> saved_get_positions_for_each_lm_data;
81 typedef std::pair<unsigned int, SavedPosition> GetPosition;
82 std::vector<GetPosition> saved_get_positions;
83
84 // const as it modifies only mutable elements
85 // It has to be const as e.g. get_next_record calls it
86 Succeeded open_lm_file(unsigned int) const;
87 // shared_ptr<Scanner> scanner_sptr;
88};
89
90END_NAMESPACE_ECAT7
91END_NAMESPACE_ECAT
92END_NAMESPACE_STIR
93
94#endif
Declaration of class stir::CListModeData.
Declaration of class stir::InputStreamWithRecords.
The base class for reading PET (i.e. coincidence) list mode data.
Definition CListModeData.h:51
Class for records in a PET list mode file.
Definition CListRecord.h:67
unsigned int SavedPosition
Use this typedef for save/set_get_position.
Definition ListModeData.h:129
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition Succeeded.h:44
virtual Succeeded get_next_record(CListRecord &record) const
Definition CListModeDataECAT.cxx:212
CListModeDataECAT(const std::string &listmode_filename_prefix)
Constructor taking a prefix for the filename.
Definition CListModeDataECAT.cxx:49
virtual SavedPosition save_get_position()
Save the current reading position.
Definition CListModeDataECAT.cxx:246
virtual Succeeded reset()
Call this function if you want to re-start reading at the beginning.
Definition CListModeDataECAT.cxx:230
virtual shared_ptr< CListRecord > get_empty_record_sptr() const
Get a pointer to an empty record.
Definition CListModeDataECAT.cxx:151
virtual std::string get_name() const
Returns the name of the list mode data.
Definition CListModeDataECAT.cxx:144
virtual Succeeded set_get_position(const SavedPosition &)
Set the position for reading to a previously saved point.
Definition CListModeDataECAT.cxx:257
virtual bool has_delayeds() const
returns true, as ECAT listmode data stores delayed events (and prompts)
Definition CListModeDataECAT.h:73
Declaration of routines which convert CTI things into our building blocks and vice versa.
Declaration of routines which convert ECAT things into our building blocks and vice versa.