STIR  6.2.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 */
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 
31 START_NAMESPACE_STIR
32 START_NAMESPACE_ECAT
33 START_NAMESPACE_ECAT7
34 
36 
47 template <class CListRecordT>
49 {
50 public:
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 
67  virtual SavedPosition save_get_position();
68 
69  virtual Succeeded set_get_position(const SavedPosition&);
70 
72 
73  virtual bool has_delayeds() const { return true; }
74 
75 private:
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 
90 END_NAMESPACE_ECAT7
91 END_NAMESPACE_ECAT
92 END_NAMESPACE_STIR
93 
94 #endif
The base class for reading PET (i.e. coincidence) list mode data.The only difference w...
Definition: CListModeData.h:50
Declaration of routines which convert CTI things into our building blocks and vice versa...
A class that reads the listmode data for ECAT scanners.
Definition: CListModeDataECAT.h:48
Declaration of class stir::InputStreamWithRecords.
unsigned int SavedPosition
Use this typedef for save/set_get_position.
Definition: ListModeData.h:130
Class for records in a PET list mode file.
Definition: CListRecord.h:66
Declaration of class stir::CListModeData.
virtual bool has_delayeds() const
returns true, as ECAT listmode data stores delayed events (and prompts)
Definition: CListModeDataECAT.h:73
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition: Succeeded.h:43
Declaration of routines which convert ECAT things into our building blocks and vice versa...