Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkModelFitStaticParameterMap.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 mitkModelFitStaticParameterMap_h
14 #define mitkModelFitStaticParameterMap_h
15 
16 #include <vector>
17 #include <string>
18 #include <map>
19 
20 #include <MitkModelFitExports.h>
21 #include <mitkModelBase.h>
22 
23 namespace mitk
24 {
25  namespace modelFit
26  {
32  {
33  private:
35  typedef ModelBase::ParameterNameType KeyType;
36 
37  public:
41  typedef std::pair<KeyType, ValueType> StaticParameterType;
42 
43  private:
45  typedef ModelBase::StaticParameterMapType MapType;
46 
48  MapType m_map;
49 
53  unsigned int m_numValues;
54 
55  public:
57  typedef MapType::const_iterator const_iterator;
58 
59  StaticParameterMap() : m_numValues(1) {}
60 
74  void Add(const std::string& name, const ValueType& newList);
75 
82  const ValueType& Get(const std::string& name) const;
83 
84  MapType::size_type Size() const
85  {
86  return m_map.size();
87  }
88 
90  {
91  return m_map.begin();
92  }
93 
95  {
96  return m_map.end();
97  }
98 
108  void Sort(const std::string& name = "");
109 
113  void Clear();
114  };
115 
123  {
124  return (a.front() < b.front());
125  }
126  }
127 }
128 
129 #endif
#define MITKMODELFIT_EXPORT
std::map< ParameterNameType, StaticParameterValuesType > StaticParameterMapType
Definition: mitkModelBase.h:80
std::vector< StaticParameterValueType > StaticParameterValuesType
Definition: mitkModelBase.h:79
ModelTraitsInterface::ParameterNameType ParameterNameType
Definition: mitkModelBase.h:71
Data structure that stores information about the static parameters of a model fit.
const ValueType & Get(const std::string &name) const
Returns the values of the given variable name.
std::pair< KeyType, ValueType > StaticParameterType
Type of a variable, consisting of name and value list.
MapType::const_iterator const_iterator
Needed for 'foreach' support.
void Add(const std::string &name, const ValueType &newList)
Adds the given value list under the given variable name.
void Clear()
Resets the map so it's empty.
void Sort(const std::string &name="")
Sorts the map by the values of the given variable in ascending order.
ModelBase::StaticParameterValuesType ValueType
Type of the map value.
bool operator<(const StaticParameterMap::ValueType &a, const StaticParameterMap::ValueType &b)
Compares two value lists by their first element.
Find image slices visible on a given plane.