]> Creatis software - gdcm.git/commitdiff
* gdcmPython/Makefile.am now avoids calling the wrappers for the
authorfrog <frog>
Tue, 1 Jul 2003 10:04:35 +0000 (10:04 +0000)
committerfrog <frog>
Tue, 1 Jul 2003 10:04:35 +0000 (10:04 +0000)
        clean target.
      * src/gdcm*.[cxx|h] :
        - to allow compilation with gcc 3.x
          -- clean up of STL usage (added explicit usage of std::)
          -- small fixes on exceptions.
          Note: linking not tested !
        - clean of doxygen comments to avoid warnings at documentation
          building stage.
      * vtk/vtkGdcmReader.cxx: g++ warning message clean up (platform
        dependent convertion).

13 files changed:
ChangeLog
gdcmPython/Makefile.am
src/gdcmDict.cxx
src/gdcmElValSet.cxx
src/gdcmException.h
src/gdcmFile.cxx
src/gdcmHeader.cxx
src/gdcmTS.cxx
src/gdcmTS.h
src/gdcmUtil.cxx
src/gdcmUtil.h
src/iddcmjpeg.h
vtk/vtkGdcmReader.cxx

index f80be7a15d285d6e37e2cb718d848fa6faa39155..f020c6d862a7341cac36685c9f68af58fb304c8c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2003-07-01  Eric Boix <Eric.Boix@creatis.insa-lyon.fr>
+      * gdcmPython/Makefile.am now avoids calling the wrappers for the
+        clean target.
+      * src/gdcm*.[cxx|h] :
+        - to allow compilation with gcc 3.x
+          -- clean up of STL usage (added explicit usage of std::)
+          -- small fixes on exceptions.
+          Note: linking not tested !
+        - clean of doxygen comments to avoid warnings at documentation
+          building stage.
+      * vtk/vtkGdcmReader.cxx: g++ warning message clean up (platform
+        dependent convertion).
+
 2003-06-20  Eric Boix <Eric.Boix@creatis.insa-lyon.fr>
       * Clean up of previous JPR garbage commit (not even commented in the
         Changelog):
index 326c9ef8eac36cef3b1c43ccadbaf63c48dad6dc..b2a47f35cdbe5568b64c7159fe8aabd4a9a342f4 100644 (file)
@@ -68,7 +68,7 @@ endif### BUILD_PYTHON #######################################
 ############ Automake general usage classics:
 MOSTLYCLEANFILES = $(pygdcm_la_SOURCES) $(vtkgdcmPython_la_SOURCES)
 BUILT_SOURCES =    $(pygdcm_la_SOURCES) $(vtkgdcmPython_la_SOURCES)
-CLEANFILES = gdcm_wrap.cxx gdcm.py gdcm.pyc vtkWrapPythonInit
+CLEANFILES = gdcm_wrap.cxx gdcm.py gdcm.pyc $(PYTHON_WRAPPER_INIT)
 
 dist-hook:
        rm -f $(distdir)/gdcm_wrap.cxx
index 0ac31dad235b477b46b125133ba213134d16ef69..acd88f8931c9cf2664dc7812b7f94139351ca10e 100644 (file)
@@ -43,10 +43,8 @@ gdcmDict::gdcmDict(std::string & FileName) {
 /**
  * \ingroup gdcmDict
  * \brief   
- * @param   
- * @return  
  */
- gdcmDict::~gdcmDict() {
+gdcmDict::~gdcmDict() {
    for (TagKeyHT::iterator tag = KeyHt.begin(); tag != KeyHt.end(); ++tag) {
       gdcmDictEntry* EntryToDelete = tag->second;
       if ( EntryToDelete )
@@ -62,8 +60,7 @@ gdcmDict::gdcmDict(std::string & FileName) {
 /**
  * \ingroup gdcmDict
  * \brief   
- * @param   
- * @return  
+ * @param   os
  */
 void gdcmDict::Print(std::ostream& os) {
    PrintByKey(os);
@@ -132,7 +129,7 @@ gdcmDictEntry * gdcmDict::GetTagByName(TagName name) {
 /**
  * \ingroup gdcmDict
  * \brief   
- * @param   
+ * @param   NewEntry
  * @return  
  */
 int gdcmDict::ReplaceEntry(gdcmDictEntry* NewEntry) {
@@ -146,7 +143,7 @@ int gdcmDict::ReplaceEntry(gdcmDictEntry* NewEntry) {
 /**
  * \ingroup gdcmDict
  * \brief   
- * @param   
+ * @param   NewEntry
  * @return  
  */
  int gdcmDict::AddNewEntry(gdcmDictEntry* NewEntry) {
@@ -165,7 +162,7 @@ int gdcmDict::ReplaceEntry(gdcmDictEntry* NewEntry) {
 /**
  * \ingroup gdcmDict
  * \brief   
- * @param   
+ * @param   key
  * @return  
  */
 int gdcmDict::RemoveEntry(TagKey key) {
@@ -184,7 +181,8 @@ int gdcmDict::RemoveEntry(TagKey key) {
 /**
  * \ingroup gdcmDict
  * \brief   
- * @param   
+ * @param   group 
+ * @param   element
  * @return  
  */
 int gdcmDict::RemoveEntry (guint16 group, guint16 element) {
index db65110c41e5fc6839227524b0794e84d7248394..1d6e42b3b74c28c4ede672797872a49e58050466 100644 (file)
@@ -26,7 +26,7 @@ TagElValueHT & gdcmElValSet::GetTagHt(void) {
 /**
  * \ingroup gdcmElValSet
  * \brief   
- * @param     
+ * @param   newElValue
  * @return  
  */
 void gdcmElValSet::Add(gdcmElValue * newElValue) {
@@ -39,7 +39,8 @@ void gdcmElValSet::Add(gdcmElValue * newElValue) {
  * \ingroup gdcmElValSet
  * \brief   Checks if a given Dicom element exists
  * \        within a ElValSet
- * @param     
+ * @param   Group
+ * @param   Elem
  * @return  
  */
 int gdcmElValSet::CheckIfExistByNumber(guint16 Group, guint16 Elem ) {
@@ -50,10 +51,8 @@ int gdcmElValSet::CheckIfExistByNumber(guint16 Group, guint16 Elem ) {
 /**
  * \ingroup gdcmElValSet
  * \brief   
- * @param     
- * @return  
  */
- void gdcmElValSet::Print(ostream & os) {
+void gdcmElValSet::Print(ostream & os) {
 
    size_t o;
    short int g, e;
@@ -94,10 +93,8 @@ int gdcmElValSet::CheckIfExistByNumber(guint16 Group, guint16 Elem ) {
 /**
  * \ingroup gdcmElValSet
  * \brief   
- * @param     
- * @return  
  */
- void gdcmElValSet::PrintByName(ostream & os) {
+void gdcmElValSet::PrintByName(ostream & os) {
    for (TagElValueNameHT::iterator tag = NameHt.begin();
           tag != NameHt.end();
           ++tag){
@@ -111,7 +108,8 @@ int gdcmElValSet::CheckIfExistByNumber(guint16 Group, guint16 Elem ) {
 /**
  * \ingroup gdcmElValSet
  * \brief   
- * @param     
+ * @param   group 
+ * @param   element 
  * @return  
  */
 gdcmElValue* gdcmElValSet::GetElementByNumber(guint16 group, guint16 element) {
@@ -124,7 +122,6 @@ gdcmElValue* gdcmElValSet::GetElementByNumber(guint16 group, guint16 element) {
 /**
  * \ingroup gdcmElValSet
  * \brief   
- * @param     
  * @return  
  */
 gdcmElValue* gdcmElValSet::GetElementByName(string TagName) {
@@ -136,7 +133,8 @@ gdcmElValue* gdcmElValSet::GetElementByName(string TagName) {
 /**
  * \ingroup gdcmElValSet
  * \brief   
- * @param     
+ * @param   group 
+ * @param   element 
  * @return  
  */
 string gdcmElValSet::GetElValueByNumber(guint16 group, guint16 element) {
@@ -149,7 +147,6 @@ string gdcmElValSet::GetElValueByNumber(guint16 group, guint16 element) {
 /**
  * \ingroup gdcmElValSet
  * \brief   
- * @param     
  * @return  
  */
 string gdcmElValSet::GetElValueByName(string TagName) {
@@ -161,7 +158,9 @@ string gdcmElValSet::GetElValueByName(string TagName) {
 /**
  * \ingroup gdcmElValSet
  * \brief   
- * @param     
+ * @param   content
+ * @param   group 
+ * @param   element 
  * @return  
  */
 int gdcmElValSet::SetElValueByNumber(string content,
@@ -186,7 +185,8 @@ int gdcmElValSet::SetElValueByNumber(string content,
 /**
  * \ingroup gdcmElValSet
  * \brief   
- * @param     
+ * @param   content
+ * @param   TagName
  * @return  
  */
 int gdcmElValSet::SetElValueByName(string content, string TagName) {
@@ -230,7 +230,9 @@ guint32 gdcmElValSet::GenerateFreeTagKeyInGroup(guint16 group) {
 /**
  * \ingroup gdcmElValSet
  * \brief   
- * @param     
+ * @param   length
+ * @param   group 
+ * @param   element 
  * @return  
  */
 int gdcmElValSet::SetElValueLengthByNumber(guint32 length,
@@ -246,7 +248,8 @@ int gdcmElValSet::SetElValueLengthByNumber(guint32 length,
 /**
  * \ingroup gdcmElValSet
  * \brief   
- * @param     
+ * @param   length
+ * @param   TagName
  * @return  
  */
 int gdcmElValSet::SetElValueLengthByName(guint32 length, string TagName) {
@@ -256,15 +259,11 @@ int gdcmElValSet::SetElValueLengthByName(guint32 length, string TagName) {
    return 1 ;          
 }
 
-
-// re-computes the length of a ACR-NEMA/Dicom group
-// from a DcmHeader
-
 /**
  * \ingroup gdcmElValSet
- * \brief   
- * @param     
- * @return  
+ * \brief   Re-computes the length of a ACR-NEMA/Dicom group from a DcmHeader
+ * @param   SkipSequence
+ * @param   type
  */
 void gdcmElValSet::UpdateGroupLength(bool SkipSequence, FileType type) {
    guint16 gr, el;
@@ -358,7 +357,8 @@ void gdcmElValSet::UpdateGroupLength(bool SkipSequence, FileType type) {
 /**
  * \ingroup gdcmElValSet
  * \brief   
- * @param     
+ * @param   type
+ * @param   _fp
  * @return  
  */
 void gdcmElValSet::WriteElements(FileType type, FILE * _fp) {
@@ -443,7 +443,8 @@ void gdcmElValSet::WriteElements(FileType type, FILE * _fp) {
 /**
  * \ingroup gdcmElValSet
  * \brief   
- * @param     
+ * @param   _fp
+ * @param   type
  * @return  
  */
 int gdcmElValSet::Write(FILE * _fp, FileType type) {
index 73710ae0528848b72310deca78366c5accfaea61..03d74fb996c98465bf357d8a275d0a1f32992ac1 100644 (file)
@@ -1,17 +1,3 @@
-// gdcmExeption.h
-
-// gdcmlib Intro:  
-// * gdcmlib is a library dedicated to reading and writing dicom files.
-// * LGPL for the license
-// * lightweigth as opposed to CTN or DCMTK which come bundled which try
-//   to implement the full DICOM standard (networking...). gdcmlib concentrates
-//   on reading and writing
-// * Formats: this lib should be able to read ACR-NEMA v1 and v2, Dicom v3 (as
-//   stated in part10). [cf dcmtk/dcmdata/docs/datadict.txt]
-// * Targeted plateforms: Un*xes and Win32/VC++6.0
-//
-//
-
 #ifndef GDCM_EXCEPTION_H
 #define GDCM_EXCEPTION_H
 
@@ -23,7 +9,7 @@
 /**
  * Any exception thrown in the gdcm library
  */
-class GDCM_EXPORT gdcmException : public exception {
+class GDCM_EXPORT gdcmException : public std::exception {
  protected:
   /// error message
   std::string from;
@@ -45,7 +31,7 @@ class GDCM_EXPORT gdcmException : public exception {
   /**
    * virtual destructor makes this class dynamic
    */
-  virtual ~gdcmException() {
+  virtual ~gdcmException() throw() {
   }
   
   /// returns error message
index 1e2ca15585eae6ed026900a1351815b6d753708d..b47418923c9edb0a8c2d5f781172085faff5477e 100644 (file)
@@ -183,7 +183,7 @@ bool gdcmFile::ReadPixelData(void* destination) {
             // la ligne commentee ci-dessous fait passer l'exec de 0.15 sec a 5.5 sec
             // pour la meme image 512*512 ...
             // optimiseur pas mis en oeuvre (?)
-            //for (int i=0; i<GetXSize() *  GetYSize() *  GetZSize(); i++) 
+            //for (int i=0; i<GetXSize() *  GetYSize() *  GetZSize(); i++) 
             
              for (int i=0; i<taille; i++) {           
                *((unsigned short *)dest+i) = *(dataJpg +i);    
@@ -550,17 +550,17 @@ int gdcmFile::WriteAcr (string nomFichier) {
 /**
  * \ingroup   gdcmFile
  *
- * @param  nomFichier TODO JPR
+ * @param  FileName TODO JPR
  * @param  type TODO JPR
  *
  * @return TODO JPR
  */
-int gdcmFile::WriteBase (string nomFichier, FileType type) {
+int gdcmFile::WriteBase (string FileName, FileType type) {
 
    FILE * fp1;
-   fp1 = fopen(nomFichier.c_str(),"wb");
+   fp1 = fopen(FileName.c_str(),"wb");
    if (fp1 == NULL) {
-      printf("Echec ouverture (ecriture) Fichier [%s] \n",nomFichier.c_str());
+      printf("Echec ouverture (ecriture) Fichier [%s] \n",FileName.c_str());
       return (0);
    }
 
index f94d9dc1b625eca7dfe56321d1cd04ef018e42c0..c03e3419df4b815d2302646f4ed56f5673c29c70 100644 (file)
@@ -1,4 +1,4 @@
-// $Header: /cvs/public/gdcm/src/Attic/gdcmHeader.cxx,v 1.72 2003/07/01 09:29:56 jpr Exp $
+// $Header: /cvs/public/gdcm/src/Attic/gdcmHeader.cxx,v 1.73 2003/07/01 10:04:36 frog Exp $
 
 #include <stdio.h>
 #include <cerrno>
@@ -26,10 +26,8 @@ using namespace std;
 /**
  * \ingroup gdcmHeader
  * \brief   
- * @param  none   
- * @return  
  */
- void gdcmHeader::Initialise(void) {
+void gdcmHeader::Initialise(void) {
    dicom_vr = gdcmGlobal::GetVR();
    dicom_ts = gdcmGlobal::GetTS();
    Dicts =    gdcmGlobal::GetDicts();
@@ -40,8 +38,8 @@ using namespace std;
 /**
  * \ingroup gdcmHeader
  * \brief   
- * @param     
- * @return  
+ * @param   InFilename
+ * @param   exception_on_error
  */
  gdcmHeader::gdcmHeader(const char *InFilename, bool exception_on_error) {
   SetMaxSizeLoadElementValue(_MaxSizeLoadElementValue_);
@@ -57,10 +55,9 @@ using namespace std;
 /**
  * \ingroup gdcmHeader
  * \brief   
- * @param     
- * @return  
+ * @param   exception_on_error
  */
- gdcmHeader::gdcmHeader(bool exception_on_error) {
+gdcmHeader::gdcmHeader(bool exception_on_error) {
   SetMaxSizeLoadElementValue(_MaxSizeLoadElementValue_);
   Initialise();
 }
@@ -68,7 +65,7 @@ using namespace std;
 /**
  * \ingroup gdcmHeader
  * \brief   
- * @param     
+ * @param   exception_on_error
  * @return  
  */
  bool gdcmHeader::OpenFile(bool exception_on_error)
@@ -87,10 +84,9 @@ using namespace std;
 /**
  * \ingroup gdcmHeader
  * \brief   
- * @param     
  * @return  
  */
- bool gdcmHeader::CloseFile(void) {
+bool gdcmHeader::CloseFile(void) {
   int closed = fclose(fp);
   fp = (FILE *)0;
   if (! closed)
@@ -100,11 +96,9 @@ using namespace std;
 
 /**
  * \ingroup gdcmHeader
- * \brief   
- * @param     
- * @return  
+ * \brief   Canonical destructor.
  */
- gdcmHeader::~gdcmHeader (void) {
+gdcmHeader::~gdcmHeader (void) {
    dicom_vr =   (gdcmVR*)0; 
    Dicts    =   (gdcmDictSet*)0;
    RefPubDict = (gdcmDict*)0;
@@ -281,10 +275,8 @@ void gdcmHeader::CheckSwap()
 /**
  * \ingroup gdcmHeader
  * \brief   
- * @param     
- * @return  
  */
- void gdcmHeader::SwitchSwapToBigEndian(void) {
+void gdcmHeader::SwitchSwapToBigEndian(void) {
    dbg.Verbose(1, "gdcmHeader::SwitchSwapToBigEndian",
                   "Switching to BigEndian mode.");
    if ( sw == 0    ) {
@@ -1541,10 +1533,10 @@ int gdcmHeader::SetShaElValByNumber(string content,
  * \brief   Accesses an existing gdcmElValue in the ShaElValSet of this instance
  *          through tag name and modifies it's content with the given value.
  * @param   content new value to substitute with
- * @param   TagName name of the tag to be modified
+ * @param   ShadowTagName name of the tag to be modified
  */
-int gdcmHeader::SetShaElValByName(string content, string TagName) {
-   return (  ShaElValSet.SetElValueByName (content, TagName) );
+int gdcmHeader::SetShaElValByName(string content, string ShadowTagName) {
+   return (  ShaElValSet.SetElValueByName (content, ShadowTagName) );
 }
 
 /**
@@ -1958,7 +1950,6 @@ float gdcmHeader::GetYImagePosition(void) {
    if( sscanf( StrImPos.c_str(), "%f\\%f\\%f", &xImPos, &yImPos, &zImPos) != 3)
      // How to tell the caller a wrong number of values was found?
      return 0.;
-    //else
    return yImPos;
 }
 
index ebcd65a6d557acda3799073a629f4a6fcdfa4577..7f5043856bc86ec21b918462549ad165bb5cd153 100644 (file)
@@ -38,6 +38,6 @@ int gdcmTS::Count(TSKey key) {
    return ts.count(key);
 }
 
-string gdcmTS::GetValue(TSKey key) {
+std::string gdcmTS::GetValue(TSKey key) {
    return ts[key];
 }
index 0aa14c3d43a5479c78856ef28b14893e344dedd3..14d4909cc12a38557868a2975f960b457eb92bc9 100644 (file)
@@ -21,7 +21,7 @@ public:
    gdcmTS(void);
    ~gdcmTS();
    int Count(TSKey key);
-   string GetValue(TSKey key);
+   std::string GetValue(TSKey key);
 };
 
 #endif
index f8d5144f36f22015767a223902e5329cd81fa625..82b0e570db4aa6343f90ab9ca1d899cfb5dba58c 100644 (file)
@@ -1,4 +1,4 @@
-// $Header: /cvs/public/gdcm/src/gdcmUtil.cxx,v 1.13 2003/06/26 13:07:01 jpr Exp $
+// $Header: /cvs/public/gdcm/src/gdcmUtil.cxx,v 1.14 2003/07/01 10:04:36 frog Exp $
 
 #include <stdio.h>
 #include <ctype.h>   // For isspace
@@ -16,23 +16,15 @@ gdcmDebug::gdcmDebug(int level) {
 void gdcmDebug::Verbose(int Level, const char * Msg1, const char * Msg2) {
    if (Level > DebugLevel)
       return ;
-   cerr << Msg1 << ' ' << Msg2 << '\n';
-}
-
-/*
-void gdcmDebug::Verbose(int Level, char * Msg1, char * Msg2) {
-   if (Level > DebugLevel)
-      return ;
-   cerr << Msg1 << ' ' << Msg2 << '\n';
+   std::cerr << Msg1 << ' ' << Msg2 << '\n';
 }
-*/
 
 void gdcmDebug::Assert(int Level, bool Test,
                  const char * Msg1, const char * Msg2) {
    if (Level > DebugLevel)
       return ;
    if (!Test)
-      cerr << Msg1 << ' ' << Msg2 << '\n';
+      std::cerr << Msg1 << ' ' << Msg2 << '\n';
 }
 
 void gdcmDebug::Error( bool Test, const char * Msg1, const char * Msg2) {
index d50b1e416c09fb8ace7328325210031aa102a94a..ea5eb165654ce61f01c8fd38020a7010276c545e 100644 (file)
@@ -1,4 +1,4 @@
-// $Header: /cvs/public/gdcm/src/gdcmUtil.h,v 1.12 2003/06/26 13:07:01 jpr Exp $
+// $Header: /cvs/public/gdcm/src/gdcmUtil.h,v 1.13 2003/07/01 10:04:36 frog Exp $
 
 #ifndef GDCMUTIL_H
 #define GDCMUTIL_H
@@ -46,7 +46,7 @@ void Tokenize (const std::string& str,
 extern gdcmDebug dbg;
 
 char * _cleanString(char *v);
-char * _CreateCleanString(string s);
+char * _CreateCleanString(std::string s);
 
 std::string TranslateToKey(guint16 group, guint16 element);
 
index 7844354c212f953b31451cd112f2341ecf688c6b..d41cacfbfc5d3f8df9bf33eec297803f8909f7ac 100644 (file)
@@ -1,5 +1,5 @@
-#include <stdio.h>
-#include <string.h>
+#include <stdio.h>  // for FILE
+#include <string>
 
 #define BOOL int
 
index 0b54a4cd0dcdd1f2e00f68a2c8676ebb2505a388..a3e871f78974451c97d875e16343df3b48e80d65 100644 (file)
@@ -1,5 +1,4 @@
-// $Header: /cvs/public/gdcm/vtk/vtkGdcmReader.cxx,v 1.12 2003/06/17 08:07:23 regrain Exp $
-//CLEANME#include <vtkByteSwap.h>
+// $Header: /cvs/public/gdcm/vtk/vtkGdcmReader.cxx,v 1.13 2003/07/01 10:04:37 frog Exp $
 #include <stdio.h>
 #include <vtkObjectFactory.h>
 #include <vtkImageData.h>
@@ -411,9 +410,9 @@ void vtkGdcmReader::ExecuteData(vtkDataObject *output)
 
   // Variables for the UpdateProgress. We shall use 50 steps to signify
   // the advance of the process:
-  unsigned long UpdateProgressTarget = (unsigned long) this->NumLines
+  unsigned long UpdateProgressTarget = (unsigned long) ceil (this->NumLines
                                      * this->TotalNumberOfPlanes
-                                     / 50.0;
+                                     / 50.0);
   // The actual advance measure:
   unsigned long UpdateProgressCount = 0;