STIR  6.2.0
ModelMatrix.h
Go to the documentation of this file.
1 //
2 //
3 /*
4  Copyright (C) 2006 - 2011, Hammersmith Imanet Ltd
5  This file is part of STIR.
6 
7  SPDX-License-Identifier: Apache-2.0
8 
9  See STIR/LICENSE.txt for details
10 */
19 #ifndef __stir_modelling_ModelMatrix_H__
20 #define __stir_modelling_ModelMatrix_H__
21 
22 #include "stir/Array.h"
23 #include "stir/BasicCoordinate.h"
24 #include "stir/VectorWithOffset.h"
27 #include "stir/Succeeded.h"
28 #include <fstream>
29 #include <iostream>
30 
31 START_NAMESPACE_STIR
33 
35 template <int num_param>
37 {
38 public:
39  inline ModelMatrix();
40 
41  inline ~ModelMatrix();
42 
46  inline void read_from_file(const std::string input_string);
47 
49  inline Succeeded write_to_file(const std::string output_string);
50 
52  inline Array<2, float> get_model_array() const;
53  inline const VectorWithOffset<float> get_model_array_sum() const;
54  inline VectorWithOffset<float> get_time_vector() const;
57  inline void set_model_array(const Array<2, float>& model_array);
58  inline void set_time_vector(const VectorWithOffset<float>& time_vector);
60  inline void set_is_uncalibrated(const bool is_uncalibrated);
61  inline void set_is_in_correct_scale(const bool in_correct_scale);
63 
65  inline void threshold_model_array(const float threshold_value);
66 
71  inline void uncalibrate(const float cal_factor);
72 
76  inline void scale_model_matrix(const float scale_factor);
77 
82  inline void convert_to_total_frame_counts(const TimeFrameDefinitions& time_frame_definitions);
83 
88  inline void multiply_dynamic_image_with_model_and_add_to_input(ParametricVoxelsOnCartesianGrid& parametric_image,
90  const DynamicDiscretisedDensity& dynamic_image) const;
92 
95  inline void multiply_dynamic_image_with_model(ParametricVoxelsOnCartesianGrid& parametric_image,
96  const DynamicDiscretisedDensity& dynamic_image) const;
98  inline void
99  multiply_parametric_image_with_model_and_add_to_input(DynamicDiscretisedDensity& dynamic_image,
100  const ParametricVoxelsOnCartesianGrid& parametric_image) const;
102 
105  inline void multiply_parametric_image_with_model(DynamicDiscretisedDensity& dynamic_image,
106  const ParametricVoxelsOnCartesianGrid& parametric_image) const;
107 
108  inline void normalise_parametric_image_with_model_sum(ParametricVoxelsOnCartesianGrid& parametric_image_out,
109  const ParametricVoxelsOnCartesianGrid& parametric_image) const;
111 private:
113  Array<2, float> _model_array;
114  VectorWithOffset<float> _time_vector;
115  bool _is_uncalibrated;
116  bool _in_correct_scale;
117  bool _is_converted_to_total_counts;
118 };
119 
120 END_NAMESPACE_STIR
121 
122 #include "stir/modelling/ModelMatrix.inl"
123 
124 #endif //__stir_modelling_ModelMatrix_H__
Class used for storing time frame durations.
Definition: TimeFrameDefinitions.h:38
Declaration of class stir::Succeeded.
Class to store parametric images.
Definition: ECAT7ParametricDensityOutputFileFormat.h:36
defines the Array class for multi-dimensional (numeric) arrays
Declaration of class stir::DynamicDiscretisedDensity.
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
A helper class to store the model matrix for a linear kinetic model.
Definition: ModelMatrix.h:36
This file declares class stir::BasicCoordinate and some functions acting on stir::BasicCoordinate obj...
Class of multiple image frames, one for each time frame Each time frame is a DiscretisedDensity<3,float>
Definition: DynamicDiscretisedDensity.h:45
std::string write_to_file(const std::string &filename, const DataT &data)
Function that writes data to file using the default OutputFileFormat.
Definition: write_to_file.h:47
defines the stir::VectorWithOffset class
Declaration of class stir::ParametricDiscretisedDensity.
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition: Succeeded.h:43