STIR  6.2.0
TimeFrameDefinitions.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 - 2007-10-08, Hammersmith Imanet Ltd
3  Copyright (C) 2013, University College London
4  This file is part of STIR.
5 
6  SPDX-License-Identifier: Apache-2.0
7 
8  See STIR/LICENSE.txt for details
9 */
18 #ifndef __stir_TimeFrameDefinitions_H__
19 #define __stir_TimeFrameDefinitions_H__
20 
21 #include "stir/common.h"
22 #include <string>
23 #include <vector>
24 #include <utility>
25 
26 START_NAMESPACE_STIR
39 {
40 public:
43 
45 
61  explicit TimeFrameDefinitions(const std::string& fdef_filename);
62 
64 
66  TimeFrameDefinitions(const std::vector<std::pair<double, double>>&);
67 
69 
70  TimeFrameDefinitions(const std::vector<double>& start_times, const std::vector<double>& durations);
71 
73  TimeFrameDefinitions(const TimeFrameDefinitions&, unsigned int frame_num);
74 
76 
77  double get_start_time(unsigned int frame_num) const;
78  double get_end_time(unsigned int frame_num) const;
79  double get_duration(unsigned int frame_num) const;
81 
83  double get_start_time() const;
85  double get_end_time() const;
86 
88  unsigned int get_num_frames() const;
90  unsigned int get_num_time_frames() const;
91 
93 
95  unsigned int get_time_frame_num(const double start_time, const double end_time) const;
96 
98  void set_num_time_frames(int num_time_frames) { frame_times.resize(num_time_frames); }
99 
101  void set_time_frame(const int frame_num, const double start, const double end);
102 
103  bool operator==(const TimeFrameDefinitions& t) const;
104 
105 private:
107  std::vector<std::pair<double, double>> frame_times;
108  void read_fdef_file(const std::string& filename);
109 };
110 
111 END_NAMESPACE_STIR
112 #endif
Class used for storing time frame durations.
Definition: TimeFrameDefinitions.h:38
basic configuration include file
void set_num_time_frames(int num_time_frames)
Set number of time frames.
Definition: TimeFrameDefinitions.h:98