Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkConcreteModelParameterizerBase.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 mitkConcreteModelParameterizerBase_h
14 #define mitkConcreteModelParameterizerBase_h
15 
17 
18 namespace mitk
19 {
32  template <class TModel>
34  {
35  public:
40 
42  itkFactorylessNewMacro(Self);
43 
46 
47  typedef TModel ModelType;
48  typedef typename ModelType::Pointer ModelPointer;
49 
53 
55 
56  /* Returns the global static parameters for the model.
57  * \remark this default implementation assumes no global static parameters exist.
58  * Thus an empty map is returned.*/
60  {
62  return result;
63  };
64 
65  /* Returns the local static parameters for the model at the given index.
66  * \remark this default implementation assumes no local static parameters exist.
67  * Thus an empty map is returned.*/
68  StaticParameterMapType GetLocalStaticParameters(const IndexType& /*currentPosition*/) const override
69  {
71  return result;
72  };
73 
74  /* Returns an newly generated instance of the concrete model.
75  * It is parameterized by the static parameters (returns of GetGlobalParameter() and
76  * GetLocalParameter()).
77  */
78  ModelBasePointer GenerateParameterizedModel(const IndexType& currentPosition) const override
79  {
80  ModelPointer newModel = ModelType::New();
82  StaticParameterMapType locals = this->GetLocalStaticParameters(currentPosition);
83 
84  params.insert(locals.begin(), locals.end());
85  newModel->SetTimeGrid(m_DefaultTimeGrid);
86  newModel->SetStaticParameters(params);
87 
88  return newModel.GetPointer();
89  };
90 
92  {
93  ModelPointer newModel = ModelType::New();
95 
96  newModel->SetTimeGrid(m_DefaultTimeGrid);
97  newModel->SetStaticParameters(params, false);
98 
99  return newModel.GetPointer();
100  };
101 
102  /* Returns a parameterization filled with zeros.
103  * \remark this default implementation assumes no special initial parameterization is suggested.
104  * Thus an zero filled vector is returned.*/
106  {
107  ModelPointer newModel = ModelType::New();
108  ParametersType params;
109  params.SetSize(newModel->GetNumberOfParameters());
110  params.Fill(0.0);
111 
112  return params;
113  };
114 
116  {
117  return GenerateParameterizedModel()->GetParameterNames();
118  };
119 
121  {
122  return GenerateParameterizedModel()->GetNumberOfParameters();
123  };
124 
126  {
127  return GenerateParameterizedModel()->GetParameterScales();
128  };
129 
131  {
132  return GenerateParameterizedModel()->GetParameterUnits();
133  };
134 
136  {
137  return GenerateParameterizedModel()->GetDerivedParameterNames();
138  };
139 
141  {
142  return GenerateParameterizedModel()->GetNumberOfDerivedParameters();
143  };
144 
146  {
147  return GenerateParameterizedModel()->GetDerivedParameterScales();
148  };
149 
151  {
152  return GenerateParameterizedModel()->GetDerivedParameterUnits();
153  };
154 
155  std::string GetModelDisplayName() const override
156  {
157  return GenerateParameterizedModel()->GetModelDisplayName();
158  };
159 
160  std::string GetModelType() const override
161  {
162  return GenerateParameterizedModel()->GetModelType();
163  };
164 
166  {
167  return GenerateParameterizedModel()->GetFunctionString();
168  };
169 
170  ModellClassIDType GetClassID() const override
171  {
172  return GenerateParameterizedModel()->GetClassID();
173  };
174 
175  std::string GetXName() const override
176  {
177  return GenerateParameterizedModel()->GetXName();
178  };
179 
180  std::string GetXAxisName() const override
181  {
182  return GenerateParameterizedModel()->GetXAxisName();
183  };
184 
185  std::string GetXAxisUnit() const override
186  {
187  return GenerateParameterizedModel()->GetXAxisUnit();
188  };
189 
190  std::string GetYAxisName() const override
191  {
192  return GenerateParameterizedModel()->GetYAxisName();
193  };
194 
195  std::string GetYAxisUnit() const override
196  {
197  return GenerateParameterizedModel()->GetYAxisUnit();
198  }
199 
200  protected:
202  {
203  };
204 
206  {
207  };
208 
209  private:
210 
211  //No copy constructor allowed
212  ConcreteModelParameterizerBase(const Self& source);
213  void operator=(const Self&); //purposely not implemented
214  };
215 }
216 
217 #endif
Template base class for parameterizers operating on a specific model type.
ParameterNamesType GetDerivedParameterNames() const override
Returns the names of derived parameters that can be computed by the model.
ModelBasePointer GenerateParameterizedModel(const IndexType &currentPosition) const override
Generates a fully parameterized model instance for the given position.
StaticParameterMapType GetLocalStaticParameters(const IndexType &) const override
Returns the local static parameters specific to the given image position.
ConcreteModelParameterizerBase< TModel > Self
ParametersSizeType GetNumberOfDerivedParameters() const override
Returns the number of derived parameters that can be computed by the model.
std::string GetXAxisUnit() const override
Returns the unit of the x-axis (e.g. "s", "ms").
Superclass::StaticParameterValueType StaticParameterValueType
std::string GetXName() const override
Returns the name of the independent variable used by the model (e.g. "x").
ModelBasePointer GenerateParameterizedModel() const override
Generates a model instance with only global static parameterization.
std::string GetModelDisplayName() const override
Returns the human-readable display name of the model.
std::string GetModelType() const override
Returns the type/category string of the model (e.g. "Linear", "Pharmacokinetic").
ParametersSizeType GetNumberOfParameters() const override
Returns the number of parameters that must be defined when using the model to compute the signal (Get...
std::string GetXAxisName() const override
Returns the display name of the x-axis (e.g. "Time").
Superclass::StaticParameterValuesType StaticParameterValuesType
ParamterScaleMapType GetParameterScales() const override
Returns the scaling factors for all model parameters.
DerivedParamterUnitMapType GetDerivedParameterUnits() const override
Returns the unit strings for all derived parameters.
DerivedParamterScaleMapType GetDerivedParameterScales() const override
Returns the scaling factors for all derived parameters.
ParamterUnitMapType GetParameterUnits() const override
Returns the unit strings for all model parameters.
std::string GetYAxisName() const override
Returns the display name of the y-axis (e.g. "Signal Intensity").
ParametersType GetDefaultInitialParameterization() const override
Returns the default initial parameterization defined by the model developer.
ModellClassIDType GetClassID() const override
Returns the unique class identifier for this model type.
std::string GetYAxisUnit() const override
Returns the unit of the y-axis.
StaticParameterMapType GetGlobalStaticParameters() const override
Returns the global static parameters that are the same for all positions.
Superclass::StaticParameterMapType StaticParameterMapType
ParameterNamesType GetParameterNames() const override
Returns the names of parameters that must be defined when using the model to compute the signal (GetS...
FunctionStringType GetFunctionString() const override
Returns a parsable function string representing the model equation.
Base class for (dynamic) models.
Definition: mitkModelBase.h:56
ModelBaseType::StaticParameterValueType StaticParameterValueType
ModelBaseType::ParametersType ParametersType
ModelBaseType::StaticParameterValuesType StaticParameterValuesType
ModelBaseType::StaticParameterMapType StaticParameterMapType
std::map< ParameterNameType, double > ParamterScaleMapType
Map type associating parameter names to their scaling factors.
std::string FunctionStringType
Type for the function string representation of the model.
ParametersType::SizeValueType ParametersSizeType
Type for the count of parameters.
std::map< ParameterNameType, std::string > ParamterUnitMapType
Map type associating parameter names to their unit strings.
std::string ModellClassIDType
Type for the unique class identifier of the model.
std::map< ParameterNameType, std::string > DerivedParamterUnitMapType
Map type associating derived parameter names to their unit strings.
std::map< ParameterNameType, double > DerivedParamterScaleMapType
Map type associating derived parameter names to their scaling factors.
std::vector< ParameterNameType > ParameterNamesType
Type for a list of parameter names.
Find image slices visible on a given plane.