STIR  6.2.0
CListModeDataSAFIR.h
Go to the documentation of this file.
1 /* CListModeDataSAFIR.h
2 
3  Coincidence LM Data Class for SAFIR: Header File
4  Jannis Fischer
5 
6  Copyright 2015 ETH Zurich, Institute of Particle Physics
7  Copyright 2020 Positrigo AG, Zurich
8 
9  Licensed under the Apache License, Version 2.0 (the "License");
10  you may not use this file except in compliance with the License.
11  You may obtain a copy of the License at
12 
13  http://www.apache.org/licenses/LICENSE-2.0
14 
15  Unless required by applicable law or agreed to in writing, software
16  distributed under the License is distributed on an "AS IS" BASIS,
17  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  See the License for the specific language governing permissions and
19  limitations under the License.
20 
21  */
22 
32 #ifndef __stir_listmode_CListModeDataSAFIR_H__
33 #define __stir_listmode_CListModeDataSAFIR_H__
34 
35 #include <iostream>
36 #include <string>
37 #include <utility>
38 #include <vector>
39 
41 #include "stir/ProjData.h"
42 #include "stir/ProjDataInfo.h"
45 #include "stir/shared_ptr.h"
46 
49 
50 START_NAMESPACE_STIR
51 
59 template <class CListRecordT>
61 {
62 public:
68  CListModeDataSAFIR(const std::string& listmode_filename,
69  const std::string& crystal_map_filename,
70  const std::string& template_proj_data_filename,
71  const double lor_randomization_sigma = 0.0);
72  CListModeDataSAFIR(const std::string& listmode_filename, const shared_ptr<const ProjDataInfo>& proj_data_info_sptr);
73 
74  std::string get_name() const override;
75  shared_ptr<CListRecord> get_empty_record_sptr() const override;
76  Succeeded get_next_record(CListRecord& record_of_general_type) const override;
77  Succeeded reset() override;
78 
84  SavedPosition save_get_position() override { return static_cast<SavedPosition>(current_lm_data_ptr->save_get_position()); }
85  Succeeded set_get_position(const SavedPosition& pos) override { return current_lm_data_ptr->set_get_position(pos); }
86 
91  bool has_delayeds() const override { return false; }
92 
93 private:
94  std::string listmode_filename;
95  mutable shared_ptr<InputStreamWithRecords<CListRecordT, bool>> current_lm_data_ptr;
96  mutable std::vector<unsigned int> saved_get_positions;
97  Succeeded open_lm_file() const;
98  shared_ptr<DetectorCoordinateMap> map;
99 };
100 
101 END_NAMESPACE_STIR
102 
103 #endif
The base class for reading PET (i.e. coincidence) list mode data.The only difference w...
Definition: CListModeData.h:50
Declaration of class stir::ProjDataInfo.
Declaration of class stir::InputStreamWithRecords.
SavedPosition save_get_position() override
Definition: CListModeDataSAFIR.h:84
unsigned int SavedPosition
Use this typedef for save/set_get_position.
Definition: ListModeData.h:130
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast (or corresponding b...
Declaration of class stir::ProjData.
Class for records in a PET list mode file.
Definition: CListRecord.h:66
Declaration of class stir::DetectorCoordinateMap.
Declaration of class stir::CListModeData.
Declaration of class stir::CListEventSAFIR and stir::CListRecordSAFIR with supporting classes...
bool has_delayeds() const override
Definition: CListModeDataSAFIR.h:91
Class for reading SAFIR listmode data with variable geometry.
Definition: CListModeDataSAFIR.h:60
Succeeded set_get_position(const SavedPosition &pos) override
Set the position for reading to a previously saved point.
Definition: CListModeDataSAFIR.h:85
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...