]> Creatis software - gdcm.git/commitdiff
ENH: Guess what ! Still some cosmetic cleanup
authormalaterre <malaterre>
Sun, 1 Aug 2004 02:39:09 +0000 (02:39 +0000)
committermalaterre <malaterre>
Sun, 1 Aug 2004 02:39:09 +0000 (02:39 +0000)
17 files changed:
src/gdcmDebug.cxx
src/gdcmDebug.h
src/gdcmDicomDir.cxx
src/gdcmDicomDirElement.cxx
src/gdcmDicomDirElement.h
src/gdcmDicomDirImage.cxx
src/gdcmDicomDirImage.h
src/gdcmDicomDirMeta.cxx
src/gdcmDicomDirMeta.h
src/gdcmDicomDirPatient.cxx
src/gdcmDicomDirPatient.h
src/gdcmDicomDirSerie.h
src/gdcmDicomDirStudy.cxx
src/gdcmDicomDirStudy.h
src/gdcmDict.cxx
src/gdcmDictSet.cxx
src/gdcmDictSet.h

index e98811056dff0e3cb44d17f1d82be1df2c6ca7eb..fcd16cffdab1aa753c3a43e3184dcd79dd109c9e 100644 (file)
@@ -3,8 +3,8 @@
   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
@@ -47,11 +47,13 @@ void gdcmDebug::SetDebug(int level)
  * @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;
 }
 
 /**
@@ -60,11 +62,13 @@ void gdcmDebug::Verbose(int Level, const char * Msg1, const char * Msg2)
  * @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);
 }
 
@@ -74,10 +78,10 @@ void gdcmDebug::Error( bool Test, const char * Msg1, const char * Msg2)
  * @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);
 }
 
@@ -88,13 +92,17 @@ void gdcmDebug::Error(const char* Msg1, const char* Msg2,
  * @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;
+   }
 }
 
 /**
index a689936f29dbd1432b491ac4cf8a03efd22d7921..ae3e013fd0e396714635b4b1ac3c2b16cc144aff 100644 (file)
@@ -3,8 +3,8 @@
   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();
 
index 3dcefe86d7306119f0f2c412a0d4a08686619526..e0dd8a54767a3e15029252b9eec362cfb0515c14 100644 (file)
@@ -3,8 +3,8 @@
   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
@@ -218,7 +218,7 @@ void gdcmDicomDir::Initialize()
    progress = 0.0;
    abort = false;
 
-   metaElems = (gdcmDicomDirMeta *)0;   
+   metaElems = 0;   
 }
 
 
@@ -345,9 +345,7 @@ void gdcmDicomDir::SetEndMethodArgDelete(gdcmMethod *method)
  
 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());
index e7a1fdb14078dbe4a7bb188163191ea5e01c3c5c..22530e7d80dce3cc6480309a04efdba0ffdfa225 100644 (file)
@@ -3,8 +3,8 @@
   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
@@ -33,8 +33,9 @@
  * \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());
 
@@ -42,7 +43,8 @@ gdcmDicomDirElement::gdcmDicomDirElement() {
    std::string type;
    gdcmElement elem;
 
-   while (!from.eof()) {
+   while (!from.eof())
+   {
       eatwhite(from);
       from.getline(buff, 1024, ' ');
       type = buff;
@@ -59,16 +61,26 @@ gdcmDicomDirElement::gdcmDicomDirElement() {
          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');
    }
@@ -79,7 +91,8 @@ gdcmDicomDirElement::gdcmDicomDirElement() {
  * \ingroup gdcmDicomDirElement
  * \brief   canonical destructor 
  */
-gdcmDicomDirElement::~gdcmDicomDirElement() {
+gdcmDicomDirElement::~gdcmDicomDirElement()
+{
    DicomDirMetaList.clear();
    DicomDirPatientList.clear();
    DicomDirStudyList.clear();
@@ -95,41 +108,42 @@ gdcmDicomDirElement::~gdcmDicomDirElement() {
  * \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;
index 578dfa77783cc89864dd6680d7a24347d275123e..85a83b2b41d07439b49b44d474598a22489abb9f 100644 (file)
@@ -3,8 +3,8 @@
   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
@@ -49,8 +49,8 @@ typedef std::list<gdcmElement> ListDicomDirImageElem;
 class GDCM_EXPORT gdcmDicomDirElement
 {
 public:
-   gdcmDicomDirElement(void);
-   ~gdcmDicomDirElement(void);
+   gdcmDicomDirElement();
+   ~gdcmDicomDirElement();
 
   /**
     * \brief   canonical Printer 
@@ -62,36 +62,36 @@ public:
  * \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
index 445bbb974ddd23e254c3155363a6d6a6e3dc012b..7d2c5668f48872f372df53459ee803d8c0d92afa 100644 (file)
@@ -3,8 +3,8 @@
   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
@@ -55,13 +55,15 @@ gdcmDicomDirImage::~gdcmDicomDirImage()
  */ 
 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);
 }
index 82a0ced001404ef95ae73ccae7bba08ddf43c4ac..8365f40069f413a5160e5faf952fea5adef980b3 100644 (file)
@@ -3,8 +3,8 @@
   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);      
 };
index 2cec741b7163f9845d4600572a6d8acc2026c961..59d411283d0f20ded7ec5d560f78edc2f780c0ae 100644 (file)
@@ -3,8 +3,8 @@
   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
@@ -50,7 +50,7 @@ gdcmDicomDirMeta::~gdcmDicomDirMeta()
  */ 
 void gdcmDicomDirMeta::Print(std::ostream &os)
 {
-   os<<"META"<<std::endl;
+   os << "META" << std::endl;
    gdcmObject::Print(os);
 }
 
index 1f9b3a40de8c40aab065e99a5c36489caccf2384..fe3de1232c941292ff5c5057f329c62bca3c010b 100644 (file)
@@ -3,8 +3,8 @@
   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
@@ -27,7 +27,7 @@ class GDCM_EXPORT gdcmDicomDirMeta : public gdcmObject
 public:
    gdcmDicomDirMeta(TagDocEntryHT *ptagHT); 
 
-   ~gdcmDicomDirMeta(void);
+   ~gdcmDicomDirMeta();
 
    virtual void Print(std::ostream &os = std::cout);
 };
index 85fa49b5d28176ea8db1009b904584d8cc5921f2..3cc33bc7e98ddddfc8203582c7258948952e878c 100644 (file)
@@ -3,8 +3,8 @@
   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
@@ -50,7 +50,8 @@ gdcmDicomDirPatient::gdcmDicomDirPatient(TagDocEntryHT *ptagHT):
  */
 gdcmDicomDirPatient::~gdcmDicomDirPatient() 
 {
-   for(ListDicomDirStudy::iterator cc = studies.begin();cc != studies.end();++cc)
+   for(ListDicomDirStudy::iterator cc = studies.begin();
+                                   cc != studies.end(); ++cc)
    {
       delete *cc;
    }
index ad11f96fa028ea1c72e68e9ac006bfd615717485..f4cc06e8837e380e1ff1db4c839f998d274278bc 100644 (file)
@@ -3,8 +3,8 @@
   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
@@ -32,7 +32,7 @@ public:
    gdcmDicomDirPatient(gdcmSQItem *s, TagDocEntryHT *ptagHT); 
    gdcmDicomDirPatient(TagDocEntryHT *ptagHT); 
 
-   ~gdcmDicomDirPatient(void);
+   ~gdcmDicomDirPatient();
 
    virtual void Print(std::ostream &os = std::cout);
 
@@ -43,7 +43,7 @@ public:
    void AddDicomDirStudy(gdcmDicomDirStudy *obj) { studies.push_back(obj); };
 
    ///  TODO
-   gdcmDicomDirStudy* NewStudy(void); 
+   gdcmDicomDirStudy* NewStudy(); 
          
 private:
 
index acde92f460f9351a2796dfff1bc2d6ff8d05566b..6305de8691ed12de74828b48bdde8c9384f02afc 100644 (file)
@@ -3,8 +3,8 @@
   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
@@ -31,27 +31,26 @@ class GDCM_EXPORT gdcmDicomDirSerie : public gdcmObject
 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:
 /**
index ca551f164b9b6a5b59b8837d6e6b43c261ce059d..d1a66ff9f130be4cd616447c5a47428dd6ff7a38 100644 (file)
@@ -3,8 +3,8 @@
   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
@@ -65,7 +65,7 @@ gdcmDicomDirStudy::~gdcmDicomDirStudy()
  */ 
 void gdcmDicomDirStudy::Print(std::ostream &os)
 {
-   os<<"STUDY"<<std::endl;
+   os << "STUDY" << std::endl;
    gdcmObject::Print(os);
 
    for(ListDicomDirSerie::iterator cc = series.begin();
index 0dbd781fa1bd6ce9243f0b0078849a636809d057..bf57e91d052966c1fc604377b26f3c9344317fc0 100644 (file)
@@ -3,8 +3,8 @@
   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:
 /**
index 2f79254f57322403a7daba64a62177090bbd7f1b..50e775ea17835a0e26c7577adb4f7fa5e5473cb4 100644 (file)
@@ -3,8 +3,8 @@
   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
@@ -148,9 +148,9 @@ void gdcmDict::PrintByName(std::ostream& os)
  * @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)
    {
@@ -159,8 +159,8 @@ bool gdcmDict::AddNewEntry(gdcmDictEntry *NewEntry)
    } 
    else 
    {
-      KeyHt[NewEntry->GetKey()] = NewEntry;
-      NameHt[NewEntry->GetName()] = NewEntry;
+      KeyHt[newEntry->GetKey()] = newEntry;
+      NameHt[newEntry->GetName()] = newEntry;
       return true;
    }
 }
@@ -171,12 +171,12 @@ bool gdcmDict::AddNewEntry(gdcmDictEntry *NewEntry)
  * @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;
@@ -193,12 +193,12 @@ bool gdcmDict::RemoveEntry(gdcmTagKey key)
 {
    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);
@@ -220,7 +220,7 @@ bool gdcmDict::RemoveEntry(gdcmTagKey key)
  */
 bool gdcmDict::RemoveEntry (uint16_t group, uint16_t element)
 {
-   return( RemoveEntry(gdcmDictEntry::TranslateToKey(group, element)) );
+   return RemoveEntry(gdcmDictEntry::TranslateToKey(group, element));
 }
 
 /**
index 6d8e10b01b63bf971be906e66e5de46adc39e7f9..d6a2fb7f4ca03158e8215045337ee51c9d4e2408 100644 (file)
@@ -3,8 +3,8 @@
   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
@@ -31,9 +31,9 @@
 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);
 }
 
 /**
@@ -45,21 +45,25 @@ gdcmDictSet::~gdcmDictSet()
    // 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;
    }
 }
 
@@ -89,9 +93,9 @@ void gdcmDictSet::Print(std::ostream& os)
  * \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();
 }
 
 /** 
@@ -120,9 +124,10 @@ std::list<std::string> *gdcmDictSet::GetPubDictEntryNames(void)
  *          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();
 }
 
 /**
@@ -134,11 +139,13 @@ std::map<std::string, std::list<std::string> > *gdcmDictSet::GetPubDictEntryName
  * @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;
 }
 
 /**
@@ -148,11 +155,13 @@ gdcmDict *gdcmDictSet::LoadDictFromFile(std::string FileName, DictKey Name)
  * @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;
 }
 
@@ -177,21 +186,22 @@ gdcmDictEntry *gdcmDictSet::NewVirtualDictEntry(uint16_t group,
                                                 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;
 }
 
 /**
@@ -201,30 +211,37 @@ gdcmDictEntry *gdcmDictSet::NewVirtualDictEntry(uint16_t group,
  *          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
 }
 
 //-----------------------------------------------------------------------------
index 960296d6ac9ca0ee34ca8bb50cbef3e0149f1ff6..d6f5b4c9d06a5ad74b5a1987004c61853a2a9b54 100644 (file)
@@ -3,8 +3,8 @@
   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
@@ -54,9 +54,9 @@ public:
    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,
@@ -67,7 +67,7 @@ public:
    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
@@ -75,7 +75,7 @@ private:
    /// 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;
 };
 
 //-----------------------------------------------------------------------------