Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkLinearModel.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkLinearModel_h
14 #define mitkLinearModel_h
15 
16 #include <mitkModelBase.h>
17 
18 #include <MitkModelFitExports.h>
19 
20 namespace mitk
21 {
22 
34  {
35 
36  public:
37  typedef LinearModel Self;
41 
44 
46  itkFactorylessNewMacro(Self);
47  itkCloneMacro(Self);
48 
50  itkTypeMacro(LinearModel, ModelBase);
51 
53  static const std::string NAME_PARAMETER_y0;
55  static const std::string NAME_PARAMETER_b;
56 
58  static const unsigned int NUMBER_OF_PARAMETERS;
59 
61  static const std::string UNIT_PARAMETER_y0;
63  static const std::string UNIT_PARAMETER_b;
64 
66  static const unsigned int POSITION_PARAMETER_y0;
68  static const unsigned int POSITION_PARAMETER_b;
69 
71  static const std::string NAME_DERIVED_PARAMETER_x_intercept;
72 
74  static const unsigned int NUMBER_OF_DERIVED_PARAMETERS;
75 
77  static const std::string UNIT_DERIVED_PARAMETER_x_intercept;
78 
80  static const unsigned int NUMBER_OF_STATIC_PARAMETERS;
81 
83  static const std::string MODEL_DISPLAY_NAME;
84 
86  static const std::string MODEL_TYPE;
87 
89  static const std::string FUNCTION_STRING;
90 
92  static const std::string X_NAME;
93 
95  static const std::string X_AXIS_NAME;
96 
98  static const std::string X_AXIS_UNIT;
99 
101  static const std::string Y_AXIS_NAME;
102 
104  static const std::string Y_AXIS_UNIT;
105 
109 
113 
117 
121 
125 
129 
133 
137 
140  std::string GetModelDisplayName() const override;
141 
144  std::string GetModelType() const override;
145 
149 
152  std::string GetXName() const override;
153 
156  std::string GetXAxisName() const override;
157 
160  std::string GetXAxisUnit() const override;
161 
164  std::string GetYAxisName() const override;
165 
168  std::string GetYAxisUnit() const override;
169 
170 
171  protected:
173  ~LinearModel() override {};
174 
175  LinearModel(const LinearModel& source);
176 
178 
179  ModelResultType ComputeModelfunction(const ParametersType& parameters) const override;
181  parameters) const override;
182 
184  const StaticParameterValuesType& values) override;
186 
187  private:
188 
189  void operator=(const Self&); //purposely not implemented
190 
191  };
192 }
193 
194 #endif
#define MITKMODELFIT_EXPORT
Model representing a simple linear function: y(x) = b * x + y0.
ParametersSizeType GetNumberOfStaticParameters() const override
Returns the number of static parameters (0).
ParameterNamesType GetParameterNames() const override
Returns the names of all model parameters.
ParametersSizeType GetNumberOfDerivedParameters() const override
Returns the number of derived parameters (1).
static const std::string X_NAME
Name of the independent variable.
static const std::string UNIT_PARAMETER_y0
Unit of the y-intercept parameter.
LinearModel(const LinearModel &source)
static const unsigned int NUMBER_OF_DERIVED_PARAMETERS
Total number of derived parameters (1).
static const unsigned int POSITION_PARAMETER_y0
Index position of y-intercept in the parameter vector.
DerivedParameterMapType ComputeDerivedParameters(const mitk::ModelBase::ParametersType &parameters) const override
Computes derived parameters from the given model parameters.
static const std::string Y_AXIS_NAME
Display name for the y-axis.
FunctionStringType GetFunctionString() const override
Returns the function string representing the model equation.
std::string GetXAxisUnit() const override
Returns the x-axis unit.
static const std::string NAME_DERIVED_PARAMETER_x_intercept
Name string for the derived x-intercept parameter.
std::string GetModelType() const override
Returns the model type string.
itk::SmartPointer< Self > Pointer
ParamterUnitMapType GetParameterUnits() const override
Returns the unit map for model parameters.
static const std::string MODEL_DISPLAY_NAME
Display name of this model ("Linear Model").
ParameterNamesType GetDerivedParameterNames() const override
Returns the names of derived parameters.
Superclass::ParametersSizeType ParametersSizeType
ParameterNamesType GetStaticParameterNames() const override
Returns the names of static parameters (empty for this model).
std::string GetModelDisplayName() const override
Returns the display name "Linear Model".
static const std::string NAME_PARAMETER_b
Name string for the slope parameter ("slope").
itk::SmartPointer< const Self > ConstPointer
StaticParameterValuesType GetStaticParameterValue(const ParameterNameType &name) const override
Retrieves a single static parameter value by name.
static const unsigned int NUMBER_OF_PARAMETERS
Total number of model parameters (2).
static const std::string NAME_PARAMETER_y0
Name string for the y-intercept parameter ("y-intercept").
static const std::string Y_AXIS_UNIT
Unit for the y-axis.
static const std::string X_AXIS_UNIT
Unit for the x-axis.
static const std::string UNIT_PARAMETER_b
Unit of the slope parameter.
ParametersSizeType GetNumberOfParameters() const override
Returns the number of model parameters (2).
ModelResultType ComputeModelfunction(const ParametersType &parameters) const override
Computes the model function for the given parameters.
std::string GetXName() const override
Returns the name of the independent variable.
void SetStaticParameter(const ParameterNameType &name, const StaticParameterValuesType &values) override
Sets a single static parameter by name.
mitkCloneMacro(LinearModel)
std::string GetYAxisUnit() const override
Returns the y-axis unit.
ParamterUnitMapType GetDerivedParameterUnits() const override
Returns the unit map for derived parameters.
static const unsigned int NUMBER_OF_STATIC_PARAMETERS
Total number of static parameters (0).
std::string GetXAxisName() const override
Returns the x-axis display name.
static const std::string UNIT_DERIVED_PARAMETER_x_intercept
Unit of the derived x-intercept parameter.
static const std::string MODEL_TYPE
Type category of this model.
static const std::string FUNCTION_STRING
Function string representation of the model equation.
~LinearModel() override
mitk::ModelBase Superclass
static const unsigned int POSITION_PARAMETER_b
Index position of slope in the parameter vector.
std::string GetYAxisName() const override
Returns the y-axis display name.
static const std::string X_AXIS_NAME
Display name for the x-axis.
Superclass::ParameterNameType ParameterNameType
Base class for (dynamic) models.
Definition: mitkModelBase.h:56
ModelTraitsInterface::ParametersSizeType ParametersSizeType
Definition: mitkModelBase.h:73
ModelTraitsInterface::ParameterNamesType ParameterNamesType
Definition: mitkModelBase.h:72
std::map< ParameterNameType, DerivedParameterValueType > DerivedParameterMapType
Definition: mitkModelBase.h:83
std::vector< StaticParameterValueType > StaticParameterValuesType
Definition: mitkModelBase.h:79
ModelTraitsInterface::ParameterNameType ParameterNameType
Definition: mitkModelBase.h:71
ModelTraitsInterface::ModelResultType ModelResultType
Definition: mitkModelBase.h:63
ModelTraitsInterface::ParametersType ParametersType
Definition: mitkModelBase.h:67
std::string FunctionStringType
Type for the function string representation of the model.
std::map< ParameterNameType, std::string > ParamterUnitMapType
Map type associating parameter names to their unit strings.
Find image slices visible on a given plane.