STIR  6.2.0
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
stir::PatlakPlot Class Reference

Patlak kinetic model. More...

#include "stir/modelling/PatlakPlot.h"

Inheritance diagram for stir::PatlakPlot:
Inheritance graph
[legend]

Public Member Functions

 PatlakPlot ()
 Default constructor (calls set_defaults()) More...
 
 ~PatlakPlot () override
 default destructor
 
virtual void multiply_dynamic_image_with_model_gradient (ParametricVoxelsOnCartesianGrid &parametric_image, const DynamicDiscretisedDensity &dyn_image) const
 Multiplies the dynamic image with the model gradient. More...
 
virtual void multiply_dynamic_image_with_model_gradient_and_add_to_input (ParametricVoxelsOnCartesianGrid &parametric_image, const DynamicDiscretisedDensity &dyn_image) const
 Multiplies the dynamic image with the model gradient and add to original parametric_image. More...
 
virtual void get_dynamic_image_from_parametric_image (DynamicDiscretisedDensity &dyn_image, const ParametricVoxelsOnCartesianGrid &par_image) const
 Multiplies the parametric image with the model matrix to get the corresponding dynamic image. More...
 
void apply_linear_regression (ParametricVoxelsOnCartesianGrid &par_image, const DynamicDiscretisedDensity &dyn_image) const
 This is the common method used to estimate the parametric images from the dynamic images. More...
 
void set_defaults () override
 Set defaults before parsing.
 
Succeeded set_up () override
 
Functions to get parameters
ModelMatrix< 2 > get_model_matrix () const
 Simply gets model matrix, if it has been already stored. More...
 
ModelMatrix< 2 > get_model_matrix (const PlasmaData &plasma_data, const TimeFrameDefinitions &time_frame_definitions, const unsigned int starting_frame)
 Creates model matrix from plasma data (Must be already sorted in appropriate frames).
 
unsigned int get_starting_frame () const
 Returns the frame that the PatlakPlot linearization is assumed to be valid.
 
unsigned int get_ending_frame () const
 Returns the number of the last frame available.
 
TimeFrameDefinitions get_time_frame_definitions () const
 Returns the TimeFrameDefinitions that the PatlakPlot linearization is assumed to be valid: ChT::Check.
 
Functions to set parameters
void set_model_matrix (ModelMatrix< 2 > model_matrix)
 Simply set model matrix.
 
- Public Member Functions inherited from stir::RegisteredParsingObject< PatlakPlot, KineticModel >
std::string get_registered_name () const override
 Returns Derived::registered_name.
 
std::string parameter_info () override
 Returns a string with all parameters and their values, in a form suitable for parsing again.
 
- Public Member Functions inherited from stir::KineticModel
 KineticModel ()
 default constructor
 
 ~KineticModel () override
 default destructor
 
- Public Member Functions inherited from stir::ParsingObject
 ParsingObject (const ParsingObject &)
 
ParsingObjectoperator= (const ParsingObject &)
 
void ask_parameters ()
 
bool parse (std::istream &f)
 
bool parse (const char *const filename)
 

Public Attributes

bool _if_cardiac
 Switches between cardiac and brain data.
 
unsigned int _starting_frame
 Starting frame to apply the model.
 
float _cal_factor
 Calibration Factor, maybe to be removed.
 
float _time_shift
 Shifts the time to fit the timing of Plasma Data with the Projection Data.
 
bool _in_correct_scale
 Switch to scale or not the model_matrix to the correct scale, according to the appropriate scale factor.
 
bool _in_total_cnt
 Switch to choose the values of the model to be in total counts or in mean counts.
 
std::string _blood_data_filename
 Name of file in which the input function is stored.
 
PlasmaData _plasma_frame_data
 Stores the plasma data into frames for brain studies.
 
std::string _time_frame_definition_filename
 name of file to get frame definitions
 
TimeFrameDefinitions _frame_defs
 TimeFrameDefinitions.
 

Static Public Attributes

static const char *const registered_name = "Patlak Plot"
 Name which will be used when parsing a PatlakPlot object.
 
- Static Public Attributes inherited from stir::KineticModel
static const char *const registered_name = "Kinetic Model Type"
 

Additional Inherited Members

- Static Public Member Functions inherited from stir::RegisteredParsingObject< PatlakPlot, KineticModel >
static KineticModelread_from_stream (std::istream *)
 Construct a new object (of type Derived) by parsing the istream. More...
 
- Static Public Member Functions inherited from stir::RegisteredObject< KineticModel >
static KineticModelread_registered_object (std::istream *in, const std::string &registered_name)
 Construct a new object (of a type derived from Root, its actual type determined by the registered_name parameter) by parsing the istream. More...
 
static KineticModelask_type_and_parameters ()
 ask the user for the type, and then calls read_registered_object(0, type) More...
 
static void list_registered_names (std::ostream &stream)
 List all possible registered names to the stream. More...
 
- Protected Types inherited from stir::RegisteredObject< KineticModel >
typedef KineticModel *(* RootFactory) (std::istream *)
 The type of a root factory is a function, taking an istream* as argument, and returning a Root*.
 
typedef FactoryRegistry< std::string, RootFactory, interfile_lessRegistryType
 The type of the registry.
 
- Protected Member Functions inherited from stir::ParsingObject
virtual void set_key_values ()
 This will be called before parsing or parameter_info is called. More...
 
- Static Protected Member Functions inherited from stir::RegisteredObject< KineticModel >
static RegistryTyperegistry ()
 Static function returning the registry. More...
 
- Protected Attributes inherited from stir::ParsingObject
KeyParser parser
 

Detailed Description

Patlak kinetic model.

Model suitable for irreversible tracers such as FDG and FLT. See

Example .par file
Patlak Plot Parameters:=

time frame definition filename := frames.txt
starting frame := 23
calibration factor := 9000
blood data filename :=  blood_file.txt
; In seconds
Time Shift := 0
In total counts := 1

end Patlak Plot Parameters:=
Warning
  • The dynamic images will be calibrated only if the calibration factor is given.
  • The [if_total_cnt] is set to true the Dynamic Image will have the total number of counts while if set to false it will have the total_number_of_counts/get_duration(frame_num).
  • The dynamic images will always be in decaying counts.
  • The plasma data is assumed to be in decaying counts.
Todo:
Should be derived from LinearModels, but when non-linear models will be introduced, as well.

Constructor & Destructor Documentation

◆ PatlakPlot()

stir::PatlakPlot::PatlakPlot ( )

Default constructor (calls set_defaults())

default constructor

Member Function Documentation

◆ get_model_matrix()

ModelMatrix< 2 > stir::PatlakPlot::get_model_matrix ( ) const

Simply gets model matrix, if it has been already stored.

Simply get model matrix if it has been already stored.

References stir::error().

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

◆ multiply_dynamic_image_with_model_gradient()

void stir::PatlakPlot::multiply_dynamic_image_with_model_gradient ( ParametricVoxelsOnCartesianGrid parametric_image,
const DynamicDiscretisedDensity dyn_image 
) const
virtual

Multiplies the dynamic image with the model gradient.

For a linear model the model gradient is the transpose of the model matrix. So, the dynamic image is "projected" from time domain to the parameter domain.

Todo:
Should be a virtual function declared in the KineticModel class.

References stir::error(), and stir::DiscretisedDensityOnCartesianGrid< num_dimensions, elemT >::get_grid_spacing().

◆ multiply_dynamic_image_with_model_gradient_and_add_to_input()

void stir::PatlakPlot::multiply_dynamic_image_with_model_gradient_and_add_to_input ( ParametricVoxelsOnCartesianGrid parametric_image,
const DynamicDiscretisedDensity dyn_image 
) const
virtual

Multiplies the dynamic image with the model gradient and add to original parametric_image.

Todo:
Should be a virtual function declared in the KineticModel class.

References stir::error(), and stir::DiscretisedDensityOnCartesianGrid< num_dimensions, elemT >::get_grid_spacing().

◆ get_dynamic_image_from_parametric_image()

void stir::PatlakPlot::get_dynamic_image_from_parametric_image ( DynamicDiscretisedDensity dyn_image,
const ParametricVoxelsOnCartesianGrid par_image 
) const
virtual

Multiplies the parametric image with the model matrix to get the corresponding dynamic image.

Todo:
Should be a virtual function declared in the KineticModel class.

References stir::error(), and stir::DiscretisedDensityOnCartesianGrid< num_dimensions, elemT >::get_grid_spacing().

◆ apply_linear_regression()

void stir::PatlakPlot::apply_linear_regression ( ParametricVoxelsOnCartesianGrid par_image,
const DynamicDiscretisedDensity dyn_image 
) const

This is the common method used to estimate the parametric images from the dynamic images.

Todo:
There is currently no check if the time frame definitions from dyn_image are the same as the ones encoded in the model.

References stir::error(), stir::DiscretisedDensityOnCartesianGrid< num_dimensions, elemT >::get_grid_spacing(), and stir::linear_regression().


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