Medical Imaging Interaction Toolkit  2026.06.00
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 
40 
41  virtual const char* GetNameOfClass() const;
42 
48  void SetTableValue(const KeyType& key, const ValueType& value);
49 
55  bool ValueExists(const KeyType& key) const;
56 
63  const ValueType& GetTableValue(const KeyType& key) const;
64 
70 
71  void SetLookupTable(const LookupTableType& table);
72 
73  bool operator==(const ScalarListLookupTable& lookupTable) const;
74  bool operator!=(const ScalarListLookupTable& lookupTable) const;
75 
77 
78  protected:
80  };
81 
88  MITKMODELFIT_EXPORT std::ostream& operator<<(std::ostream& stream,
89  const ScalarListLookupTable& l);
90 
93 }
94 
95 #endif
#define MITKMODELFIT_EXPORT
Data class for model fit 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)
ScalarListLookupTable(const ScalarListLookupTable &)=default
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.
void from_json(const nlohmann::json &, GenericLookupTable< T > &)
Deserialize a GenericLookupTable from JSON.
MITKCORE_EXPORT std::ostream & operator<<(std::ostream &o, DataNode::Pointer &dtn)
Stream output operator for DataNode smart pointers.
void to_json(nlohmann::json &j, const GenericLookupTable< T > &t)
Serialize a GenericLookupTable to JSON.