STIR 6.4.0
SinglesRatesFromSglFile.h
Go to the documentation of this file.
1//
2/*
3 Copyright (C) 2000- 2007, Hammersmith Imanet Ltd
4 This file is part of STIR.
5
6 SPDX-License-Identifier: Apache-2.0
7
8 See STIR/LICENSE.txt for details
9*/
20
21#ifndef __stir_data_SinglesRatesFromSglFile_H__
22#define __stir_data_SinglesRatesFromSglFile_H__
23
26#include "stir/IO/stir_ecat7.h"
27
28START_NAMESPACE_STIR
29START_NAMESPACE_ECAT
30START_NAMESPACE_ECAT7
31
38class SinglesRatesFromSglFile : public RegisteredParsingObject<SinglesRatesFromSglFile, SinglesRates, SinglesRatesForTimeSlices>
39
40{
41public:
42 struct sgl_str
43 {
44 long int time;
45 long int num_sgl;
46 long int sgl[126]; // Total prompts and total randoms at the end.
47 };
48
49 static const unsigned SIZE_OF_SINGLES_RECORD;
50
52 static const char* const registered_name;
53
56
57 // IO Methods
58
60 int read_singles_from_sgl_file(const std::string& sgl_filename);
61
66 std::ostream& write(std::ostream& output);
67
68private:
69 std::vector<int> _total_prompts;
70 std::vector<int> _total_randoms;
71
72#ifdef HAVE_LLN_MATRIX
73 Main_header _singles_main_header;
74#endif
75
76 std::string _sgl_filename;
77
78 virtual void set_defaults();
79 virtual void initialise_keymap();
80 virtual bool post_processing();
81};
82
83END_NAMESPACE_ECAT7
84END_NAMESPACE_ECAT
85END_NAMESPACE_STIR
86
87#endif
Declaration of class stir::RegisteredParsingObject.
Declaration of class stir::SinglesRatesForTimeSlices.
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files.
Definition RegisteredParsingObject.h:78
int read_singles_from_sgl_file(const std::string &sgl_filename)
The function that reads singles from *.sgl file.
Definition SinglesRatesFromSglFile.cxx:70
static const char *const registered_name
Name which will be used when parsing a SinglesRatesFromSglFile object.
Definition SinglesRatesFromSglFile.h:52
std::ostream & write(std::ostream &output)
Write the object to a stream in SGL format.
Definition SinglesRatesFromSglFile.cxx:215
SinglesRatesFromSglFile()
Default constructor.
Definition SinglesRatesFromSglFile.cxx:66
Declaration of routines which convert CTI things into our building blocks and vice versa.