1 /* 2 * 3 * Copyright (C) 2015-2020, J. Riesmeier, Oldenburg, Germany 4 * All rights reserved. See COPYRIGHT file for details. 5 * 6 * Header file for class CID4020_PETRadionuclide 7 * 8 * Generated automatically from DICOM PS 3.16-2020e 9 * File created on 2020-11-25 11:12:55 by J. Riesmeier 10 * 11 */ 12 13 14 #ifndef CMR_CID4020_H 15 #define CMR_CID4020_H 16 17 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 18 19 #include "dcmtk/dcmsr/dsrctxgr.h" 20 #include "dcmtk/dcmsr/cmr/define.h" 21 22 #include "dcmtk/ofstd/ofmap.h" 23 24 25 /*---------------------* 26 * class declaration * 27 *---------------------*/ 28 29 /** Implementation of DCMR Context Group: 30 * CID 4020 - PET Radionuclide. 31 * (type: extensible, version: 20160119) 32 */ 33 class DCMTK_CMR_EXPORT CID4020_PETRadionuclide 34 : public DSRContextGroup 35 { 36 37 public: 38 39 /** types of PET radionuclide 40 */ 41 enum EnumType 42 { 43 /// (40565003,SCT,"^11^Carbon") 44 _11_Carbon, 45 /// (21576001,SCT,"^13^Nitrogen") 46 _13_Nitrogen, 47 /// (424875009,SCT,"^14^Oxygen") 48 _14_Oxygen, 49 /// (129504001,SCT,"^15^Oxygen") 50 _15_Oxygen, 51 /// (77004003,SCT,"^18^Fluorine") 52 _18_Fluorine, 53 /// (71633006,SCT,"^22^Sodium") 54 _22_Sodium, 55 /// (423764008,SCT,"^38^Potassium") 56 _38_Potassium, 57 /// (126605,DCM,"^43^Scandium") 58 _43_Scandium, 59 /// (126600,DCM,"^44^Scandium") 60 _44_Scandium, 61 /// (75696008,SCT,"^45^Titanium") 62 _45_Titanium, 63 /// (126601,DCM,"^51^Manganese") 64 _51_Manganese, 65 /// (69089000,SCT,"^52^Iron") 66 _52_Iron, 67 /// (37225000,SCT,"^52^Manganese") 68 _52_Manganese, 69 /// (126607,DCM,"^52m^Manganese") 70 _52m_Manganese, 71 /// (425364008,SCT,"^60^Copper") 72 _60_Copper, 73 /// (71425003,SCT,"^61^Copper") 74 _61_Copper, 75 /// (422934004,SCT,"^62^Copper") 76 _62_Copper, 77 /// (65054007,SCT,"^62^Zinc") 78 _62_Zinc, 79 /// (3932008,SCT,"^64^Copper") 80 _64_Copper, 81 /// (79477007,SCT,"^66^Gallium") 82 _66_Gallium, 83 /// (35337001,SCT,"^68^Gallium") 84 _68_Gallium, 85 /// (53315004,SCT,"^68^Germanium") 86 _68_Germanium, 87 /// (126602,DCM,"^70^Arsenic") 88 _70_Arsenic, 89 /// (2705002,SCT,"^72^Arsenic") 90 _72_Arsenic, 91 /// (87437000,SCT,"^73^Selenium") 92 _73_Selenium, 93 /// (17910003,SCT,"^75^Bromine") 94 _75_Bromine, 95 /// (79523006,SCT,"^76^Bromine") 96 _76_Bromine, 97 /// (86521004,SCT,"^77^Bromine") 98 _77_Bromine, 99 /// (79197006,SCT,"^82^Rubidium") 100 _82_Rubidium, 101 /// (10738001,SCT,"^86^Yttrium") 102 _86_Yttrium, 103 /// (63360001,SCT,"^89^Zirconium") 104 _89_Zirconium, 105 /// (126603,DCM,"^90^Niobium") 106 _90_Niobium, 107 /// (14691008,SCT,"^90^Yttrium") 108 _90_Yttrium, 109 /// (424079002,SCT,"^94m^Technetium") 110 _94m_Technetium, 111 /// (40937006,SCT,"^124^Iodine") 112 _124_Iodine, 113 /// (126606,DCM,"^152^Terbium") 114 _152_Terbium 115 }; 116 117 /** (default) constructor 118 ** @param selectedValue coded entry to be selected as the current value (optional). 119 * Should be a valid code according to the DICOM definitions 120 * for this context group, i.e. no checks are performed. 121 * Call DSRContextGroup::checkSelectedValue() if needed. 122 */ 123 CID4020_PETRadionuclide(const DSRCodedEntryValue &selectedValue = DSRCodedEntryValue()); 124 125 /** constructor 126 ** @param selectedValue type mapped to a coded entry that is selected as the 127 * current value 128 ** @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) 129 */ 130 CID4020_PETRadionuclide(const EnumType selectedValue, 131 const OFBool enhancedEncodingMode = OFFalse); 132 133 /** select a coded entry given by its type as the current value 134 ** @param selectedValue type mapped to a coded entry that is selected as the 135 * current value 136 * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) 137 ** @return status, EC_Normal if successful, an error code otherwise 138 */ 139 virtual OFCondition selectValue(const EnumType selectedValue, 140 const OFBool enhancedEncodingMode = OFFalse); 141 142 // --- static helper functions --- 143 144 /** initialize this context group explicitly. Internally, the list of standard coded 145 * entries is created and initialized by calling getCodes(). 146 ** @note This function can be called multiple times but in case of multi-threaded 147 * applications should be called at least once before any instance of this class 148 * is actually used. For single-threaded applications, there is no need to call 149 * it since the initialization is done implicitly. 150 */ 151 static void initialize(); 152 153 /** cleanup this context group, i.e.\ delete the internal list of standard coded entries. 154 * Usually, there is no need to call this method, but it might be useful in order to 155 * explicitly free the associated memory, e.g. when checking for memory leaks. The list 156 * will be recreated automatically when needed (or when initialize() is called). 157 */ 158 static void cleanup(); 159 160 /** map a given type to the associated coded entry 161 ** @param value type that should be mapped to a coded entry 162 * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) 163 ** @return coded entry that is associated with the given type 164 */ 165 static DSRCodedEntryValue getCodedEntry(const EnumType value, 166 const OFBool enhancedEncodingMode = OFFalse); 167 168 // --- reintroduce methods from base class 169 170 using DSRContextGroup::selectValue; 171 using DSRContextGroup::findCodedEntry; 172 173 174 protected: 175 176 /// type used for storing and managing the coded entries 177 typedef OFMap<EnumType, DSRBasicCodedEntry> CodeList; 178 179 /** print details on coded entries that are contained in this context group. 180 * See DSRCodedEntryValue::print() for details of the coded entry output. 181 ** @param stream stream to which the output should be printed 182 */ 183 virtual void printCodes(STD_NAMESPACE ostream &stream) const; 184 185 /** search for a given coded entry in this context group 186 ** @param searchForCodedEntry coded entry to be searched for 187 * @param foundCodedEntry pointer to variable that will store the coded entry 188 * (if found and pointer is not NULL) 189 * @param enhancedEncodingMode set enhanced encoding mode for coded entry (if enabled) 190 ** @return result of the search process, also defines the type of the entry 191 */ 192 virtual OFCondition findCodedEntry(const DSRCodedEntryValue &searchForCodedEntry, 193 DSRCodedEntryValue *foundCodedEntry, 194 const OFBool enhancedEncodingMode = OFFalse) const; 195 196 // --- static helper function --- 197 198 /** get list of standard coded entries that are managed by this context group. 199 * Internally, the singleton pattern is used, so the list is initialized only once. 200 * Please note that this function is not thread-safe. Therefore, the initialize() 201 * function can be called before any instance of this class is actually used. 202 ** @return reference to list of coded entries managed by this context group 203 */ 204 static CodeList &getCodes(); 205 206 /** set the "Enhanced Encoding Mode" for a given coded entry 207 ** @param codedEntryValue coded entry for which the enhanced encoding mode is set 208 ** @return status, EC_Normal if successful, an error code otherwise 209 */ 210 static OFCondition setEnhancedEncodingMode(DSRCodedEntryValue &codedEntryValue); 211 212 213 private: 214 215 /// pointer to internal code list (use a static variable for singleton pattern) 216 static CodeList *Codes; 217 }; 218 219 220 /*-------------------* 221 * type definition * 222 *-------------------*/ 223 224 // define short name for the context group class 225 typedef CID4020_PETRadionuclide CMR_CID4020; 226 227 228 #endif 229