Medical Imaging Interaction Toolkit  2025.12.02
Medical Imaging Interaction Toolkit
mitkScalarListLookupTable.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 mitkScalarListLookupTable_h
14 #define mitkScalarListLookupTable_h
15 
16 #include <string>
17 #include <vector>
18 #include <map>
19 #include <nlohmann/json_fwd.hpp>
20 
21 #include "MitkModelFitExports.h"
22 
23 namespace mitk
24 {
30  {
31  public:
32  typedef std::string KeyType;
33  typedef std::vector<double> ValueType;
34  typedef std::map<KeyType, ValueType> LookupTableType;
35  typedef std::pair<KeyType, ValueType> EntryType;
36 
39 
40  virtual const char* GetNameOfClass() const;
41 
47  void SetTableValue(const KeyType& key, const ValueType& value);
48 
54  bool ValueExists(const KeyType& key) const;
55 
62  const ValueType& GetTableValue(const KeyType& key) const;
63 
69 
70  void SetLookupTable(const LookupTableType& table);
71 
72  bool operator==(const ScalarListLookupTable& lookupTable) const;
73  bool operator!=(const ScalarListLookupTable& lookupTable) const;
74 
76 
77  protected:
79  };
80 
88  MITKMODELFIT_EXPORT std::ostream& operator<<(std::ostream& stream,
89  const ScalarListLookupTable& l);
90 
93 }
94 
95 #endif
#define MITKMODELFIT_EXPORT
Data class for modelfit properties that store a map of lists (e.g. static parameters).
bool operator!=(const ScalarListLookupTable &lookupTable) const
const ValueType & GetTableValue(const KeyType &key) const
Returns the list with the given name.
void SetLookupTable(const LookupTableType &table)
const LookupTableType & GetLookupTable() const
Returns the map of lists.
virtual const char * GetNameOfClass() const
std::map< KeyType, ValueType > LookupTableType
void SetTableValue(const KeyType &key, const ValueType &value)
Sets the list at the given map key to the given value.
std::pair< KeyType, ValueType > EntryType
bool ValueExists(const KeyType &key) const
Returns true if the list with the given name exists.
virtual ScalarListLookupTable & operator=(const ScalarListLookupTable &other)
bool operator==(const ScalarListLookupTable &lookupTable) const
nlohmann::json json
Find image slices visible on a given plane.
MITKCORE_EXPORT std::ostream & operator<<(std::ostream &o, DataNode::Pointer &dtn)
void to_json(nlohmann::json &j, const GenericLookupTable< T > &t)
void from_json(const nlohmann::json &, GenericLookupTable< T > &)