|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Base class for (dynamic) models. More...
#include <mitkModelBase.h>


Public Types | |
| typedef ModelBase | Self |
| typedef itk::Object | Superclass |
| typedef itk::SmartPointer< Self > | Pointer |
| typedef itk::SmartPointer< const Self > | ConstPointer |
| typedef ModelTraitsInterface::ModelResultType | ModelResultType |
| typedef ModelTraitsInterface::ParameterValueType | ParameterValueType |
| typedef ModelTraitsInterface::ParametersType | ParametersType |
| typedef itk::Array< double > | TimeGridType |
| Type defining the time grid used by models. More... | |
| typedef ModelTraitsInterface::ParameterNameType | ParameterNameType |
| typedef ModelTraitsInterface::ParameterNamesType | ParameterNamesType |
| typedef ModelTraitsInterface::ParametersSizeType | ParametersSizeType |
| typedef ModelTraitsInterface::DerivedParameterNamesType | DerivedParameterNamesType |
| typedef ModelTraitsInterface::DerivedParametersSizeType | DerivedParametersSizeType |
| typedef double | StaticParameterValueType |
| typedef std::vector< StaticParameterValueType > | StaticParameterValuesType |
| typedef std::map< ParameterNameType, StaticParameterValuesType > | StaticParameterMapType |
| typedef double | DerivedParameterValueType |
| typedef std::map< ParameterNameType, DerivedParameterValueType > | DerivedParameterMapType |
Public Types inherited from mitk::ModelTraitsInterface | |
| typedef itk::Array< double > | ModelResultType |
| Type representing the model output signal as an array of doubles. More... | |
| using | ParameterValueType = double |
| Type of a single parameter value. More... | |
| typedef itk::Array< ParameterValueType > | ParametersType |
| Type representing a vector of parameter values. More... | |
| typedef std::string | ParameterNameType |
| Type used for parameter names. More... | |
| typedef std::vector< ParameterNameType > | ParameterNamesType |
| Type for a list of parameter names. More... | |
| typedef ParametersType::SizeValueType | ParametersSizeType |
| Type for the count of parameters. More... | |
| typedef ParameterNamesType | DerivedParameterNamesType |
| Type for a list of derived parameter names. More... | |
| typedef ParametersSizeType | DerivedParametersSizeType |
| Type for the count of derived parameters. More... | |
| typedef std::map< ParameterNameType, double > | ParamterScaleMapType |
| Map type associating parameter names to their scaling factors. More... | |
| typedef std::map< ParameterNameType, std::string > | ParamterUnitMapType |
| Map type associating parameter names to their unit strings. More... | |
| typedef std::map< ParameterNameType, double > | DerivedParamterScaleMapType |
| Map type associating derived parameter names to their scaling factors. More... | |
| typedef std::map< ParameterNameType, std::string > | DerivedParamterUnitMapType |
| Map type associating derived parameter names to their unit strings. More... | |
| typedef std::string | FunctionStringType |
| Type for the function string representation of the model. More... | |
| typedef std::string | ModellClassIDType |
| Type for the unique class identifier of the model. More... | |
Public Member Functions | |
| virtual const char * | GetClassName () const |
| ParamterScaleMapType | GetParameterScales () const override |
| Default implementation returns a scale of 1.0 for every defined parameter. More... | |
| ParamterUnitMapType | GetParameterUnits () const override |
| Default implementation returns no unit string ("") for every defined parameter. More... | |
| DerivedParamterScaleMapType | GetDerivedParameterScales () const override |
| Default implementation returns a scale of 1.0 for every defined derived parameter. More... | |
| DerivedParamterUnitMapType | GetDerivedParameterUnits () const override |
| Default implementation returns no unit string ("") for every defined derived parameter. More... | |
| std::string | GetModelDisplayName () const override |
| Default implementation returns GetClassID as display name. More... | |
| std::string | GetModelType () const override |
| Default implementation returns "Unknown" as model type. More... | |
| FunctionStringType | GetFunctionString () const override |
| Default implementation returns an empty function string. More... | |
| ModellClassIDType | GetClassID () const override |
| Default implementation returns the class name of the concrete instance as ID. More... | |
| std::string | GetXName () const override |
| Default implementation returns an empty string. More... | |
| std::string | GetXAxisName () const override |
| Default implementation returns an empty string. More... | |
| std::string | GetXAxisUnit () const override |
| Default implementation returns an empty string. More... | |
| std::string | GetYAxisName () const override |
| Default implementation returns an empty string. More... | |
| std::string | GetYAxisUnit () const override |
| Default implementation returns an empty string. More... | |
| virtual ParameterNamesType | GetStaticParameterNames () const =0 |
| Returns the names of static parameters used when computing the signal. More... | |
| virtual ParametersSizeType | GetNumberOfStaticParameters () const =0 |
| Returns the number of static parameters. More... | |
| virtual ParamterUnitMapType | GetStaticParameterUnits () const |
| Default implementation returns no unit string ("") for every defined static parameter. More... | |
| DerivedParameterNamesType | GetDerivedParameterNames () const override |
| Returns the names of derived parameters that can be computed by the model. More... | |
| DerivedParametersSizeType | GetNumberOfDerivedParameters () const override |
| Returns the number of derived parameters that can be computed by the model. More... | |
| void | SetStaticParameters (const StaticParameterMapType ¶meters, bool allParameters=true) |
| Sets the static parameters of the model before it is used. More... | |
| StaticParameterMapType | GetStaticParameters () const |
| Retrieves the static parameters of the model (e.g. for serialization). More... | |
| DerivedParameterMapType | GetDerivedParameters (const ParametersType ¶meters) const |
| Computes all derived parameters for the given model parameters. More... | |
| virtual void | SetTimeGrid (const TimeGridType &grid) |
| Sets the time grid of the model. More... | |
| virtual const TimeGridType & | GetTimeGrid () |
| Gets the time grid of the model. More... | |
| ModelResultType | GetSignal (const ParametersType ¶meters) const |
| Computes and returns the model signal for the given parameters. More... | |
Public Member Functions inherited from mitk::ModelTraitsInterface | |
| virtual ParameterNamesType | GetParameterNames () const =0 |
| Returns the names of parameters that must be defined when using the model to compute the signal (GetSignal()). More... | |
| virtual ParametersSizeType | GetNumberOfParameters () const =0 |
| Returns the number of parameters that must be defined when using the model to compute the signal (GetSignal()). More... | |
Protected Member Functions | |
| virtual ModelResultType | ComputeModelfunction (const ParametersType ¶meters) const =0 |
| Computes the model function for the given parameters. More... | |
| virtual bool | ValidateModel (std::string &error) const |
| Validates whether the model is in a valid state to compute the signal. More... | |
| virtual DerivedParameterMapType | ComputeDerivedParameters (const ParametersType ¶meters) const |
| Computes derived parameters from the given model parameters. More... | |
| virtual void | SetStaticParameter (const ParameterNameType &name, const StaticParameterValuesType &values)=0 |
| Sets a single static parameter by name. More... | |
| virtual StaticParameterValuesType | GetStaticParameterValue (const ParameterNameType &name) const =0 |
| Retrieves a single static parameter value by name. More... | |
| ModelBase () | |
| ~ModelBase () override | |
| ModelBase (const ModelBase &source) | |
| void | PrintSelf (std::ostream &os, ::itk::Indent indent) const override |
Protected Member Functions inherited from mitk::ModelTraitsInterface | |
| ModelTraitsInterface () | |
| virtual | ~ModelTraitsInterface () |
Protected Attributes | |
| TimeGridType | m_TimeGrid |
Base class for (dynamic) models.
A model can be used to calculate its signal given the discrete time grid of the signal and the parameters of the model.
A model has 3 types of parameters:
"Parameters" and "static parameters" are used to compute the signal of the model. "Parameters" are the ones that will be changed for/by model fitting. "Static parameters" are used to configure the model for fitting but are itself not part of the fitting scope (compare itk::Transform parameters and static parameters). "Derived parameters" are model specific parameters computed from "Parameters" e.g. (DerivedParam1 = Param1/Param2). It may be implemented if e.g. for practical usage not the fitted parameters are needed but derivation of them.
Definition at line 55 of file mitkModelBase.h.
| typedef itk::SmartPointer< const Self > mitk::ModelBase::ConstPointer |
Definition at line 61 of file mitkModelBase.h.
| typedef std::map<ParameterNameType, DerivedParameterValueType> mitk::ModelBase::DerivedParameterMapType |
Definition at line 83 of file mitkModelBase.h.
Definition at line 75 of file mitkModelBase.h.
Definition at line 76 of file mitkModelBase.h.
| typedef double mitk::ModelBase::DerivedParameterValueType |
Definition at line 82 of file mitkModelBase.h.
Definition at line 65 of file mitkModelBase.h.
Definition at line 72 of file mitkModelBase.h.
Definition at line 71 of file mitkModelBase.h.
Definition at line 73 of file mitkModelBase.h.
Definition at line 67 of file mitkModelBase.h.
Definition at line 66 of file mitkModelBase.h.
| typedef itk::SmartPointer< Self > mitk::ModelBase::Pointer |
Definition at line 60 of file mitkModelBase.h.
| typedef ModelBase mitk::ModelBase::Self |
Definition at line 58 of file mitkModelBase.h.
| typedef std::map<ParameterNameType, StaticParameterValuesType> mitk::ModelBase::StaticParameterMapType |
Definition at line 80 of file mitkModelBase.h.
| typedef std::vector<StaticParameterValueType> mitk::ModelBase::StaticParameterValuesType |
Definition at line 79 of file mitkModelBase.h.
| typedef double mitk::ModelBase::StaticParameterValueType |
Definition at line 78 of file mitkModelBase.h.
| typedef itk::Object mitk::ModelBase::Superclass |
Definition at line 59 of file mitkModelBase.h.
| typedef itk::Array<double> mitk::ModelBase::TimeGridType |
Type defining the time grid used by models.
Definition at line 70 of file mitkModelBase.h.
|
protected |
|
overrideprotected |
|
protected |
|
protectedvirtual |
Computes derived parameters from the given model parameters.
Helper function called by GetDerivedParameters(). Implement in derived classes to realize the concrete computation of derived parameters.
Reimplemented in mitk::StandardToftsModel, mitk::ExtendedToftsModel, mitk::TwoStepLinearModel, mitk::ThreeStepLinearModel, mitk::TestModel, mitk::LinearModel, and mitk::ExponentialDecayModel.
|
protectedpure virtual |
Computes the model function for the given parameters.
Must be implemented by derived classes.
| parameters | The model parameters. |
Implemented in mitk::TwoTissueCompartmentModel, mitk::TwoTissueCompartmentFDGModel, mitk::TwoCompartmentExchangeModel, mitk::StandardToftsModel, mitk::OneTissueCompartmentModel, mitk::ExtendedToftsModel, mitk::ExtendedOneTissueCompartmentModel, mitk::DescriptivePharmacokineticBrixModel, mitk::TwoStepLinearModel, mitk::ThreeStepLinearModel, mitk::TestModel, mitk::LinearModel, mitk::GenericParamModel, mitk::ExponentialSaturationModel, mitk::ExponentialDecayModel, and mitk::ExpDecayOffsetModel.
|
overridevirtual |
Default implementation returns the class name of the concrete instance as ID.
Implements mitk::ModelTraitsInterface.
|
virtual |
Reimplemented in mitk::TwoTissueCompartmentModel, mitk::TwoTissueCompartmentFDGModel, mitk::TwoCompartmentExchangeModel, mitk::StandardToftsModel, mitk::OneTissueCompartmentModel, mitk::ExtendedToftsModel, mitk::ExtendedOneTissueCompartmentModel, mitk::DescriptivePharmacokineticBrixModel, mitk::AIFBasedModelBase, mitk::TwoStepLinearModel, mitk::ThreeStepLinearModel, mitk::TestModel, mitk::LinearModel, mitk::GenericParamModel, mitk::ExponentialSaturationModel, mitk::ExponentialDecayModel, and mitk::ExpDecayOffsetModel.
|
overridevirtual |
Returns the names of derived parameters that can be computed by the model.
Implements mitk::ModelTraitsInterface.
Reimplemented in mitk::StandardToftsModel, mitk::ExtendedToftsModel, mitk::TwoStepLinearModel, mitk::ThreeStepLinearModel, and mitk::TestModel.
| DerivedParameterMapType mitk::ModelBase::GetDerivedParameters | ( | const ParametersType & | parameters | ) | const |
Computes all derived parameters for the given model parameters.
To change the derived parameter computation, ComputeDerivedParameters must be (re)implemented.
| parameters | The parameters of the model for which the derived parameters should be computed. |
|
overridevirtual |
Default implementation returns a scale of 1.0 for every defined derived parameter.
Implements mitk::ModelTraitsInterface.
|
overridevirtual |
Default implementation returns no unit string ("") for every defined derived parameter.
Implements mitk::ModelTraitsInterface.
Reimplemented in mitk::StandardToftsModel, mitk::ExtendedToftsModel, mitk::TwoStepLinearModel, and mitk::ThreeStepLinearModel.
|
overridevirtual |
Default implementation returns an empty function string.
Implements mitk::ModelTraitsInterface.
Reimplemented in mitk::TwoStepLinearModel, mitk::ThreeStepLinearModel, and mitk::TestModel.
|
overridevirtual |
Default implementation returns GetClassID as display name.
Implements mitk::ModelTraitsInterface.
Reimplemented in mitk::TwoTissueCompartmentModel, mitk::TwoTissueCompartmentFDGModel, mitk::TwoCompartmentExchangeModel, mitk::StandardToftsModel, mitk::OneTissueCompartmentModel, mitk::ExtendedToftsModel, mitk::ExtendedOneTissueCompartmentModel, mitk::DescriptivePharmacokineticBrixModel, mitk::TwoStepLinearModel, mitk::ThreeStepLinearModel, and mitk::TestModel.
|
overridevirtual |
Default implementation returns "Unknown" as model type.
Implements mitk::ModelTraitsInterface.
Reimplemented in mitk::TwoTissueCompartmentModel, mitk::TwoTissueCompartmentFDGModel, mitk::TwoCompartmentExchangeModel, mitk::StandardToftsModel, mitk::OneTissueCompartmentModel, mitk::ExtendedToftsModel, mitk::ExtendedOneTissueCompartmentModel, mitk::DescriptivePharmacokineticBrixModel, mitk::TwoStepLinearModel, mitk::ThreeStepLinearModel, and mitk::TestModel.
|
overridevirtual |
Returns the number of derived parameters that can be computed by the model.
Implements mitk::ModelTraitsInterface.
Reimplemented in mitk::StandardToftsModel, mitk::ExtendedToftsModel, mitk::TwoStepLinearModel, mitk::ThreeStepLinearModel, and mitk::TestModel.
|
pure virtual |
Returns the number of static parameters.
Implemented in mitk::DescriptivePharmacokineticBrixModel, mitk::AIFBasedModelBase, mitk::TwoStepLinearModel, mitk::ThreeStepLinearModel, mitk::TestModel, mitk::LinearModel, mitk::GenericParamModel, mitk::ExponentialSaturationModel, mitk::ExponentialDecayModel, and mitk::ExpDecayOffsetModel.
|
overridevirtual |
Default implementation returns a scale of 1.0 for every defined parameter.
Implements mitk::ModelTraitsInterface.
Reimplemented in mitk::TestModel.
|
overridevirtual |
Default implementation returns no unit string ("") for every defined parameter.
Implements mitk::ModelTraitsInterface.
Reimplemented in mitk::TwoTissueCompartmentModel, mitk::TwoTissueCompartmentFDGModel, mitk::TwoCompartmentExchangeModel, mitk::StandardToftsModel, mitk::OneTissueCompartmentModel, mitk::ExtendedToftsModel, mitk::ExtendedOneTissueCompartmentModel, mitk::DescriptivePharmacokineticBrixModel, mitk::TwoStepLinearModel, mitk::ThreeStepLinearModel, and mitk::TestModel.
| ModelResultType mitk::ModelBase::GetSignal | ( | const ParametersType & | parameters | ) | const |
Computes and returns the model signal for the given parameters.
| parameters | The model parameters. |
|
pure virtual |
Returns the names of static parameters used when computing the signal.
Static parameters are not part of the fitting scope but configure the model.
Implemented in mitk::DescriptivePharmacokineticBrixModel, mitk::AIFBasedModelBase, mitk::TwoStepLinearModel, mitk::ThreeStepLinearModel, mitk::TestModel, mitk::LinearModel, mitk::GenericParamModel, mitk::ExponentialSaturationModel, mitk::ExponentialDecayModel, and mitk::ExpDecayOffsetModel.
| StaticParameterMapType mitk::ModelBase::GetStaticParameters | ( | ) | const |
Retrieves the static parameters of the model (e.g. for serialization).
Calls GetStaticParameter for every name defined in GetStaticParameterNames().
|
virtual |
Default implementation returns no unit string ("") for every defined static parameter.
Reimplemented in mitk::DescriptivePharmacokineticBrixModel, and mitk::AIFBasedModelBase.
|
protectedpure virtual |
Retrieves a single static parameter value by name.
Helper function called by GetStaticParameters(). Must be implemented in derived classes.
Implemented in mitk::DescriptivePharmacokineticBrixModel, mitk::AIFBasedModelBase, mitk::TwoStepLinearModel, mitk::ThreeStepLinearModel, mitk::TestModel, mitk::LinearModel, mitk::GenericParamModel, mitk::ExponentialSaturationModel, mitk::ExponentialDecayModel, and mitk::ExpDecayOffsetModel.
|
virtual |
Gets the time grid of the model.
|
overridevirtual |
Default implementation returns an empty string.
Implements mitk::ModelTraitsInterface.
Reimplemented in mitk::DescriptivePharmacokineticBrixModel, mitk::AIFBasedModelBase, mitk::TwoStepLinearModel, mitk::ThreeStepLinearModel, and mitk::TestModel.
|
overridevirtual |
Default implementation returns an empty string.
Implements mitk::ModelTraitsInterface.
Reimplemented in mitk::DescriptivePharmacokineticBrixModel, mitk::AIFBasedModelBase, mitk::TwoStepLinearModel, mitk::ThreeStepLinearModel, and mitk::TestModel.
|
overridevirtual |
Default implementation returns an empty string.
Implements mitk::ModelTraitsInterface.
Reimplemented in mitk::TwoStepLinearModel, mitk::ThreeStepLinearModel, and mitk::TestModel.
|
overridevirtual |
Default implementation returns an empty string.
Implements mitk::ModelTraitsInterface.
Reimplemented in mitk::DescriptivePharmacokineticBrixModel, mitk::AIFBasedModelBase, mitk::TwoStepLinearModel, mitk::ThreeStepLinearModel, and mitk::TestModel.
|
overridevirtual |
Default implementation returns an empty string.
Implements mitk::ModelTraitsInterface.
Reimplemented in mitk::DescriptivePharmacokineticBrixModel, mitk::AIFBasedModelBase, mitk::TwoStepLinearModel, mitk::ThreeStepLinearModel, and mitk::TestModel.
|
overrideprotected |
|
protectedpure virtual |
Sets a single static parameter by name.
Helper function called by SetStaticParameters(). Must be implemented in derived classes.
Implemented in mitk::DescriptivePharmacokineticBrixModel, mitk::AIFBasedModelBase, mitk::TwoStepLinearModel, mitk::ThreeStepLinearModel, mitk::TestModel, mitk::LinearModel, mitk::GenericParamModel, mitk::ExponentialSaturationModel, mitk::ExponentialDecayModel, and mitk::ExpDecayOffsetModel.
| void mitk::ModelBase::SetStaticParameters | ( | const StaticParameterMapType & | parameters, |
| bool | allParameters = true |
||
| ) |
Sets the static parameters of the model before it is used.
Checks the validity of the passed map and uses SetStaticParameter to set the values.
| parameters | The map with the static parameters and their values. |
| allParameters | If true, an exception will be thrown if the keys of passed parameters do not equal the return of GetStaticParameterNames. Thus if true, one must set all static parameters of the model. |
|
virtual |
Sets the time grid of the model.
The time grid indicates the time points correlated with the signal the model should produce.
|
protectedvirtual |
Validates whether the model is in a valid state to compute the signal.
Called by GetSignal() before ComputeModelfunction(). The default implementation checks nothing and always returns true. Reimplement to realize special behavior for derived classes.
| [out] | error | Set internally to indicate the error reason if method returns false. |
Reimplemented in mitk::AIFBasedModelBase.
|
protected |
Definition at line 265 of file mitkModelBase.h.