STIR  6.2.0
Public Member Functions | List of all members
stir::ModelMatrix< num_param > Class Template Reference

A helper class to store the model matrix for a linear kinetic model. More...

#include "stir/modelling/ModelMatrix.h"

Inheritance diagram for stir::ModelMatrix< num_param >:
Inheritance graph
[legend]

Public Member Functions

 ModelMatrix ()
 default constructor
 
 ~ModelMatrix ()
 default destructor
 
void read_from_file (const std::string input_string)
 Implementation to read the model matrix. More...
 
Succeeded write_to_file (const std::string output_string)
 Implementation to write the model matrix to a text file. More...
 
void threshold_model_array (const float threshold_value)
 Function to give the threshold_value to the all elements of the model_array which lower value than the threshold_value.
 
void uncalibrate (const float cal_factor)
 
void scale_model_matrix (const float scale_factor)
 
void convert_to_total_frame_counts (const TimeFrameDefinitions &time_frame_definitions)
 
Functions to get parameters @{
Array< 2, float > get_model_array () const
 
const VectorWithOffset< float > get_model_array_sum () const
 
VectorWithOffset< float > get_time_vector () const
 
Functions to set parameters @{
void set_model_array (const Array< 2, float > &model_array)
 
void set_time_vector (const VectorWithOffset< float > &time_vector)
 
void set_is_uncalibrated (const bool is_uncalibrated)
 Function to set _is_calibrated boolean true or false.
 
void set_is_in_correct_scale (const bool in_correct_scale)
 
void multiply_dynamic_image_with_model_and_add_to_input (ParametricVoxelsOnCartesianGrid &parametric_image, const DynamicDiscretisedDensity &dynamic_image) const
 multiply (transpose) model-matrix with dynamic image and add result to original parametric_image More...
 
void multiply_dynamic_image_with_model (ParametricVoxelsOnCartesianGrid &parametric_image, const DynamicDiscretisedDensity &dynamic_image) const
 multiply (transpose) model-matrix with dynamic image (overwriting original content of parametric_image) More...
 
void multiply_parametric_image_with_model_and_add_to_input (DynamicDiscretisedDensity &dynamic_image, const ParametricVoxelsOnCartesianGrid &parametric_image) const
 multiply model-matrix with parametric image and add result to original dynamic_image
 
void multiply_parametric_image_with_model (DynamicDiscretisedDensity &dynamic_image, const ParametricVoxelsOnCartesianGrid &parametric_image) const
 multiply model-matrix with parametric image (overwriting original content of dynamic_image) More...
 
void normalise_parametric_image_with_model_sum (ParametricVoxelsOnCartesianGrid &parametric_image_out, const ParametricVoxelsOnCartesianGrid &parametric_image) const
 

Detailed Description

template<int num_param>
class stir::ModelMatrix< num_param >

A helper class to store the model matrix for a linear kinetic model.

Member Function Documentation

◆ read_from_file()

template<int num_param>
void stir::ModelMatrix< num_param >::read_from_file ( const std::string  input_string)
inline

Implementation to read the model matrix.

Implementation to read the model matrix from a text file

Warning
In this way the information about the calibration _is_uncalibrated and the counts _is_converted is not passed.

Referenced by stir::modellingTests::run_tests().

◆ write_to_file()

template<int num_param>
Succeeded stir::ModelMatrix< num_param >::write_to_file ( const std::string  output_string)
inline

Implementation to write the model matrix to a text file.

Implementation to write the model matrix.

Referenced by stir::modellingTests::run_tests().

◆ uncalibrate()

template<int num_param>
void stir::ModelMatrix< num_param >::uncalibrate ( const float  cal_factor)
inline

Function to divide with the calibration factor the model array. Calibrated ModelMatrix means that the counts are in kBq/ml, while uncalibrated means that it will be to the same units as the reconstructed images.

◆ scale_model_matrix()

template<int num_param>
void stir::ModelMatrix< num_param >::scale_model_matrix ( const float  scale_factor)
inline

Function to multiply with the scale factor the model array. Scaled ModelMatrix means that the counts are already scaled to the correct, while not scaled means that it needs to be scaled.

◆ convert_to_total_frame_counts()

template<int num_param>
void stir::ModelMatrix< num_param >::convert_to_total_frame_counts ( const TimeFrameDefinitions time_frame_definitions)
inline

Multiply with the duration to convert the count rate to total counts in the time frame. Converted ModelMatrix means that it is in total counts in respect to the time_frame_duration, while not converted sets the _is_converted to false and means that it will be in "mean count rate".

◆ multiply_dynamic_image_with_model_and_add_to_input()

template<int num_param>
void stir::ModelMatrix< num_param >::multiply_dynamic_image_with_model_and_add_to_input ( ParametricVoxelsOnCartesianGrid parametric_image,
const DynamicDiscretisedDensity dynamic_image 
) const
inline

multiply (transpose) model-matrix with dynamic image and add result to original parametric_image

Multiplications of the model with the dynamic or the parametric images. /todo Maybe it will be better to lie in a linear models class.

◆ multiply_dynamic_image_with_model()

template<int num_param>
void stir::ModelMatrix< num_param >::multiply_dynamic_image_with_model ( ParametricVoxelsOnCartesianGrid parametric_image,
const DynamicDiscretisedDensity dynamic_image 
) const
inline

multiply (transpose) model-matrix with dynamic image (overwriting original content of parametric_image)

Todo:
current implementation first fills first argument with 0 and then calls multiply_dynamic_image_with_model_and_add_to_input(). This is somewhat inefficient.

◆ multiply_parametric_image_with_model()

template<int num_param>
void stir::ModelMatrix< num_param >::multiply_parametric_image_with_model ( DynamicDiscretisedDensity dynamic_image,
const ParametricVoxelsOnCartesianGrid parametric_image 
) const
inline

multiply model-matrix with parametric image (overwriting original content of dynamic_image)

Todo:
current implementation first fills first argument with 0 and then calls multiply_dynamic_image_with_model_and_add_to_input(). This is somewhat inefficient.

The documentation for this class was generated from the following files: