Program: gdcm
Module: $RCSfile: gdcmCommon.h,v $
Language: C++
- Date: $Date: 2006/04/11 16:03:26 $
- Version: $Revision: 1.109 $
+ Date: $Date: 2006/04/12 10:55:49 $
+ Version: $Revision: 1.110 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#ifndef PUB_DICT_PATH
# define PUB_DICT_PATH "../Dicts/"
#endif
-#define PUB_DICT_NAME "DicomV3Dict"
+#define PUB_DICT_NAME "dicomV3Dict"
+// dicomV3.dic replaced by the generated gdcm.dic/
+// if gdcm.dic not found, method FillDefaultDataDict() is invoked
+//#define PUB_DICT_FILENAME "dicomV3.dic"
#define PUB_DICT_FILENAME "gdcm.dic"
#define DICT_ELEM "DicomDir.dic"
#define DICT_TS "dicomTS.dic"
Program: gdcm
Module: $RCSfile: gdcmDict.cxx,v $
Language: C++
- Date: $Date: 2006/04/11 16:03:26 $
- Version: $Revision: 1.84 $
+ Date: $Date: 2006/04/12 10:55:49 $
+ Version: $Revision: 1.85 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
FillDefaultDataDict( this );
}
else
- {
+ {
gdcmDebugMacro( "in Dict::Dict, DoTheLoadingJob filename =["
<< filename << "]" );
DoTheLoadingJob(from);
*/
bool Dict::AddDict(std::string const &filename)
{
-
std::ifstream from( filename.c_str() );
if ( !from )
{
}
}
-
/**
* \brief Removes from the current Dicom Dict all the entries held in a source dictionary
* \note it concerns only Private Dictionnary
TagName vm;
TagName name;
- while (!from.eof() && from)
+ while ( true )
{
from >> std::hex;
from >> group;
+
+ if (from.eof())
+ break;
+
from >> elem;
from >> vr;
from >> vm;
}
}
-/**
- * \brief replaces an already existing Dicom Element by a new one
- * @param newEntry new entry (overwrites any previous one with same tag)
- * @return false if Dicom Element doesn't exist
+/*
+ * \ brief replaces an already existing Dicom Element by a new one
+ * @ param newEntry new entry (overwrites any previous one with same tag)
+ * @ return false if Dicom Element doesn't exist
*/
/* seems to be useless
return false;
}
*/
+
/**
* \brief removes an already existing Dicom Dictionary Entry,
* identified by its Tag
*/
void Dict::DoTheLoadingJob(std::ifstream &from)
{
+ if (!from)
+ return;
+
uint16_t group;
uint16_t elem;
VRKey vr;
TagName name;
DictEntry *newEntry;
- while (!from.eof() && from)
+ while ( true )
{
from >> std::hex;
- from >> group;
+ from >> group;
from >> elem;
from >> vr;
from >> vm;
from >> std::ws; //remove white space
std::getline(from, name);
-
+
+ if(from.eof()) {
+ break;
+ }
+
newEntry = DictEntry::New(group, elem, vr, vm, name);
AddEntry(newEntry);
newEntry->Delete();