STIR 6.5.0
stir::PatlakPlot Class Reference

Patlak kinetic model. More...

#include "stir/modelling/PatlakPlot.h"

Inheritance diagram for stir::PatlakPlot:

Public Member Functions

 PatlakPlot ()
 Default constructor (calls set_defaults()).
 ~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.
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.
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.
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.
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.
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 &)
ParsingObject & operator= (const ParsingObject &)
bool parse (std::istream &f)
bool parse (const char *const filename)
void ask_parameters ()

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 KineticModel * read_from_stream (std::istream *)
 Construct a new object (of type Derived) by parsing the istream.
Static Public Member Functions inherited from stir::RegisteredObject< KineticModel >
static KineticModel * read_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.
static KineticModel * ask_type_and_parameters ()
 ask the user for the type, and then calls read_registered_object(0, type)
static void list_registered_names (std::ostream &stream)
 List all possible registered names to the stream.
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_less > RegistryType
 The type of the registry.
virtual void set_key_values ()
 This will be called before parsing or parameter_info is called.
Static Protected Member Functions inherited from stir::RegisteredObject< KineticModel >
static RegistryType & registry ()
 Static function returning the registry.
KeyParser parser

Detailed Description

Patlak kinetic model.

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

  • Patlak C S, Blasberg R G, Fenstermacher J D (1985) Graphical evaluation of blood-to-brain transfer constants from multiple-time uptake data, {J Cereb Blood Flow Metab 3(1): p. 1-7.
  • Patlak C S, Blasberg R G (1985) Experimental and Graphical evaluation of blood-to-brain transfer constant from multiple-time uptake data: Generalizations, J Cereb Blood Flow Metab 5: p. 584-90.
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

References PatlakPlot(), and set_defaults().

Referenced by PatlakPlot().

◆ ~PatlakPlot()

stir::PatlakPlot::~PatlakPlot ( )
override

default destructor

References ~PatlakPlot().

Referenced by ~PatlakPlot().

Member Function Documentation

◆ get_model_matrix() [1/2]

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(), and get_model_matrix().

Referenced by get_model_matrix(), and stir::modellingTests::run_tests().

◆ get_model_matrix() [2/2]

ModelMatrix< 2 > stir::PatlakPlot::get_model_matrix ( const PlasmaData & plasma_data,
const TimeFrameDefinitions & time_frame_definitions,
const unsigned int starting_frame )

◆ get_starting_frame()

unsigned int stir::PatlakPlot::get_starting_frame ( ) const

Returns the frame that the PatlakPlot linearization is assumed to be valid.

References get_starting_frame().

Referenced by get_model_matrix(), and get_starting_frame().

◆ get_ending_frame()

unsigned int stir::PatlakPlot::get_ending_frame ( ) const

Returns the number of the last frame available.

References get_ending_frame(), and get_time_frame_definitions().

Referenced by get_ending_frame(), and get_model_matrix().

◆ get_time_frame_definitions()

TimeFrameDefinitions stir::PatlakPlot::get_time_frame_definitions ( ) const

Returns the TimeFrameDefinitions that the PatlakPlot linearization is assumed to be valid: ChT::Check.

References _frame_defs, and get_time_frame_definitions().

Referenced by get_ending_frame(), get_model_matrix(), and get_time_frame_definitions().

◆ set_model_matrix()

void stir::PatlakPlot::set_model_matrix ( ModelMatrix< 2 > model_matrix)

Simply set model matrix.

References set_model_matrix().

Referenced by get_model_matrix(), and set_model_matrix().

◆ 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 _in_correct_scale, stir::error(), stir::get(), stir::DiscretisedDensityOnCartesianGrid< num_dimensions, elemT >::get_grid_spacing(), and multiply_dynamic_image_with_model_gradient().

Referenced by get_model_matrix(), and multiply_dynamic_image_with_model_gradient().

◆ 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 _in_correct_scale, stir::error(), stir::get(), stir::DiscretisedDensityOnCartesianGrid< num_dimensions, elemT >::get_grid_spacing(), and multiply_dynamic_image_with_model_gradient_and_add_to_input().

Referenced by get_model_matrix(), and multiply_dynamic_image_with_model_gradient_and_add_to_input().

◆ 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 _in_correct_scale, stir::error(), stir::get(), get_dynamic_image_from_parametric_image(), and stir::DiscretisedDensityOnCartesianGrid< num_dimensions, elemT >::get_grid_spacing().

Referenced by get_dynamic_image_from_parametric_image(), and get_model_matrix().

◆ 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 _frame_defs, _in_correct_scale, apply_linear_regression(), stir::error(), stir::get(), stir::DiscretisedDensityOnCartesianGrid< num_dimensions, elemT >::get_grid_spacing(), and stir::linear_regression().

Referenced by apply_linear_regression(), and get_model_matrix().

◆ set_defaults()

void stir::PatlakPlot::set_defaults ( )
overridevirtual

◆ set_up()

Succeeded stir::PatlakPlot::set_up ( )
overridevirtual

Implements stir::KineticModel.

Member Data Documentation

◆ _starting_frame

unsigned int stir::PatlakPlot::_starting_frame

Starting frame to apply the model.

Referenced by stir::modellingTests::run_tests(), and set_defaults().

◆ _cal_factor

float stir::PatlakPlot::_cal_factor

Calibration Factor, maybe to be removed.

Referenced by stir::modellingTests::run_tests(), and set_defaults().

◆ _time_shift

float stir::PatlakPlot::_time_shift

Shifts the time to fit the timing of Plasma Data with the Projection Data.

Referenced by set_defaults().

◆ _in_correct_scale

bool stir::PatlakPlot::_in_correct_scale

Switch to scale or not the model_matrix to the correct scale, according to the appropriate scale factor.

Referenced by apply_linear_regression(), get_dynamic_image_from_parametric_image(), multiply_dynamic_image_with_model_gradient(), multiply_dynamic_image_with_model_gradient_and_add_to_input(), and set_defaults().

◆ _in_total_cnt

bool stir::PatlakPlot::_in_total_cnt

Switch to choose the values of the model to be in total counts or in mean counts.

Referenced by set_defaults().

◆ _blood_data_filename

std::string stir::PatlakPlot::_blood_data_filename

Name of file in which the input function is stored.

Referenced by set_defaults().

◆ _plasma_frame_data

PlasmaData stir::PatlakPlot::_plasma_frame_data

Stores the plasma data into frames for brain studies.

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

◆ _frame_defs


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