STIR  6.2.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 */
21 #ifndef __stir_data_SinglesRatesFromSglFile_H__
22 #define __stir_data_SinglesRatesFromSglFile_H__
23 
26 #include "stir/IO/stir_ecat7.h"
27 
28 START_NAMESPACE_STIR
29 START_NAMESPACE_ECAT
30 START_NAMESPACE_ECAT7
31 
38 class SinglesRatesFromSglFile : public RegisteredParsingObject<SinglesRatesFromSglFile, SinglesRates, SinglesRatesForTimeSlices>
39 
40 {
41 public:
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 
68 private:
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 
83 END_NAMESPACE_ECAT7
84 END_NAMESPACE_ECAT
85 END_NAMESPACE_STIR
86 
87 #endif
Declaration of routines which convert CTI things into our building blocks and vice versa...
A class for reading/writing singles from an ECAT7 .sgl file.
Definition: SinglesRatesFromSglFile.h:38
static const char *const registered_name
Name which will be used when parsing a SinglesRatesFromSglFile object.
Definition: SinglesRatesFromSglFile.h:52
Declaration of class stir::SinglesRatesForTimeSlices.
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files...
Definition: RegisteredParsingObject.h:77
Declaration of class stir::RegisteredParsingObject.