STIR  6.2.0
CListModeDataLMF.h
Go to the documentation of this file.
1 //
2 //
11 /*
12  Copyright (C) 2003- 2004, Hammersmith Imanet Ltd
13 
14  SPDX-License-Identifier: Apache-2.0
15  See STIR/LICENSE.txt for details
16 */
17 
18 #ifndef __stir_listmode_CListModeDataLMF_H__
19 #define __stir_listmode_CListModeDataLMF_H__
20 
22 #include "stir/shared_ptr.h"
23 #include "LMF/lmf.h" // TODO adjust location
24 //#include "LMF/LMF_ClearPET.h" // TODO don't know which is needed
25 //#include "LMF/LMF_Interfile.h"
26 
27 #include <stdio.h>
28 #include <string>
29 #include <vector>
30 
31 START_NAMESPACE_STIR
32 
35 {
36 public:
38  CListModeDataLMF(const std::string& listmode_filename);
39 
40  // Destructor closes the file and destroys various structures
42 
43  virtual std::time_t get_scan_start_time_in_secs_since_1970() const { return std::time_t(-1); } // TODO
44 
45  virtual shared_ptr<CListRecord> get_empty_record_sptr() const;
46 
48  virtual bool has_delayeds() const { return true; } // TODO always?
49 
50  virtual Succeeded get_next_record(CListRecord& event) const;
51 
52  virtual Succeeded reset();
53 
54  virtual SavedPosition save_get_position();
55 
56  virtual Succeeded set_get_position(const SavedPosition&);
57 
58 private:
59  string listmode_filename;
60  // TODO we really want to make this a shared_ptr I think to avoid memory leaks when throwing exceptions
61  struct LMF_ccs_encodingHeader* pEncoH;
62  FILE* pfCCS;
63 
64  // possibly use this from LMF2Projection
65  // SCANNER_CHECK_LIST scanCheckList;
66  std::vector<unsigned long> saved_get_positions;
67 };
68 
69 END_NAMESPACE_STIR
70 
71 #endif
The base class for reading PET (i.e. coincidence) list mode data.The only difference w...
Definition: CListModeData.h:50
virtual bool has_delayeds() const
LMF listmode data stores delayed events as well (as opposed to prompts)
Definition: CListModeDataLMF.h:48
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...
Class for records in a PET list mode file.
Definition: CListRecord.h:66
Declaration of class stir::CListModeData.
A class that reads the listmode data from an LMF file.
Definition: CListModeDataLMF.h:34
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition: Succeeded.h:43