Medical Imaging Interaction Toolkit
2023.04.00
Medical Imaging Interaction Toolkit
|
Go to the documentation of this file.
13 #ifndef mitkGenericLookupTable_h
14 #define mitkGenericLookupTable_h
21 #include <itkDataObject.h>
66 throw std::range_error(
"id does not exist in the lookup table");
98 #define mitkSpecializeGenericLookupTable(LookupTableName, Type) \
100 class MITKCORE_EXPORT LookupTableName : public GenericLookupTable<Type> \
104 typedef LookupTableName Self; \
105 typedef GenericLookupTable<Type> Superclass; \
106 virtual const char *GetNameOfClass() const { return #LookupTableName; } \
107 LookupTableName() {} \
108 virtual Superclass &operator=(const Superclass &other) { return Superclass::operator=(other); } \
109 virtual ~LookupTableName() {} \
112 MITKCORE_EXPORT std::ostream &operator<<(std::ostream &stream, const LookupTableName & );
119 #define mitkSpecializeGenericLookupTableOperator(LookupTableName) \
121 std::ostream &mitk::operator<<(std::ostream &stream, const LookupTableName &l) \
124 typedef LookupTableName::LookupTableType::const_iterator IterType; \
125 IterType e = l.GetLookupTable().end(); \
126 IterType b = l.GetLookupTable().begin(); \
128 for (IterType i = b; i != e; ++i) \
134 stream << i->first << " -> " << i->second; \
136 return stream << "]"; \
virtual Self & operator=(const Self &other)
void SetTableValue(IdentifierType id, ValueType value)
const LookupTableType & GetLookupTable() const
virtual const char * GetNameOfClass() const
bool operator!=(const Self &lookupTable) const
ValueType GetTableValue(IdentifierType id) const
DataCollection - Class to facilitate loading/accessing structured data.
bool ValueExists(IdentifierType id) const
unsigned int IdentifierType
LookupTableType m_LookupTable
bool operator==(const Self &lookupTable) const
std::map< IdentifierType, ValueType > LookupTableType
Template class for generating lookup-tables.
virtual ~GenericLookupTable()