STIR 6.4.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
31
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
50START_NAMESPACE_STIR
51
59template <class CListRecordT>
61{
62public:
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
93private:
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
101END_NAMESPACE_STIR
102
103#endif
Declaration of class stir::CListModeData.
Declaration of class stir::CListEventSAFIR and stir::CListRecordSAFIR with supporting classes.
Declarations of classes stir::CListRecord, and stir::CListEvent which are used for list mode data.
Declaration of class stir::DetectorCoordinateMap.
Declaration of class stir::InputStreamWithRecords.
Declaration of class stir::ProjDataInfo.
Declaration of class stir::ProjData.
Succeeded reset() override
Call this function if you want to re-start reading at the beginning.
Definition CListModeDataSAFIR.cxx:127
SavedPosition save_get_position() override
Definition CListModeDataSAFIR.h:84
bool has_delayeds() const override
Definition CListModeDataSAFIR.h:91
Succeeded get_next_record(CListRecord &record_of_general_type) const override
Gets the next record in the listmode sequence.
Definition CListModeDataSAFIR.cxx:117
shared_ptr< CListRecord > get_empty_record_sptr() const override
Get a pointer to an empty record.
Definition CListModeDataSAFIR.cxx:107
CListModeDataSAFIR(const std::string &listmode_filename, const std::string &crystal_map_filename, const std::string &template_proj_data_filename, const double lor_randomization_sigma=0.0)
Definition CListModeDataSAFIR.cxx:53
Succeeded set_get_position(const SavedPosition &pos) override
Set the position for reading to a previously saved point.
Definition CListModeDataSAFIR.h:85
std::string get_name() const override
Returns the name of the list mode data.
Definition CListModeDataSAFIR.cxx:100
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
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast into the stir names...