STIR  6.2.0
CListModeDataPENN.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2020-2022 University of Pennsylvania
3  This file is part of STIR.
4 
5  SPDX-License-Identifier: Apache-2.0
6 
7  See STIR/LICENSE.txt for details
8 */
17 #ifndef __stir_listmode_CListModeDataPENN_H__
18 #define __stir_listmode_CListModeDataPENN_H__
19 
23 #include "stir/shared_ptr.h"
24 
25 START_NAMESPACE_STIR
28 {
29 public:
31  CListModeDataPENN(const std::string& listmode_filename_prefix);
32 
33  virtual std::string get_name() const;
34 
35  virtual shared_ptr<CListRecord> get_empty_record_sptr() const;
36 
37  virtual Succeeded get_next_record(CListRecord& record) const;
38 
39  virtual Succeeded reset();
40 
41  virtual SavedPosition save_get_position();
42 
43  virtual Succeeded set_get_position(const SavedPosition&);
44 
46  virtual inline unsigned long int get_total_number_of_events() const
47  {
48  shared_ptr<CListRecord> sptr(new CListRecordT(this->get_proj_data_info_sptr()->get_scanner_sptr()));
49  CListRecordPENN& record = static_cast<CListRecordPENN&>(*sptr);
50 
51  return lm_data_sptr->get_total_number_of_events(record);
52  }
53 
54  virtual bool has_delayeds() const { return true; }
55 
56  // inline const PET::ListFileHeader* get_file_header() const
57  // {
58  // return current_lm_data_ptr->get_file_header();
59  // }
60 
61  inline void set_output_filename(const std::string ofname) { lm_data_sptr->create_output_file(ofname); }
62 
63  inline void set_event() { lm_data_sptr->set_current_record(); }
64 
65  void set_event(const bool& is_delay,
66  const short int& _dt,
67  const unsigned short int& _xa,
68  const unsigned short int& _xb,
69  const unsigned short int& _za,
70  const unsigned short int& _zb,
71  const unsigned short int& _ea,
72  const unsigned short int& _eb);
73 
74 private:
75  typedef CListRecordPENN CListRecordT;
76  std::string listmode_filename;
77  shared_ptr<InputStreamWithRecordsFromUPENN> lm_data_sptr;
78 
79  std::string filename;
80 };
81 
82 END_NAMESPACE_STIR
83 
84 #endif
The base class for reading PET (i.e. coincidence) list mode data.The only difference w...
Definition: CListModeData.h:50
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
Classes for listmode events for the PENNPET Explorer scanner.
Declaration of class stir::CListModeData.
Declaration of class stir::InputStreamWithRecordsFromUPENN.
virtual unsigned long int get_total_number_of_events() const
The safest way to get the total number of events is to count them.
Definition: CListModeDataPENN.h:46
virtual bool has_delayeds() const
Return if the file stores delayed events as well (as opposed to prompts)
Definition: CListModeDataPENN.h:54
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition: Succeeded.h:43
Base class for listmode data for PENNPET Explorer scanner.
Definition: CListModeDataPENN.h:27