STIR 6.4.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*/
16
17#ifndef __stir_listmode_CListModeDataPENN_H__
18#define __stir_listmode_CListModeDataPENN_H__
19
23#include "stir/shared_ptr.h"
24
25START_NAMESPACE_STIR
28{
29public:
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
42
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
74private:
75 typedef CListRecordPENN CListRecordT;
76 std::string listmode_filename;
77 shared_ptr<InputStreamWithRecordsFromUPENN> lm_data_sptr;
78
79 std::string filename;
80};
81
82END_NAMESPACE_STIR
83
84#endif
Declaration of class stir::CListModeData.
Classes for listmode events for the PENNPET Explorer scanner.
Declaration of class stir::InputStreamWithRecordsFromUPENN.
virtual Succeeded get_next_record(CListRecord &record) const
Gets the next record in the listmode sequence.
Definition CListModeDataPENN.cxx:84
CListModeDataPENN(const std::string &listmode_filename_prefix)
Construct fron the filename of the Interfile header.
Definition CListModeDataPENN.cxx:25
virtual std::string get_name() const
Returns the name of the list mode data.
Definition CListModeDataPENN.cxx:71
virtual Succeeded set_get_position(const SavedPosition &)
Set the position for reading to a previously saved point.
Definition CListModeDataPENN.cxx:103
virtual shared_ptr< CListRecord > get_empty_record_sptr() const
Get a pointer to an empty record.
Definition CListModeDataPENN.cxx:77
virtual Succeeded reset()
Call this function if you want to re-start reading at the beginning.
Definition CListModeDataPENN.cxx:91
virtual SavedPosition save_get_position()
Save the current reading position.
Definition CListModeDataPENN.cxx:97
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
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
virtual shared_ptr< const ProjDataInfo > get_proj_data_info_sptr() const
Get shared pointer to ProjData info.
Definition DataWithProjDataInfo.cxx:37
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...