Medical Imaging Interaction Toolkit  2024.06.99-31d3c0df
Medical Imaging Interaction Toolkit
mitk::modelFit::StaticParameterMap Class Reference

#include <mitkModelFitStaticParameterMap.h>

Public Types

typedef ModelBase::StaticParameterValuesType ValueType
 Type of the map value. More...
 
typedef std::pair< KeyType, ValueTypeStaticParameterType
 Type of a variable, consisting of name and value list. More...
 
typedef MapType::const_iterator const_iterator
 Needed for 'foreach' support. More...
 

Public Member Functions

 StaticParameterMap ()
 
void Add (const std::string &name, const ValueType &newList)
 Adds the given value list under the given variable name if the name doesn't exist already. If it does exist, nothing is added. More...
 
const ValueTypeGet (const std::string &name) const
 Returns the values of the given variable name. More...
 
MapType::size_type Size () const
 
const_iterator begin () const
 
const_iterator end () const
 
void Sort (const std::string &name="")
 Sorts the values of the given variable name in ascending order. The values of all other variables will also be switched in that specific order. If name is empty or the variable could not be found, the map is ordered by the first variable that contains more than one value (also in ascending order). More...
 
void Clear ()
 Resets the map, so it's empty. More...
 

Detailed Description

Data structure that is used to store information about the static parameters of a model fit

Definition at line 28 of file mitkModelFitStaticParameterMap.h.

Member Typedef Documentation

◆ const_iterator

typedef MapType::const_iterator mitk::modelFit::StaticParameterMap::const_iterator

Needed for 'foreach' support.

Definition at line 55 of file mitkModelFitStaticParameterMap.h.

◆ StaticParameterType

Type of a variable, consisting of name and value list.

Definition at line 38 of file mitkModelFitStaticParameterMap.h.

◆ ValueType

Constructor & Destructor Documentation

◆ StaticParameterMap()

mitk::modelFit::StaticParameterMap::StaticParameterMap ( )
inline

Definition at line 57 of file mitkModelFitStaticParameterMap.h.

Member Function Documentation

◆ Add()

void mitk::modelFit::StaticParameterMap::Add ( const std::string &  name,
const ValueType newList 
)

Adds the given value list under the given variable name if the name doesn't exist already. If it does exist, nothing is added.

Precondition
The given list must contain either 1 or n values, where n is the amount of values that lists contain which are already part of the map (and contain more than one value). That means if the map is empty or contains only lists that have only one value each, this rule doesn't apply. An exception is thrown otherwise.
Parameters
nameThe name of the variable to which the values should be added.
newListThe value list that should be added.
Exceptions
ModelFitExceptionIf the given list contains an amount of values that is greater than 1 and doesn't match the amount of values of the lists that are already part of the map (see pre-condition).

◆ begin()

const_iterator mitk::modelFit::StaticParameterMap::begin ( ) const
inline

Definition at line 89 of file mitkModelFitStaticParameterMap.h.

◆ Clear()

void mitk::modelFit::StaticParameterMap::Clear ( )

Resets the map, so it's empty.

◆ end()

const_iterator mitk::modelFit::StaticParameterMap::end ( ) const
inline

Definition at line 94 of file mitkModelFitStaticParameterMap.h.

◆ Get()

const ValueType& mitk::modelFit::StaticParameterMap::Get ( const std::string &  name) const

Returns the values of the given variable name.

Parameters
nameThe name of the variables whose values should be returned.
Returns
The values of the given variable name.
Exceptions
std::range_errorIf the variable name doesn't exist.

Referenced by mitk::ConcreteAIFBasedModelFactory< TwoTissueCompartmentModelParameterizer >::DoCreateParameterizer().

◆ Size()

MapType::size_type mitk::modelFit::StaticParameterMap::Size ( ) const
inline

Definition at line 84 of file mitkModelFitStaticParameterMap.h.

◆ Sort()

void mitk::modelFit::StaticParameterMap::Sort ( const std::string &  name = "")

Sorts the values of the given variable name in ascending order. The values of all other variables will also be switched in that specific order. If name is empty or the variable could not be found, the map is ordered by the first variable that contains more than one value (also in ascending order).

Example:

  • Before sorting:
    • "A": [3, 2, 5, 1, 4]
    • "B": [0]
    • "C": [3, 4, 1, 5, 2]
  • Sort():
    • "A": [1, 2, 3, 4, 5]
    • "B": [0]
    • "C": [5, 4, 3, 2, 1]
  • Sort("B"):
    • "A": [5, 4, 3, 2, 1]
    • "B": [0]
    • "C": [1, 2, 3, 4, 5]
  • Sort("X"):
    • "A": [1, 2, 3, 4, 5]
    • "B": [0]
    • "C": [5, 4, 3, 2, 1]
      Parameters
      nameThe name of the variable the map should be sorted by.

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