Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::TestModel Class Reference

Simple linear test model used to verify factory and framework functionality. More...

#include <mitkTestModel.h>

Inheritance diagram for mitk::TestModel:
Collaboration diagram for mitk::TestModel:

Public Types

typedef TestModel Self
 
typedef mitk::ModelBase Superclass
 
typedef itk::SmartPointer< Self > Pointer
 
typedef itk::SmartPointer< const Self > ConstPointer
 
typedef Superclass::ParameterNameType ParameterNameType
 
typedef Superclass::ParametersSizeType ParametersSizeType
 
- Public Types inherited from mitk::ModelBase
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

Pointer Clone () const
 
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...
 
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...
 
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...
 
ParameterNamesType GetParameterNames () const override
 Returns the names of parameters that must be defined when using the model to compute the signal (GetSignal()). More...
 
ParametersSizeType GetNumberOfParameters () const override
 Returns the number of parameters that must be defined when using the model to compute the signal (GetSignal()). More...
 
ParameterNamesType GetStaticParameterNames () const override
 Returns the names of static parameters used when computing the signal. More...
 
ParametersSizeType GetNumberOfStaticParameters () const override
 Returns the number of static parameters. More...
 
ParameterNamesType GetDerivedParameterNames () const override
 Returns the names of derived parameters that can be computed by the model. More...
 
ParametersSizeType GetNumberOfDerivedParameters () const override
 Returns the number of derived parameters that can be computed by the model. More...
 
- Public Member Functions inherited from mitk::ModelBase
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...
 
ModellClassIDType GetClassID () const override
 Default implementation returns the class name of the concrete instance as ID. More...
 
virtual ParamterUnitMapType GetStaticParameterUnits () const
 Default implementation returns no unit string ("") for every defined static parameter. More...
 
void SetStaticParameters (const StaticParameterMapType &parameters, 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 &parameters) 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 &parameters) const
 Computes and returns the model signal for the given parameters. More...
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 TestModel ()
 
 TestModel (const TestModel &other)
 
 ~TestModel () override
 
ModelResultType ComputeModelfunction (const ParametersType &parameters) const override
 Computes the model function for the given parameters. More...
 
DerivedParameterMapType ComputeDerivedParameters (const mitk::ModelBase::ParametersType &parameters) const override
 Computes derived parameters from the given model parameters. More...
 
void SetStaticParameter (const ParameterNameType &name, const StaticParameterValuesType &values) override
 Sets a single static parameter by name. More...
 
StaticParameterValuesType GetStaticParameterValue (const ParameterNameType &name) const override
 Retrieves a single static parameter value by name. More...
 
 mitkCloneMacro (Self)
 
- Protected Member Functions inherited from mitk::ModelBase
virtual bool ValidateModel (std::string &error) const
 Validates whether the model is in a valid state to compute the signal. 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 ()
 

Additional Inherited Members

- Protected Attributes inherited from mitk::ModelBase
TimeGridType m_TimeGrid
 

Detailed Description

Simple linear test model used to verify factory and framework functionality.

This model implements a basic linear function for testing purposes. It is not intended for production model fitting but serves as a reference implementation to validate the model fitting infrastructure.

See also
TestModelFactory, ModelBase

Definition at line 33 of file mitkTestModel.h.

Member Typedef Documentation

◆ ConstPointer

Definition at line 40 of file mitkTestModel.h.

◆ ParameterNameType

typedef Superclass::ParameterNameType mitk::TestModel::ParameterNameType

Definition at line 42 of file mitkTestModel.h.

◆ ParametersSizeType

typedef Superclass::ParametersSizeType mitk::TestModel::ParametersSizeType

Definition at line 43 of file mitkTestModel.h.

◆ Pointer

Definition at line 39 of file mitkTestModel.h.

◆ Self

Definition at line 37 of file mitkTestModel.h.

◆ Superclass

Definition at line 38 of file mitkTestModel.h.

Constructor & Destructor Documentation

◆ TestModel() [1/2]

mitk::TestModel::TestModel ( )
inlineprotected

Definition at line 85 of file mitkTestModel.h.

◆ TestModel() [2/2]

mitk::TestModel::TestModel ( const TestModel &  other)
protected

◆ ~TestModel()

mitk::TestModel::~TestModel ( )
inlineoverrideprotected

Definition at line 87 of file mitkTestModel.h.

Member Function Documentation

◆ Clone()

Pointer mitk::TestModel::Clone ( ) const

◆ ComputeDerivedParameters()

DerivedParameterMapType mitk::TestModel::ComputeDerivedParameters ( const mitk::ModelBase::ParametersType &  parameters) const
overrideprotectedvirtual

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.

Remarks
Default implementation has no derived parameters.

Reimplemented from mitk::ModelBase.

◆ ComputeModelfunction()

ModelResultType mitk::TestModel::ComputeModelfunction ( const ParametersType &  parameters) const
overrideprotectedvirtual

Computes the model function for the given parameters.

Must be implemented by derived classes.

Parameters
parametersThe model parameters.
Returns
The computed model result.

Implements mitk::ModelBase.

◆ GetClassName()

virtual const char* mitk::TestModel::GetClassName ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from mitk::ModelBase.

◆ GetDerivedParameterNames()

ParameterNamesType mitk::TestModel::GetDerivedParameterNames ( ) const
overridevirtual

Returns the names of derived parameters that can be computed by the model.

Remarks
Default implementation has no derived parameters.

Reimplemented from mitk::ModelBase.

◆ GetFunctionString()

FunctionStringType mitk::TestModel::GetFunctionString ( ) const
overridevirtual

Default implementation returns an empty function string.

Reimplemented from mitk::ModelBase.

◆ GetModelDisplayName()

std::string mitk::TestModel::GetModelDisplayName ( ) const
overridevirtual

Default implementation returns GetClassID as display name.

Reimplemented from mitk::ModelBase.

◆ GetModelType()

std::string mitk::TestModel::GetModelType ( ) const
overridevirtual

Default implementation returns "Unknown" as model type.

Reimplemented from mitk::ModelBase.

◆ GetNumberOfDerivedParameters()

ParametersSizeType mitk::TestModel::GetNumberOfDerivedParameters ( ) const
overridevirtual

Returns the number of derived parameters that can be computed by the model.

Remarks
Default implementation has no derived parameters.

Reimplemented from mitk::ModelBase.

◆ GetNumberOfParameters()

ParametersSizeType mitk::TestModel::GetNumberOfParameters ( ) const
overridevirtual

Returns the number of parameters that must be defined when using the model to compute the signal (GetSignal()).

Returns
The number of model parameters.

Implements mitk::ModelTraitsInterface.

◆ GetNumberOfStaticParameters()

ParametersSizeType mitk::TestModel::GetNumberOfStaticParameters ( ) const
overridevirtual

Returns the number of static parameters.

Returns
The count of static parameters.

Implements mitk::ModelBase.

◆ GetParameterNames()

ParameterNamesType mitk::TestModel::GetParameterNames ( ) const
overridevirtual

Returns the names of parameters that must be defined when using the model to compute the signal (GetSignal()).

Returns
A vector of parameter name strings.

Implements mitk::ModelTraitsInterface.

◆ GetParameterScales()

ParamterScaleMapType mitk::TestModel::GetParameterScales ( ) const
overridevirtual

Default implementation returns a scale of 1.0 for every defined parameter.

Reimplemented from mitk::ModelBase.

◆ GetParameterUnits()

ParamterUnitMapType mitk::TestModel::GetParameterUnits ( ) const
overridevirtual

Default implementation returns no unit string ("") for every defined parameter.

Reimplemented from mitk::ModelBase.

◆ GetStaticParameterNames()

ParameterNamesType mitk::TestModel::GetStaticParameterNames ( ) const
overridevirtual

Returns the names of static parameters used when computing the signal.

Static parameters are not part of the fitting scope but configure the model.

Returns
A vector of static parameter names.

Implements mitk::ModelBase.

◆ GetStaticParameterValue()

StaticParameterValuesType mitk::TestModel::GetStaticParameterValue ( const ParameterNameType &  name) const
overrideprotectedvirtual

Retrieves a single static parameter value by name.

Helper function called by GetStaticParameters(). Must be implemented in derived classes.

Implements mitk::ModelBase.

◆ GetXAxisName()

std::string mitk::TestModel::GetXAxisName ( ) const
overridevirtual

Default implementation returns an empty string.

Reimplemented from mitk::ModelBase.

◆ GetXAxisUnit()

std::string mitk::TestModel::GetXAxisUnit ( ) const
overridevirtual

Default implementation returns an empty string.

Reimplemented from mitk::ModelBase.

◆ GetXName()

std::string mitk::TestModel::GetXName ( ) const
overridevirtual

Default implementation returns an empty string.

Reimplemented from mitk::ModelBase.

◆ GetYAxisName()

std::string mitk::TestModel::GetYAxisName ( ) const
overridevirtual

Default implementation returns an empty string.

Reimplemented from mitk::ModelBase.

◆ GetYAxisUnit()

std::string mitk::TestModel::GetYAxisUnit ( ) const
overridevirtual

Default implementation returns an empty string.

Reimplemented from mitk::ModelBase.

◆ mitkCloneMacro()

mitk::TestModel::mitkCloneMacro ( Self  )
protected

◆ New()

static Pointer mitk::TestModel::New ( )
static

Method for creation through the object factory.

◆ SetStaticParameter()

void mitk::TestModel::SetStaticParameter ( const ParameterNameType &  name,
const StaticParameterValuesType &  values 
)
overrideprotectedvirtual

Sets a single static parameter by name.

Helper function called by SetStaticParameters(). Must be implemented in derived classes.

Implements mitk::ModelBase.


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