Program: gdcm
Module: $RCSfile: gdcmDebug.cxx,v $
Language: C++
- Date: $Date: 2004/07/19 11:51:26 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2004/08/01 02:39:09 $
+ Version: $Revision: 1.4 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @param Msg1 first message part
* @param Msg2 second message part
*/
-void gdcmDebug::Verbose(int Level, const char * Msg1, const char * Msg2)
+void gdcmDebug::Verbose(int level, const char * msg1, const char * msg2)
{
- if (Level > DebugLevel)
+ if (level > DebugLevel)
+ {
return ;
- std::cerr << Msg1 << ' ' << Msg2 << std::endl;
+ }
+ std::cerr << msg1 << ' ' << msg2 << std::endl;
}
/**
* @param Msg1 first message part
* @param Msg2 second message part
*/
-void gdcmDebug::Error( bool Test, const char * Msg1, const char * Msg2)
+void gdcmDebug::Error(bool test, const char * msg1, const char * msg2)
{
- if (!Test)
+ if (!test)
+ {
return;
- std::cerr << Msg1 << ' ' << Msg2 << std::endl;
+ }
+ std::cerr << msg1 << ' ' << msg2 << std::endl;
Exit(1);
}
* @param Msg2 second message part
* @param Msg3 Third message part
*/
-void gdcmDebug::Error(const char* Msg1, const char* Msg2,
- const char* Msg3)
+void gdcmDebug::Error(const char* msg1, const char* msg2,
+ const char* msg3)
{
- std::cerr << Msg1 << ' ' << Msg2 << ' ' << Msg3 << std::endl;
+ std::cerr << msg1 << ' ' << msg2 << ' ' << msg3 << std::endl;
Exit(1);
}
* @param Msg1 first message part
* @param Msg2 second message part
*/
-void gdcmDebug::Assert(int Level, bool Test,
- const char * Msg1, const char * Msg2)
+void gdcmDebug::Assert(int level, bool test, const char * msg1,
+ const char * msg2)
{
- if (Level > DebugLevel)
+ if (level > DebugLevel)
+ {
return ;
- if (!Test)
- std::cerr << Msg1 << ' ' << Msg2 << std::endl;
+ }
+ if (!test)
+ {
+ std::cerr << msg1 << ' ' << msg2 << std::endl;
+ }
}
/**
Program: gdcm
Module: $RCSfile: gdcmDebug.h,v $
Language: C++
- Date: $Date: 2004/07/19 11:51:26 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2004/08/01 02:39:09 $
+ Version: $Revision: 1.5 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* Shown only when the debug level is higher than the
* message level.
*/
-class GDCM_EXPORT gdcmDebug {
+class GDCM_EXPORT gdcmDebug
+{
public:
gdcmDebug(int level = -1);
void SetDebug (int level);
- void Verbose(int, const char*, const char* ="");
- void Error(bool, const char*, const char* ="");
- void Error(const char*, const char* ="", const char* ="");
+ void Verbose(int level, const char* msg1, const char* msg2 = "") ;
+ void Error (bool test, const char* msg1, const char* msg2 = "");
+ void Error (const char* msg1, const char* msg2 = "", const char* msg3 = "");
- void Assert(int, bool, const char*, const char*);
- void Exit(int);
+ void Assert(int level, bool test, const char * msg1, const char * msg2);
+ void Exit(int a);
static gdcmDebug &GetReference();
Program: gdcm
Module: $RCSfile: gdcmDicomDir.cxx,v $
Language: C++
- Date: $Date: 2004/07/30 16:09:27 $
- Version: $Revision: 1.61 $
+ Date: $Date: 2004/08/01 02:39:09 $
+ Version: $Revision: 1.62 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
progress = 0.0;
abort = false;
- metaElems = (gdcmDicomDirMeta *)0;
+ metaElems = 0;
}
bool gdcmDicomDir::Write(std::string const & fileName)
{
- FILE * fp1;
-
- fp1 = fopen(fileName.c_str(), "wb");
+ FILE * fp1 = fopen(fileName.c_str(), "wb");
if( !fp1 )
{
printf("Failed to open(write) File [%s] \n", fileName.c_str());
Program: gdcm
Module: $RCSfile: gdcmDicomDirElement.cxx,v $
Language: C++
- Date: $Date: 2004/06/23 03:36:24 $
- Version: $Revision: 1.13 $
+ Date: $Date: 2004/08/01 02:39:09 $
+ Version: $Revision: 1.14 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* \brief constructor : populates the chained lists
* from the file 'Dicts/DicomDir.dic'
*/
-gdcmDicomDirElement::gdcmDicomDirElement() {
- std::string filename=gdcmDictSet::BuildDictPath() + std::string(DICT_ELEM);
+gdcmDicomDirElement::gdcmDicomDirElement()
+{
+ std::string filename = gdcmDictSet::BuildDictPath() + std::string(DICT_ELEM);
std::ifstream from(filename.c_str());
dbg.Error(!from, "gdcmDicomDirElement::gdcmDicomDirElement: can't open dictionary",filename.c_str());
std::string type;
gdcmElement elem;
- while (!from.eof()) {
+ while (!from.eof())
+ {
eatwhite(from);
from.getline(buff, 1024, ' ');
type = buff;
from.getline(buff, 1024, '"');
elem.value = buff;
- if(type=="metaElem")
- DicomDirMetaList.push_back(elem);
- else if(type=="patientElem")
+ if( type == "metaElem" )
+ {
+ DicomDirMetaList.push_back(elem);
+ }
+ else if( type == "patientElem" )
+ {
DicomDirPatientList.push_back(elem);
- else if(type=="studyElem")
+ }
+ else if( type == "studyElem" )
+ {
DicomDirStudyList.push_back(elem);
- else if(type=="serieElem")
+ }
+ else if( type == "serieElem" )
+ {
DicomDirSerieList.push_back(elem);
- else if(type=="imageElem")
+ }
+ else if( type == "imageElem" )
+ {
DicomDirImageList.push_back(elem);
+ }
}
from.getline(buff, 1024, '\n');
}
* \ingroup gdcmDicomDirElement
* \brief canonical destructor
*/
-gdcmDicomDirElement::~gdcmDicomDirElement() {
+gdcmDicomDirElement::~gdcmDicomDirElement()
+{
DicomDirMetaList.clear();
DicomDirPatientList.clear();
DicomDirStudyList.clear();
* \todo add a 'Print Level' check
* @param os The output stream to be written to.
*/
-void gdcmDicomDirElement::Print(std::ostream &os) {
+void gdcmDicomDirElement::Print(std::ostream &os)
+{
std::ostringstream s;
std::list<gdcmElement>::iterator it;
char greltag[10]; //group element tag
s << "Meta Elements :"<<std::endl;
- for (it = DicomDirMetaList.begin();it!=DicomDirMetaList.end();++it)
+ for (it = DicomDirMetaList.begin(); it != DicomDirMetaList.end(); ++it)
{
sprintf(greltag,"%04x|%04x ",it->group,it->elem);
s << " ("<<greltag<<") = "<< it->value<<std::endl;
}
s << "Patient Elements :"<<std::endl;
- for (it = DicomDirPatientList.begin();it!=DicomDirPatientList.end();++it)
+ for (it = DicomDirPatientList.begin(); it != DicomDirPatientList.end(); ++it)
{
sprintf(greltag,"%04x|%04x ",it->group,it->elem);
s << " ("<<greltag<<") = "<< it->value<<std::endl;
}
s << "Study Elements :"<<std::endl;
- for (it = DicomDirStudyList.begin();it!=DicomDirStudyList.end();++it)
+ for (it = DicomDirStudyList.begin(); it != DicomDirStudyList.end(); ++it)
{
sprintf(greltag,"%04x|%04x ",it->group,it->elem);
s << " ("<<greltag<<") = "<< it->value<<std::endl;
}
s << "Serie Elements :"<<std::endl;
- for (it = DicomDirSerieList.begin();it!=DicomDirSerieList.end();++it)
+ for (it = DicomDirSerieList.begin(); it != DicomDirSerieList.end(); ++it)
{
sprintf(greltag,"%04x|%04x ",it->group,it->elem);
s << " ("<<greltag<<") = "<< it->value<<std::endl;
}
s << "Image Elements :"<<std::endl;
- for (it = DicomDirImageList.begin();it!=DicomDirImageList.end();++it)
+ for (it = DicomDirImageList.begin(); it != DicomDirImageList.end(); ++it)
{
sprintf(greltag,"%04x|%04x ",it->group,it->elem);
s << " ("<<greltag<<") = "<< it->value<<std::endl;
Program: gdcm
Module: $RCSfile: gdcmDicomDirElement.h,v $
Language: C++
- Date: $Date: 2004/06/20 18:08:47 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2004/08/01 02:39:09 $
+ Version: $Revision: 1.9 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
class GDCM_EXPORT gdcmDicomDirElement
{
public:
- gdcmDicomDirElement(void);
- ~gdcmDicomDirElement(void);
+ gdcmDicomDirElement();
+ ~gdcmDicomDirElement();
/**
* \brief canonical Printer
* \brief returns a reference to the chained List
* related to the META Elements of a DICOMDIR.
*/
- ListDicomDirMetaElem &GetDicomDirMetaElements(void)
- {return(DicomDirMetaList);};
+ ListDicomDirMetaElem &GetDicomDirMetaElements()
+ { return DicomDirMetaList; };
/**
* \ingroup gdcmDicomDirElement
* \brief returns a reference to the chained List
* related to the PATIENT Elements of a DICOMDIR.
*/
- ListDicomDirPatientElem &GetDicomDirPatientElements(void)
- {return(DicomDirPatientList);};
+ ListDicomDirPatientElem &GetDicomDirPatientElements()
+ { return DicomDirPatientList; };
/**
* \ingroup gdcmDicomDirElement
* \brief returns a reference to the chained List
* related to the STUDY Elements of a DICOMDIR.
*/
- ListDicomDirStudyElem &GetDicomDirStudyElements(void)
- {return(DicomDirStudyList);};
+ ListDicomDirStudyElem &GetDicomDirStudyElements()
+ { return DicomDirStudyList; };
/**
* \ingroup gdcmDicomDirElement
* \brief returns a reference to the chained List
* related to the SERIE Elements of a DICOMDIR.
*/
- ListDicomDirSerieElem &GetDicomDirSerieElements(void)
- {return(DicomDirSerieList);};
+ ListDicomDirSerieElem &GetDicomDirSerieElements()
+ { return DicomDirSerieList; };
/**
* \ingroup gdcmDicomDirElement
* \brief returns a reference to the chained List
* related to the IMAGE Elements of a DICOMDIR.
*/
- ListDicomDirImageElem &GetDicomDirImageElements(void)
- {return(DicomDirImageList);};
+ ListDicomDirImageElem &GetDicomDirImageElements()
+ { return DicomDirImageList; };
private:
/// gdcmElements chained list, related to the MetaElements of DICOMDIR
Program: gdcm
Module: $RCSfile: gdcmDicomDirImage.cxx,v $
Language: C++
- Date: $Date: 2004/06/20 18:08:47 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2004/08/01 02:39:09 $
+ Version: $Revision: 1.8 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
*/
void gdcmDicomDirImage::Print(std::ostream &os)
{
- os<<"IMAGE : ";
+ os << "IMAGE : ";
for(ListDocEntry::iterator i=docEntries.begin();i!=docEntries.end();++i)
{
- if( ((*i)->GetGroup()==0x0004) && ((*i)->GetElement()==0x1500) )
- os<<((gdcmValEntry *)(*i))->GetValue();
+ if( (*i)->GetGroup() == 0x0004 && (*i)->GetElement() == 0x1500 )
+ {
+ os << ((gdcmValEntry *)(*i))->GetValue(); //FIXME
+ }
}
- os<<std::endl;
+ os << std::endl;
gdcmObject::Print(os);
}
Program: gdcm
Module: $RCSfile: gdcmDicomDirImage.h,v $
Language: C++
- Date: $Date: 2004/06/20 18:08:47 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2004/08/01 02:39:09 $
+ Version: $Revision: 1.6 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmObject.h"
//-----------------------------------------------------------------------------
-class GDCM_EXPORT gdcmDicomDirImage : public gdcmObject {
+class GDCM_EXPORT gdcmDicomDirImage : public gdcmObject
+{
public:
gdcmDicomDirImage(gdcmSQItem *s, TagDocEntryHT *ptagHT);
gdcmDicomDirImage(TagDocEntryHT *ptagHT);
- ~gdcmDicomDirImage(void);
+ ~gdcmDicomDirImage();
virtual void Print(std::ostream &os = std::cout);
};
Program: gdcm
Module: $RCSfile: gdcmDicomDirMeta.cxx,v $
Language: C++
- Date: $Date: 2004/06/20 18:08:47 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2004/08/01 02:39:09 $
+ Version: $Revision: 1.5 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
*/
void gdcmDicomDirMeta::Print(std::ostream &os)
{
- os<<"META"<<std::endl;
+ os << "META" << std::endl;
gdcmObject::Print(os);
}
Program: gdcm
Module: $RCSfile: gdcmDicomDirMeta.h,v $
Language: C++
- Date: $Date: 2004/06/20 18:08:47 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2004/08/01 02:39:09 $
+ Version: $Revision: 1.5 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
public:
gdcmDicomDirMeta(TagDocEntryHT *ptagHT);
- ~gdcmDicomDirMeta(void);
+ ~gdcmDicomDirMeta();
virtual void Print(std::ostream &os = std::cout);
};
Program: gdcm
Module: $RCSfile: gdcmDicomDirPatient.cxx,v $
Language: C++
- Date: $Date: 2004/08/01 00:59:21 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2004/08/01 02:39:09 $
+ Version: $Revision: 1.10 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
*/
gdcmDicomDirPatient::~gdcmDicomDirPatient()
{
- for(ListDicomDirStudy::iterator cc = studies.begin();cc != studies.end();++cc)
+ for(ListDicomDirStudy::iterator cc = studies.begin();
+ cc != studies.end(); ++cc)
{
delete *cc;
}
Program: gdcm
Module: $RCSfile: gdcmDicomDirPatient.h,v $
Language: C++
- Date: $Date: 2004/07/02 13:55:27 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2004/08/01 02:39:09 $
+ Version: $Revision: 1.6 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
gdcmDicomDirPatient(gdcmSQItem *s, TagDocEntryHT *ptagHT);
gdcmDicomDirPatient(TagDocEntryHT *ptagHT);
- ~gdcmDicomDirPatient(void);
+ ~gdcmDicomDirPatient();
virtual void Print(std::ostream &os = std::cout);
void AddDicomDirStudy(gdcmDicomDirStudy *obj) { studies.push_back(obj); };
/// TODO
- gdcmDicomDirStudy* NewStudy(void);
+ gdcmDicomDirStudy* NewStudy();
private:
Program: gdcm
Module: $RCSfile: gdcmDicomDirSerie.h,v $
Language: C++
- Date: $Date: 2004/07/02 13:55:27 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2004/08/01 02:39:09 $
+ Version: $Revision: 1.6 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
public:
gdcmDicomDirSerie(gdcmSQItem *s, TagDocEntryHT *ptagHT);
gdcmDicomDirSerie(TagDocEntryHT *ptagHT);
- ~gdcmDicomDirSerie(void);
+
+ ~gdcmDicomDirSerie();
virtual void Print(std::ostream &os = std::cout);
/**
* \ingroup gdcmDicomDirSerie
* \brief returns the IMAGE chained List for this SERIE.
*/
- ListDicomDirImage &GetDicomDirImages()
- {return images;};
+ ListDicomDirImage &GetDicomDirImages() { return images; };
/**
* \ingroup gdcmDicomDirSerie
* \brief adds the passed IMAGE to the IMAGE chained List for this SERIE.
*/
- void AddDicomDirImage(gdcmDicomDirImage *obj)
- {images.push_back(obj);};
+ void AddDicomDirImage(gdcmDicomDirImage *obj) { images.push_back(obj); };
/**
* \ingroup gdcmDicomDirSerie
* \brief TODO
*/
- gdcmDicomDirImage* NewImage(void);
+ gdcmDicomDirImage* NewImage();
private:
/**
Program: gdcm
Module: $RCSfile: gdcmDicomDirStudy.cxx,v $
Language: C++
- Date: $Date: 2004/08/01 00:59:21 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2004/08/01 02:39:09 $
+ Version: $Revision: 1.9 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
*/
void gdcmDicomDirStudy::Print(std::ostream &os)
{
- os<<"STUDY"<<std::endl;
+ os << "STUDY" << std::endl;
gdcmObject::Print(os);
for(ListDicomDirSerie::iterator cc = series.begin();
Program: gdcm
Module: $RCSfile: gdcmDicomDirStudy.h,v $
Language: C++
- Date: $Date: 2004/07/02 13:55:27 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2004/08/01 02:39:09 $
+ Version: $Revision: 1.6 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
typedef std::list<gdcmDicomDirSerie *> ListDicomDirSerie;
//-----------------------------------------------------------------------------
-class GDCM_EXPORT gdcmDicomDirStudy : public gdcmObject {
+class GDCM_EXPORT gdcmDicomDirStudy : public gdcmObject
+{
public:
gdcmDicomDirStudy(gdcmSQItem *s, TagDocEntryHT *ptagHT);
gdcmDicomDirStudy(TagDocEntryHT *ptagHT);
- ~gdcmDicomDirStudy(void);
+ ~gdcmDicomDirStudy();
virtual void Print(std::ostream &os = std::cout);
/**
* \ingroup gdcmDicomDirStudy
* \brief returns the SERIE chained List for this STUDY.
*/
- ListDicomDirSerie &GetDicomDirSeries()
- {return series;};
+ ListDicomDirSerie &GetDicomDirSeries() { return series; };
/**
* \ingroup gdcmDicomDirStudy
* \brief adds the passed SERIE to the SERIE chained List for this STUDY.
*/
- void AddDicomDirSerie(gdcmDicomDirSerie *obj)
- {series.push_back(obj);};
+ void AddDicomDirSerie(gdcmDicomDirSerie *obj) { series.push_back(obj); };
/**
* \ingroup gdcmDicomDirStudy
* \brief TODO
*/
- gdcmDicomDirSerie* NewSerie(void);
+ gdcmDicomDirSerie* NewSerie();
private:
/**
Program: gdcm
Module: $RCSfile: gdcmDict.cxx,v $
Language: C++
- Date: $Date: 2004/07/28 21:23:20 $
- Version: $Revision: 1.40 $
+ Date: $Date: 2004/08/01 02:39:09 $
+ Version: $Revision: 1.41 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @param NewEntry entry to add
* @return false if Dicom Element already exists
*/
-bool gdcmDict::AddNewEntry(gdcmDictEntry *NewEntry)
+bool gdcmDict::AddNewEntry(gdcmDictEntry *newEntry)
{
- gdcmTagKey key = NewEntry->GetKey();
+ gdcmTagKey key = newEntry->GetKey();
if(KeyHt.count(key) == 1)
{
}
else
{
- KeyHt[NewEntry->GetKey()] = NewEntry;
- NameHt[NewEntry->GetName()] = NewEntry;
+ KeyHt[newEntry->GetKey()] = newEntry;
+ NameHt[newEntry->GetName()] = newEntry;
return true;
}
}
* @param NewEntry new entry (overwrites any previous one with same tag)
* @return false if Dicom Element doesn't exist
*/
-bool gdcmDict::ReplaceEntry(gdcmDictEntry *NewEntry)
+bool gdcmDict::ReplaceEntry(gdcmDictEntry *newEntry)
{
- if ( RemoveEntry(NewEntry->gdcmDictEntry::GetKey()) )
+ if ( RemoveEntry(newEntry->gdcmDictEntry::GetKey()) )
{
- KeyHt[NewEntry->GetKey()] = NewEntry;
- NameHt[NewEntry->GetName()] = NewEntry;
+ KeyHt[newEntry->GetKey()] = newEntry;
+ NameHt[newEntry->GetName()] = newEntry;
return true;
}
return false;
{
if(KeyHt.count(key) == 1)
{
- gdcmDictEntry* EntryToDelete = KeyHt.find(key)->second;
+ gdcmDictEntry* entryToDelete = KeyHt.find(key)->second;
- if ( EntryToDelete )
+ if ( entryToDelete )
{
- NameHt.erase(EntryToDelete->GetName());
- delete EntryToDelete;
+ NameHt.erase(entryToDelete->GetName());
+ delete entryToDelete;
}
KeyHt.erase(key);
*/
bool gdcmDict::RemoveEntry (uint16_t group, uint16_t element)
{
- return( RemoveEntry(gdcmDictEntry::TranslateToKey(group, element)) );
+ return RemoveEntry(gdcmDictEntry::TranslateToKey(group, element));
}
/**
Program: gdcm
Module: $RCSfile: gdcmDictSet.cxx,v $
Language: C++
- Date: $Date: 2004/08/01 00:59:21 $
- Version: $Revision: 1.33 $
+ Date: $Date: 2004/08/01 02:39:09 $
+ Version: $Revision: 1.34 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
gdcmDictSet::gdcmDictSet()
{
DictPath = BuildDictPath();
- std::string PubDictFile(DictPath);
- PubDictFile += PUB_DICT_FILENAME; /// MEMORY LEAK std::string::operator+=
- Dicts[PUB_DICT_NAME] = new gdcmDict(PubDictFile);
+ std::string pubDictFile(DictPath);
+ pubDictFile += PUB_DICT_FILENAME;
+ Dicts[PUB_DICT_NAME] = new gdcmDict(pubDictFile);
}
/**
// Remove dictionnaries
for (DictSetHT::iterator tag = Dicts.begin(); tag != Dicts.end(); ++tag)
{
- gdcmDict *EntryToDelete = tag->second;
- if ( EntryToDelete )
- delete EntryToDelete;
- tag->second=NULL;
+ gdcmDict *entryToDelete = tag->second;
+ if ( entryToDelete )
+ {
+ delete entryToDelete;
+ }
+ tag->second = NULL;
}
Dicts.clear();
// Remove virtual dictionnary entries
std::map<std::string,gdcmDictEntry *>::iterator it;
- for(it=virtualEntry.begin(); it!=virtualEntry.end(); ++it)
+ for(it = VirtualEntry.begin(); it != VirtualEntry.end(); ++it)
{
- gdcmDictEntry *Entry = it->second;
- if ( Entry )
- delete Entry;
- it->second=NULL;
+ gdcmDictEntry *entry = it->second;
+ if ( entry )
+ {
+ delete entry;
+ }
+ it->second = NULL;
}
}
* \sa gdcmDictSet::GetPubDictTagNamesByCategory
* @return A list of all entries of the public dicom dictionnary.
*/
-std::list<std::string> *gdcmDictSet::GetPubDictEntryNames(void)
+std::list<std::string> *gdcmDictSet::GetPubDictEntryNames()
{
- return(GetDefaultPubDict()->GetDictEntryNames());
+ return GetDefaultPubDict()->GetDictEntryNames();
}
/**
* corresponding values are lists of all the dictionnary entries
* among that group.
*/
-std::map<std::string, std::list<std::string> > *gdcmDictSet::GetPubDictEntryNamesByCategory(void)
+std::map<std::string, std::list<std::string> > *
+ gdcmDictSet::GetPubDictEntryNamesByCategory()
{
- return(GetDefaultPubDict()->GetDictEntryNamesByCategory());
+ return GetDefaultPubDict()->GetDictEntryNamesByCategory();
}
/**
* @param Name Symbolic name that be used as identifier of the newly
* created dictionary.
*/
-gdcmDict *gdcmDictSet::LoadDictFromFile(std::string FileName, DictKey Name)
+gdcmDict *gdcmDictSet::LoadDictFromFile(std::string const & fileName,
+ DictKey const & name)
{
- gdcmDict *NewDict = new gdcmDict(FileName);
- AppendDict(NewDict,Name);
- return(NewDict);
+ gdcmDict *newDict = new gdcmDict(fileName);
+ AppendDict(newDict, name);
+
+ return newDict;
}
/**
* @param DictName The symbolic name of the searched dictionary.
* \result The retrieved dictionary.
*/
-gdcmDict *gdcmDictSet::GetDict(DictKey DictName)
+gdcmDict *gdcmDictSet::GetDict(DictKey const & dictName)
{
- DictSetHT::iterator dict = Dicts.find(DictName);
- if(dict!=Dicts.end())
+ DictSetHT::iterator dict = Dicts.find(dictName);
+ if(dict != Dicts.end())
+ {
return dict->second;
+ }
return NULL;
}
std::string name)
{
gdcmDictEntry* entry;
- std::string tag = gdcmDictEntry::TranslateToKey(group,element)
- + "#" + vr + "#" + fourth + "#" + name;
+ const std::string tag = gdcmDictEntry::TranslateToKey(group,element)
+ + "#" + vr + "#" + fourth + "#" + name;
std::map<std::string,gdcmDictEntry *>::iterator it;
- it=virtualEntry.find(tag);
- if(it!=virtualEntry.end())
+ it = VirtualEntry.find(tag);
+ if(it != VirtualEntry.end())
{
- entry=it->second;
+ entry = it->second;
}
else
{
- entry=new gdcmDictEntry(group,element,vr,fourth,name);
- virtualEntry[tag]=entry;
+ entry = new gdcmDictEntry(group, element, vr, fourth, name);
+ VirtualEntry[tag] = entry;
}
- return(entry);
+
+ return entry;
}
/**
* to "../Dicts/".
* @return path to directory containing the dictionnaries
*/
-std::string gdcmDictSet::BuildDictPath(void)
+std::string gdcmDictSet::BuildDictPath()
{
- std::string ResultPath;
- const char *EnvPath = (char*)0;
- EnvPath = getenv("GDCM_DICT_PATH");
- if (EnvPath && (strlen(EnvPath) != 0))
+ std::string resultPath;
+ const char *envPath = 0;
+ envPath = getenv("GDCM_DICT_PATH");
+
+ if (envPath && (strlen(envPath) != 0))
{
- ResultPath = EnvPath;
- if (ResultPath[ResultPath.length() -1] != '/' )
- ResultPath += '/';
+ resultPath = envPath;
+ if ( resultPath[resultPath.length()-1] != '/' )
+ {
+ resultPath += '/';
+ }
dbg.Verbose(1, "gdcmDictSet::BuildDictPath:",
"Dictionary path set from environnement");
}
else
- ResultPath = PUB_DICT_PATH;
- return ResultPath;
+ {
+ resultPath = PUB_DICT_PATH;
+ }
+
+ return resultPath;
}
//-----------------------------------------------------------------------------
// Protected
-bool gdcmDictSet::AppendDict(gdcmDict *NewDict,DictKey Name)
+bool gdcmDictSet::AppendDict(gdcmDict *newDict, DictKey const & name)
{
- Dicts[Name] = NewDict;
- return(true);
+ Dicts[name] = newDict;
+
+ return true; //FIXME
}
//-----------------------------------------------------------------------------
Program: gdcm
Module: $RCSfile: gdcmDictSet.h,v $
Language: C++
- Date: $Date: 2004/08/01 00:59:21 $
- Version: $Revision: 1.22 $
+ Date: $Date: 2004/08/01 02:39:09 $
+ Version: $Revision: 1.23 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
std::map<std::string, std::list<std::string> > *
GetPubDictEntryNamesByCategory();
- gdcmDict *LoadDictFromFile(std::string FileName, DictKey Name);
+ gdcmDict *LoadDictFromFile(std::string const & fileName, DictKey const & name);
- gdcmDict *GetDict(DictKey DictName);
+ gdcmDict *GetDict(DictKey const & DictName);
gdcmDict *GetDefaultPubDict();
gdcmDictEntry *NewVirtualDictEntry(uint16_t group, uint16_t element,
static std::string BuildDictPath();
protected:
- bool AppendDict(gdcmDict *NewDict,DictKey Name);
+ bool AppendDict(gdcmDict *NewDict, DictKey const & name);
private:
/// Hash table of all dictionaries contained in this gdcmDictSet
/// Directory path to dictionaries
std::string DictPath;
/// H table for the on the fly created gdcmDictEntries
- std::map<std::string,gdcmDictEntry *> virtualEntry;
+ std::map<std::string,gdcmDictEntry *> VirtualEntry;
};
//-----------------------------------------------------------------------------