Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
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 {
20  template <class TModel>
22  {
23  public:
28 
30  itkFactorylessNewMacro(Self);
31 
34 
35  typedef TModel ModelType;
36  typedef typename ModelType::Pointer ModelPointer;
37 
41 
43 
44  /* Returns the global static parameters for the model.
45  * @remark this default implementation assumes no global static parameters exist.
46  * Thus an empty map is returned.*/
48  {
50  return result;
51  };
52 
53  /* Returns the local static parameters for the model at the given index.
54  * @remark this default implementation assumes no local static parameters exist.
55  * Thus an empty map is returned.*/
56  StaticParameterMapType GetLocalStaticParameters(const IndexType& /*currentPosition*/) const override
57  {
59  return result;
60  };
61 
62  /* Returns an newly generated instance of the concrete model.
63  * It is parameterized by the static parameters (returns of GetGlobalParameter() and
64  * GetLocalParameter()).
65  */
66  ModelBasePointer GenerateParameterizedModel(const IndexType& currentPosition) const override
67  {
68  ModelPointer newModel = ModelType::New();
70  StaticParameterMapType locals = this->GetLocalStaticParameters(currentPosition);
71 
72  params.insert(locals.begin(), locals.end());
73  newModel->SetTimeGrid(m_DefaultTimeGrid);
74  newModel->SetStaticParameters(params);
75 
76  return newModel.GetPointer();
77  };
78 
80  {
81  ModelPointer newModel = ModelType::New();
83 
84  newModel->SetTimeGrid(m_DefaultTimeGrid);
85  newModel->SetStaticParameters(params, false);
86 
87  return newModel.GetPointer();
88  };
89 
90  /* Returns a parameterization filled with zeros.
91  * @remark this default implementation assumes no special initial parameterization is suggested.
92  * Thus an zero filled vector is returned.*/
94  {
95  ModelPointer newModel = ModelType::New();
96  ParametersType params;
97  params.SetSize(newModel->GetNumberOfParameters());
98  params.Fill(0.0);
99 
100  return params;
101  };
102 
104  {
105  return GenerateParameterizedModel()->GetParameterNames();
106  };
107 
109  {
110  return GenerateParameterizedModel()->GetNumberOfParameters();
111  };
112 
114  {
115  return GenerateParameterizedModel()->GetParameterScales();
116  };
117 
119  {
120  return GenerateParameterizedModel()->GetParameterUnits();
121  };
122 
124  {
125  return GenerateParameterizedModel()->GetDerivedParameterNames();
126  };
127 
129  {
130  return GenerateParameterizedModel()->GetNumberOfDerivedParameters();
131  };
132 
134  {
135  return GenerateParameterizedModel()->GetDerivedParameterScales();
136  };
137 
139  {
140  return GenerateParameterizedModel()->GetDerivedParameterUnits();
141  };
142 
143  std::string GetModelDisplayName() const override
144  {
145  return GenerateParameterizedModel()->GetModelDisplayName();
146  };
147 
148  std::string GetModelType() const override
149  {
150  return GenerateParameterizedModel()->GetModelType();
151  };
152 
154  {
155  return GenerateParameterizedModel()->GetFunctionString();
156  };
157 
158  ModellClassIDType GetClassID() const override
159  {
160  return GenerateParameterizedModel()->GetClassID();
161  };
162 
163  std::string GetXName() const override
164  {
165  return GenerateParameterizedModel()->GetXName();
166  };
167 
168  std::string GetXAxisName() const override
169  {
170  return GenerateParameterizedModel()->GetXAxisName();
171  };
172 
173  std::string GetXAxisUnit() const override
174  {
175  return GenerateParameterizedModel()->GetXAxisUnit();
176  };
177 
178  std::string GetYAxisName() const override
179  {
180  return GenerateParameterizedModel()->GetYAxisName();
181  };
182 
183  std::string GetYAxisUnit() const override
184  {
185  return GenerateParameterizedModel()->GetYAxisUnit();
186  }
187 
188  protected:
190  {
191  };
192 
194  {
195  };
196 
197  private:
198 
199  //No copy constructor allowed
200  ConcreteModelParameterizerBase(const Self& source);
201  void operator=(const Self&); //purposely not implemented
202  };
203 }
204 
205 #endif
mitk::ConcreteModelParameterizerBase::GenerateParameterizedModel
ModelBasePointer GenerateParameterizedModel(const IndexType &currentPosition) const override
Definition: mitkConcreteModelParameterizerBase.h:66
mitk::ModelTraitsInterface::ParamterUnitMapType
std::map< ParameterNameType, std::string > ParamterUnitMapType
Definition: mitkModelTraitsInterface.h:40
mitk::ModelTraitsInterface::ParamterScaleMapType
std::map< ParameterNameType, double > ParamterScaleMapType
Definition: mitkModelTraitsInterface.h:39
mitk::ConcreteModelParameterizerBase::Superclass
ModelParameterizerBase Superclass
Definition: mitkConcreteModelParameterizerBase.h:25
mitk::ConcreteModelParameterizerBase::ModelPointer
ModelType::Pointer ModelPointer
Definition: mitkConcreteModelParameterizerBase.h:36
mitk::ConcreteModelParameterizerBase::GetGlobalStaticParameters
StaticParameterMapType GetGlobalStaticParameters() const override
Definition: mitkConcreteModelParameterizerBase.h:47
mitk::ConcreteModelParameterizerBase::GetDerivedParameterUnits
DerivedParamterUnitMapType GetDerivedParameterUnits() const override
Definition: mitkConcreteModelParameterizerBase.h:138
mitk::ConcreteModelParameterizerBase::GetModelType
std::string GetModelType() const override
Definition: mitkConcreteModelParameterizerBase.h:148
mitk::ModelParameterizerBase
Definition: mitkModelParameterizerBase.h:36
mitk::ModelParameterizerBase::StaticParameterMapType
ModelBaseType::StaticParameterMapType StaticParameterMapType
Definition: mitkModelParameterizerBase.h:52
mitk::ModelTraitsInterface::ParametersSizeType
ParametersType::SizeValueType ParametersSizeType
Definition: mitkModelTraitsInterface.h:35
mitk::ConcreteModelParameterizerBase::GetParameterScales
ParamterScaleMapType GetParameterScales() const override
Definition: mitkConcreteModelParameterizerBase.h:113
mitk::ConcreteModelParameterizerBase::GetParameterUnits
ParamterUnitMapType GetParameterUnits() const override
Definition: mitkConcreteModelParameterizerBase.h:118
mitk::ConcreteModelParameterizerBase::GetDefaultInitialParameterization
ParametersType GetDefaultInitialParameterization() const override
Definition: mitkConcreteModelParameterizerBase.h:93
mitk::ConcreteModelParameterizerBase::GenerateParameterizedModel
ModelBasePointer GenerateParameterizedModel() const override
Definition: mitkConcreteModelParameterizerBase.h:79
mitk::ConcreteModelParameterizerBase::GetXAxisUnit
std::string GetXAxisUnit() const override
Definition: mitkConcreteModelParameterizerBase.h:173
itk::SmartPointer< Self >
mitk::ConcreteModelParameterizerBase::GetModelDisplayName
std::string GetModelDisplayName() const override
Definition: mitkConcreteModelParameterizerBase.h:143
mitk::ConcreteModelParameterizerBase::ModelBasePointer
Superclass::ModelBasePointer ModelBasePointer
Definition: mitkConcreteModelParameterizerBase.h:33
mitk::ConcreteModelParameterizerBase::GetNumberOfParameters
ParametersSizeType GetNumberOfParameters() const override
Definition: mitkConcreteModelParameterizerBase.h:108
mitk::ConcreteModelParameterizerBase::ModelBaseType
Superclass::ModelBaseType ModelBaseType
Definition: mitkConcreteModelParameterizerBase.h:30
mitk::ConcreteModelParameterizerBase::GetFunctionString
FunctionStringType GetFunctionString() const override
Definition: mitkConcreteModelParameterizerBase.h:153
mitk::ConcreteModelParameterizerBase::StaticParameterValueType
Superclass::StaticParameterValueType StaticParameterValueType
Definition: mitkConcreteModelParameterizerBase.h:38
mitk::ConcreteModelParameterizerBase
Definition: mitkConcreteModelParameterizerBase.h:21
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::ModelTraitsInterface::DerivedParamterScaleMapType
std::map< ParameterNameType, double > DerivedParamterScaleMapType
Definition: mitkModelTraitsInterface.h:41
mitk::ConcreteModelParameterizerBase::IndexType
Superclass::IndexType IndexType
Definition: mitkConcreteModelParameterizerBase.h:42
mitk::ModelTraitsInterface::ParameterNamesType
std::vector< ParameterNameType > ParameterNamesType
Definition: mitkModelTraitsInterface.h:34
mitk::ConcreteModelParameterizerBase::Pointer
itk::SmartPointer< Self > Pointer
Definition: mitkConcreteModelParameterizerBase.h:26
mitk::ModelTraitsInterface::ModellClassIDType
std::string ModellClassIDType
Definition: mitkModelTraitsInterface.h:45
mitk::ModelParameterizerBase::IndexType
::itk::Index< 3 > IndexType
Definition: mitkModelParameterizerBase.h:55
mitk::ModelParameterizerBase::StaticParameterValuesType
ModelBaseType::StaticParameterValuesType StaticParameterValuesType
Definition: mitkModelParameterizerBase.h:51
mitk::ConcreteModelParameterizerBase::~ConcreteModelParameterizerBase
~ConcreteModelParameterizerBase() override
Definition: mitkConcreteModelParameterizerBase.h:193
mitk::ModelParameterizerBase::ModelBasePointer
ModelBaseType::Pointer ModelBasePointer
Definition: mitkModelParameterizerBase.h:47
mitk::ModelParameterizerBase::ParametersType
ModelBaseType::ParametersType ParametersType
Definition: mitkModelParameterizerBase.h:49
mitk::ConcreteModelParameterizerBase::ConcreteModelParameterizerBase
ConcreteModelParameterizerBase()
Definition: mitkConcreteModelParameterizerBase.h:189
mitk::ConcreteModelParameterizerBase::GetParameterNames
ParameterNamesType GetParameterNames() const override
Definition: mitkConcreteModelParameterizerBase.h:103
mitk::ConcreteModelParameterizerBase::GetXName
std::string GetXName() const override
Definition: mitkConcreteModelParameterizerBase.h:163
mitk::ConcreteModelParameterizerBase::Self
ConcreteModelParameterizerBase< TModel > Self
Definition: mitkConcreteModelParameterizerBase.h:24
mitk::ConcreteModelParameterizerBase::StaticParameterMapType
Superclass::StaticParameterMapType StaticParameterMapType
Definition: mitkConcreteModelParameterizerBase.h:40
mitk::ModelTraitsInterface::FunctionStringType
std::string FunctionStringType
Definition: mitkModelTraitsInterface.h:44
mitk::ConcreteModelParameterizerBase::StaticParameterValuesType
Superclass::StaticParameterValuesType StaticParameterValuesType
Definition: mitkConcreteModelParameterizerBase.h:39
mitk::ConcreteModelParameterizerBase::GetDerivedParameterNames
ParameterNamesType GetDerivedParameterNames() const override
Definition: mitkConcreteModelParameterizerBase.h:123
mitk::ModelTraitsInterface::DerivedParamterUnitMapType
std::map< ParameterNameType, std::string > DerivedParamterUnitMapType
Definition: mitkModelTraitsInterface.h:42
mitk::ConcreteModelParameterizerBase::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: mitkConcreteModelParameterizerBase.h:27
mitkModelParameterizerBase.h
mitk::ConcreteModelParameterizerBase::GetClassID
ModellClassIDType GetClassID() const override
Definition: mitkConcreteModelParameterizerBase.h:158
mitk::ConcreteModelParameterizerBase::GetDerivedParameterScales
DerivedParamterScaleMapType GetDerivedParameterScales() const override
Definition: mitkConcreteModelParameterizerBase.h:133
mitk::ModelParameterizerBase::m_DefaultTimeGrid
TimeGridType m_DefaultTimeGrid
Definition: mitkModelParameterizerBase.h:91
mitk::ConcreteModelParameterizerBase::ModelType
TModel ModelType
Definition: mitkConcreteModelParameterizerBase.h:35
mitk::ConcreteModelParameterizerBase::GetXAxisName
std::string GetXAxisName() const override
Definition: mitkConcreteModelParameterizerBase.h:168
mitk::ConcreteModelParameterizerBase::GetLocalStaticParameters
StaticParameterMapType GetLocalStaticParameters(const IndexType &) const override
Definition: mitkConcreteModelParameterizerBase.h:56
mitk::ModelParameterizerBase::StaticParameterValueType
ModelBaseType::StaticParameterValueType StaticParameterValueType
Definition: mitkModelParameterizerBase.h:50
mitk::ConcreteModelParameterizerBase::GetYAxisUnit
std::string GetYAxisUnit() const override
Definition: mitkConcreteModelParameterizerBase.h:183
mitk::ConcreteModelParameterizerBase::GetNumberOfDerivedParameters
ParametersSizeType GetNumberOfDerivedParameters() const override
Definition: mitkConcreteModelParameterizerBase.h:128
mitk::ConcreteModelParameterizerBase::GetYAxisName
std::string GetYAxisName() const override
Definition: mitkConcreteModelParameterizerBase.h:178
mitk::ModelParameterizerBase::ModelBaseType
ModelBase ModelBaseType
Definition: mitkModelParameterizerBase.h:44