#include <gdcmDictSet.h>
Inheritance diagram for GDCM_NAME_SPACE::DictSet:
Public Member Functions | |
void | Print (std::ostream &os=std::cout, std::string const &indent="") |
Print, in an informal fashion, the list of all the dictionaries contained is this DictSet, along with their respective content. | |
Dict * | LoadDictFromFile (std::string const &fileName, DictKey const &name) |
Loads a dictionary from a specified file, and add it to already the existing ones contained in this DictSet. | |
Dict * | GetDict (DictKey const &DictName) |
Retrieve the specified dictionary (when existing) from this DictSet. | |
Dict * | GetDefaultPubDict () |
Returns the default reference DICOM V3 public dictionary. | |
Dict * | GetFirstDict () |
Get the first dictionary while visiting the DictSet. | |
Dict * | GetNextDict () |
Get the next dictionary while visiting the Hash table (DictSetHT). | |
void | Delete () |
Delete the object. | |
void | Register () |
Register the object. | |
void | Unregister () |
Unregister the object. | |
const unsigned long & | GetRefCount () const |
Get the reference counting. | |
void | SetPrintLevel (int level) |
Sets the print level for the Dicom Header Elements. | |
int | GetPrintLevel () |
Gets the print level for the Dicom Entries. | |
Static Public Member Functions | |
static DictSet * | New () |
Contructs a DictSet with a RefCounter. | |
static std::string | BuildDictPath () |
Obtain from the GDCM_DICT_PATH environnement variable the path to directory containing the dictionaries. When the environnement variable is absent the path is defaulted to "../Dicts/". | |
Protected Member Functions | |
DictSet () | |
The Dictionary Set obtained with this constructor simply contains the Default Public dictionary. | |
~DictSet () | |
Destructor. | |
Protected Attributes | |
int | PrintLevel |
Amount of printed details for each Dicom Entries : 0 : stands for the least detail level. | |
Private Member Functions | |
gdcmTypeMacro (DictSet) | |
Private Attributes | |
DictSetHT | Dicts |
Hash table of all dictionaries contained in this DictSet. | |
DictSetHT::iterator | ItDictHt |
Iterator to visit the Dictionaries of a given DictSet. | |
std::string | DictPath |
Directory path to dictionaries. |
Definition at line 42 of file gdcmDictSet.h.
|
The Dictionary Set obtained with this constructor simply contains the Default Public dictionary.
Definition at line 35 of file gdcmDictSet.cxx. References BuildDictPath(), GDCM_NAME_SPACE::Global::DefaultPubDict, DictPath, Dicts, GDCM_NAME_SPACE::Dict::New(), PUB_DICT_FILENAME, and PUB_DICT_NAME. 00036 { 00037 DictPath = BuildDictPath(); 00038 std::string pubDictFile(DictPath); 00039 pubDictFile += PUB_DICT_FILENAME; 00040 Dicts[PUB_DICT_NAME] = Dict::New(pubDictFile); 00041 // Stored redundantly to avoid at access HTable DictSet every time. 00042 Global::DefaultPubDict = Dicts[PUB_DICT_NAME]; 00043 }
|
|
Destructor.
Definition at line 48 of file gdcmDictSet.cxx. References GDCM_NAME_SPACE::Global::DefaultPubDict, GDCM_NAME_SPACE::RefCounter::Delete(), and Dicts. 00049 { 00050 Global::DefaultPubDict = 0; // just a pointer! 00051 // Remove dictionaries 00052 for (DictSetHT::iterator tag = Dicts.begin(); tag != Dicts.end(); ++tag) 00053 { 00054 if ( tag->second ) 00055 tag->second->Delete(); 00056 } 00057 Dicts.clear(); 00058 }
|
|
Obtain from the GDCM_DICT_PATH environnement variable the path to directory containing the dictionaries. When the environnement variable is absent the path is defaulted to "../Dicts/".
Definition at line 131 of file gdcmDictSet.cxx. References gdcmStaticWarningMacro, and PUB_DICT_PATH. Referenced by GDCM_NAME_SPACE::DicomDirElement::DicomDirElement(), GDCM_NAME_SPACE::DictGroupName::DictGroupName(), DictSet(), and GDCM_NAME_SPACE::VR::VR(). 00132 { 00133 std::string resultPath; 00134 const char *envPath = getenv("GDCM_DICT_PATH"); 00135 00136 if (envPath && (strlen(envPath) != 0)) 00137 { 00138 resultPath = envPath; 00139 gdcmStaticWarningMacro( "Dictionary path set from environnement"); 00140 } 00141 else 00142 { 00143 resultPath = PUB_DICT_PATH; 00144 } 00145 if ( resultPath.length() && resultPath[resultPath.length()-1] != '/' ) 00146 { 00147 resultPath += '/'; 00148 } 00149 return resultPath; 00150 }
|
|
|
|
|
Returns the default reference DICOM V3 public dictionary.
Definition at line 63 of file gdcmDictSet.h. References GDCM_NAME_SPACE::Global::DefaultPubDict. Referenced by GDCM_NAME_SPACE::DocEntrySet::GetDictEntry(), GDCM_NAME_SPACE::DocEntry::GetName(), GDCM_NAME_SPACE::DocEntry::GetVM(), GDCM_NAME_SPACE::Document::Initialize(), and GDCM_NAME_SPACE::DocEntrySet::InsertEntryString(). 00063 { return Global::DefaultPubDict; }
|
|
Retrieve the specified dictionary (when existing) from this DictSet.
Definition at line 87 of file gdcmDictSet.cxx. References Dicts. Referenced by GDCM_NAME_SPACE::Document::SetShaDict(). 00088 { 00089 DictSetHT::iterator dict = Dicts.find(dictName); 00090 if ( dict != Dicts.end() ) 00091 { 00092 return dict->second; 00093 } 00094 return NULL; 00095 }
|
|
Get the first dictionary while visiting the DictSet.
Definition at line 101 of file gdcmDictSet.cxx. References Dicts, and ItDictHt. 00102 { 00103 ItDictHt = Dicts.begin(); 00104 if ( ItDictHt != Dicts.end() ) 00105 return ItDictHt->second; 00106 return NULL; 00107 }
|
|
Get the next dictionary while visiting the Hash table (DictSetHT).
Definition at line 114 of file gdcmDictSet.cxx. References Dicts, gdcmAssertMacro, and ItDictHt. 00115 { 00116 gdcmAssertMacro (ItDictHt != Dicts.end()); 00117 00118 ++ItDictHt; 00119 if ( ItDictHt != Dicts.end() ) 00120 return ItDictHt->second; 00121 return NULL; 00122 }
|
|
Gets the print level for the Dicom Entries.
Definition at line 50 of file gdcmBase.h. 00050 { return PrintLevel; }
|
|
Get the reference counting.
Definition at line 59 of file gdcmRefCounter.h. 00060 { 00061 return RefCount; 00062 }
|
|
Loads a dictionary from a specified file, and add it to already the existing ones contained in this DictSet.
Definition at line 70 of file gdcmDictSet.cxx. References Dicts, and GDCM_NAME_SPACE::Dict::New(). 00072 { 00073 assert(Dicts.find(name)==Dicts.end()); 00075 Dict *newDict = Dict::New(filename); 00076 Dicts[name] = newDict; 00077 00078 return newDict; 00079 }
|
|
Contructs a DictSet with a RefCounter.
Definition at line 48 of file gdcmDictSet.h. Referenced by GDCM_NAME_SPACE::Global::Global(). 00048 {return new DictSet();}
|
|
Print, in an informal fashion, the list of all the dictionaries contained is this DictSet, along with their respective content.
Reimplemented from GDCM_NAME_SPACE::Base. Definition at line 166 of file gdcmDictSet.cxx. References Dicts. 00167 { 00168 for (DictSetHT::iterator dict = Dicts.begin(); dict != Dicts.end(); ++dict) 00169 { 00170 os << "Printing dictionary " << dict->first << std::endl; 00171 dict->second->Print(os); 00172 } 00173 }
|
|
Register the object.
Definition at line 46 of file gdcmRefCounter.h. Referenced by GDCM_NAME_SPACE::SQItem::AddEntry(), GDCM_NAME_SPACE::SeqEntry::AddSQItem(), GDCM_NAME_SPACE::SeqEntry::Copy(), GDCM_NAME_SPACE::DicomDir::Copy(), GDCM_NAME_SPACE::FileHelper::FileHelper(), GDCM_NAME_SPACE::DocEntrySet::GetDictEntry(), GDCM_NAME_SPACE::DocEntry::GetName(), GDCM_NAME_SPACE::DocEntry::GetVM(), GDCM_NAME_SPACE::DocEntrySet::InsertEntryString(), GDCM_NAME_SPACE::CommandManager::InSetCommand(), GDCM_NAME_SPACE::DocEntryArchive::Push(), and GDCM_NAME_SPACE::SeqEntry::SetDelimitationItem(). 00046 { RefCount++; }
|
|
Sets the print level for the Dicom Header Elements.
Definition at line 47 of file gdcmBase.h. Referenced by GDCM_NAME_SPACE::FileHelper::Print(), and GDCM_NAME_SPACE::DicomDir::Print(). 00047 { PrintLevel = level; }
|
|
Unregister the object.
Definition at line 50 of file gdcmRefCounter.h. Referenced by GDCM_NAME_SPACE::Document::ReadNextDocEntry(), GDCM_NAME_SPACE::SQItem::RemoveEntry(), GDCM_NAME_SPACE::ElementSet::RemoveEntry(), and GDCM_NAME_SPACE::FileHelper::~FileHelper(). 00051 { 00052 //std::cout <<"================Unreg " << typeid(*this).name() << std::endl; 00053 RefCount--; 00054 if(RefCount<=0) 00055 delete this; 00056 }
|
|
Directory path to dictionaries.
Definition at line 85 of file gdcmDictSet.h. Referenced by DictSet(). |
|
Hash table of all dictionaries contained in this DictSet.
Definition at line 80 of file gdcmDictSet.h. Referenced by DictSet(), GetDict(), GetFirstDict(), GetNextDict(), LoadDictFromFile(), Print(), and ~DictSet(). |
|
Iterator to visit the Dictionaries of a given DictSet.
Definition at line 82 of file gdcmDictSet.h. Referenced by GetFirstDict(), and GetNextDict(). |
|
Amount of printed details for each Dicom Entries : 0 : stands for the least detail level.
Definition at line 55 of file gdcmBase.h. Referenced by GDCM_NAME_SPACE::SeqEntry::Print(), GDCM_NAME_SPACE::FileHelper::Print(), GDCM_NAME_SPACE::ElementSet::Print(), GDCM_NAME_SPACE::DocEntry::Print(), GDCM_NAME_SPACE::DictEntry::Print(), GDCM_NAME_SPACE::DicomDirStudy::Print(), GDCM_NAME_SPACE::DicomDirSerie::Print(), GDCM_NAME_SPACE::DicomDirPatient::Print(), GDCM_NAME_SPACE::DicomDirMeta::Print(), GDCM_NAME_SPACE::DicomDir::Print(), and GDCM_NAME_SPACE::DataEntry::Print(). |