STIR 6.5.0
SinglesRatesFromJSON.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2026, London South Bank University
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
18#ifndef __stir_data_SinglesRatesFromJSON_H__
19#define __stir_data_SinglesRatesFromJSON_H__
20
23#include <string>
24#include <vector>
25
26START_NAMESPACE_STIR
27
53class SinglesRatesFromJSON : public RegisteredParsingObject<SinglesRatesFromJSON, SinglesRates, SinglesRatesForTimeFrames>
54{
55public:
57 static constexpr const char* const registered_name = "SinglesRatesFromJSON";
58
59 SinglesRatesFromJSON() { set_defaults(); }
60
62
65 bool read_from_file(const std::string& filename);
66
68 float get_singles_rate(const DetectionPosition<>& det_pos, const double start_time, const double end_time) const override;
69
70private:
71private:
72 void set_defaults() override;
73 void initialise_keymap() override;
74 bool post_processing() override;
75
76 std::string _filename;
77 int _num_axial_buckets = 0;
78 int _num_transaxial_buckets = 0;
79 int _num_rings = 0;
80 int _num_detectors_per_ring = 0;
81};
82
83END_NAMESPACE_STIR
84
85#endif
Declaration of class stir::RegisteredParsingObject.
Declaration of class stir::SinglesRatesForTimeFrames.
A class for storing coordinates of a detection.
Definition DetectionPosition.h:61
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files.
Definition RegisteredParsingObject.h:78
static constexpr const char *const registered_name
Name which will be used when parsing a SinglesRatesFromJSON object.
Definition SinglesRatesFromJSON.h:57
unique_ptr< DataT > read_from_file(const FileSignature &signature, FileT file)
Function that reads data from file using the default InputFileFormatRegistry, using the provided File...
Definition read_from_file.h:46