]> Creatis software - gdcm.git/commitdiff
* src/gdcmDicomDir.cxx, gdcmDocEntrySet.cxx: removed inclusion of errno.h
authorfrog <frog>
Fri, 30 Jul 2004 11:40:12 +0000 (11:40 +0000)
committerfrog <frog>
Fri, 30 Jul 2004 11:40:12 +0000 (11:40 +0000)
  * src/gdcmDocument.[h|cxx], gdcmFile.[h|cxx], gdcmHeader.[h|cxx]:
    enable_sequences removed from gdcmHeader constructor and dependencies.
  * Example/PrintHeader.cxx: fixed accordingly (enable_sequences removal).
  * gdcmPython/demo/PrintHeader.py: dummy fix.

12 files changed:
ChangeLog
Example/PrintHeader.cxx
TODO
gdcmPython/demo/PrintHeader.py
src/gdcmDicomDir.cxx
src/gdcmDocEntrySet.cxx
src/gdcmDocument.cxx
src/gdcmDocument.h
src/gdcmFile.cxx
src/gdcmFile.h
src/gdcmHeader.cxx
src/gdcmHeader.h

index fcadcbf2d0af0c2c840e2f4b2ba3a02d61083b5c..3f67163a3cce81db6f3d34223fa10aaca8e2a991 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,11 @@
-2004-07-27 Jean-Pierre Roux
+2004-07-06 Eric Boix <Eric.Boix@creatis.insa-lyon.fr>
+  * src/gdcmDicomDir.cxx, gdcmDocEntrySet.cxx: removed inclusion of errno.h
+  * src/gdcmDocument.[h|cxx], gdcmFile.[h|cxx], gdcmHeader.[h|cxx]:
+    enable_sequences removed from gdcmHeader constructor and dependencies.
+  * Example/PrintHeader.cxx: fixed accordingly (enable_sequences removal).
+  * gdcmPython/demo/PrintHeader.py: dummy fix.
+
+2004-07-27 Eric Boix <Eric.Boix@creatis.insa-lyon.fr>
   * Test/CMakeLists.txt: newly re-introduced SIEMENS_Sonata-12-MONO2-SQ.dcm
     in gdcmData (previously known as E00001S03I0015.dcm) is blacklisted.
 
index 49cd54e7ba7937ed4738189eebebbda60ce38161..c8ec5d6ca433e5eefe57971bc2a9eeb7159fc5f5 100644 (file)
@@ -4,14 +4,12 @@
 int main(int argc, char* argv[])
 { 
    bool dropPriv = false;
-   bool showSeq  = true; 
    std::string fileName;   
 
    if (argc == 1) {
       std::cout << argv[0] <<
       " fileName" << std::endl <<
-      "    [nopriv]  if you don't want to print Shadow groups"  << std::endl <<
-      "    [noseq]   if you don't want to 'go inside' the SQ's" << std::endl;
+      "    [nopriv]  if you don't want to print Shadow groups"  << std::endl;
    }
 
    if (argc > 1) {
@@ -24,11 +22,9 @@ int main(int argc, char* argv[])
    for (int j=0;j<argc;j++) {
       if (strcmp(argv[j],"nopriv")==0)
          dropPriv=true;
-      else if (strcmp(argv[j],"noseq")==0)
-         showSeq=false;
    }
    
-   gdcmFile *e2 = new gdcmFile(fileName.c_str(),false, showSeq, dropPriv);
+   gdcmFile *e2 = new gdcmFile(fileName.c_str(),false, dropPriv);
    gdcmHeader *e1 = e2->GetHeader();  
         
    if (argc > 2) {
diff --git a/TODO b/TODO
index 82bba741364f276ee76834a7e8dcd81b96cdb0eb..31b1fe9881afc3a2e7302f258bc653da894a0d40 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,7 +1,36 @@
-* Convert the C-like IO to C++ IO (i.e. remove FILE*, fread...). Some docs
-  are available at
-    http://www.angelfire.com/country/aldev0/cpphowto/cpp_BinaryFileIO.html
-* Remove enable_sequences and ignore_shadow from gdcmDocument().
+-----------------------------------------------------------------------------
+Use namespace gdcm:
+  Problem: using enum with name like 'Unknow' on .Net, or LP on cygwin 
+           causes problems.
+  Question: when introducing the namespace, should we remove the gdcm
+            prefix from classes or keep it ?
+-----------------------------------------------------------------------------
+Convert the C-like IO to C++ IO:
+  Goal: remove all the C-oriented IO references like FILE*, fread...
+        with the C++ fstream notation. Provide overload of operators
+        << and >> for any gdcm class using file IO.
+  Question: the underlying jpeg libraries (written in C) use the FILE*
+        notation. Is there a way to still use fstream in gdcm, and 
+        build or pass the proper FILE* to jpeg libs ?
+  References:
+        binary IO are available at
+        http://www.angelfire.com/country/aldev0/cpphowto/cpp_BinaryFileIO.html
+-----------------------------------------------------------------------------
+Switch from errno C-style to exceptions:
+  Goal: remove all the C-oriented errno (#include <errno.h>) and switch
+        to C++ exceptions.
+  Note: - only src/gdcmDocument.cxx includes errno.h
+        - when exceptions were first introduced within gdcm, it caused 
+        gdcmPython to be uncompatible within the corresponding version
+        of wxPython (refer to the first lines of
+        Test/ExceptionAndPython/README). Hence we reverted to the old
+        errno mecanisme. Since wxPython seems not to be problem anymore
+        (check it with Test/ExceptionAndPython) we can now move back to C++
+        exceptions.
+-----------------------------------------------------------------------------
+CLEANUP:
+ - Remove ignore_shadow from gdcmDocument().
+-----------------------------------------------------------------------------
 * vtk/vtkGdcmHeader.cxx: if speed becomes a concern some changes can
   be made at the cost of memory consumption (refer to header of 
   vtk/vtkGdcmHeader.cxx)
@@ -20,9 +49,6 @@
   proceed correctly (in fact problems appears at loading of _gdcm.[so/dll]).
   So, simply uncomment the declaration once you provided the definition of
   the method...
-* As stated by the first lines of Test/ExceptionAndPython/README, it looks
-  like we can move back to the exceptions and remove the errno stuff from
-  src/gdcm* !
 * Fix the bug in Test/bug1.cxx (see first comment line): Win32 only.
 * All (or at least many of) the methods of gdcmHeader whose only arguments
   are an ElValue* (e.g.  FindLength, FindVR, LoadElementValue...) can
@@ -68,5 +94,3 @@
       a.write(output);
    }
 
-* use namespace for gdcm, to avoid problem when using enum with name like
-  'Unknow' on .Net, and LP on cygwin that cause problems
index 52a1ae587732cf797ec0db11526389ed17547698..65698538eff1ad68df5c3e75f740ddfafb411e2b 100644 (file)
@@ -1,5 +1,6 @@
 from gdcmPython import *
 import sys
+import os
 
 ### Get filename from command line or default it
 try:
index f3dc73156f2f5185462ac7620ea50508debabf0c..b80d6bac08e6096ff0ddc006819d1308656b0bfa 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/07/27 15:04:10 $
-  Version:   $Revision: 1.59 $
+  Date:      $Date: 2004/07/30 11:40:13 $
+  Version:   $Revision: 1.60 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -19,7 +19,6 @@
 #include <string>
 #include <algorithm>
 #include <sys/types.h>
-#include <errno.h>
 
 #ifdef _MSC_VER 
    #include <direct.h>
index ad85c126b587ea5891a97d487b51fb42f1f6d63f..f2ba890326188a95ca50526b68cb345d4d8bb8ef 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocEntrySet.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/07/02 13:55:27 $
-  Version:   $Revision: 1.13 $
+  Date:      $Date: 2004/07/30 11:40:13 $
+  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
@@ -16,7 +16,6 @@
                                                                                 
 =========================================================================*/
 
-#include <errno.h>
 #include "gdcmDebug.h"
 #include "gdcmCommon.h"
 #include "gdcmGlobal.h"
index 53b39e752917d3fcaa7e893166d28674bdc940a8..4a204595b79f98e71e134101f568d3a22a66ac89 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/07/28 21:13:03 $
-  Version:   $Revision: 1.58 $
+  Date:      $Date: 2004/07/30 11:40:13 $
+  Version:   $Revision: 1.59 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -84,26 +84,15 @@ const unsigned int gdcmDocument::MAX_SIZE_PRINT_ELEMENT_VALUE = 0x7fffffff;
  * \brief   constructor  
  * @param   inFilename file to be opened for parsing
  * @param   exception_on_error whether we throw an exception or not
- * @param   enable_sequences = true to allow the header 
- *          to be parsed *inside* the SeQuences,
- *          when they have an actual length 
- * \warning enable_sequences *has to be* true for reading PAPYRUS 3.0 files 
  * @param   ignore_shadow to allow skipping the shadow elements, 
  *          to save memory space.
- * \warning The TRUE value for this param has to be used 
- *          with a FALSE value for the 'enable_sequence' param.
- *          ('public elements' may be embedded in 'shadow Sequences')
  */
 gdcmDocument::gdcmDocument( std::string const & filename, 
                             bool exception_on_error,
-                            bool enable_sequences,
                             bool ignore_shadow) 
               : gdcmElementSet(-1)
 {
    IgnoreShadow = ignore_shadow;
-   //EnableSequences=enable_sequences;
-   (void)enable_sequences;
-   EnableSequences = true; // JPR // TODO : remove params out of the constructor
    SetMaxSizeLoadEntry(MAX_SIZE_LOAD_ELEMENT_VALUE); 
    Filename = filename;
    Initialise();
@@ -182,7 +171,6 @@ gdcmDocument::gdcmDocument(bool exception_on_error)
              :gdcmElementSet(-1)
 {
    (void)exception_on_error;
-   //EnableSequences=0; // ?!? JPR
 
    SetMaxSizeLoadEntry(MAX_SIZE_LOAD_ELEMENT_VALUE);
    Initialise();
@@ -2087,8 +2075,7 @@ void gdcmDocument::FixDocEntryFoundLength(gdcmDocEntry *entry,
       entry->SetReadLength(4); /// \todo a bug is to be fixed !?
    } 
  
-   //////// Deal with sequences, but only on users request:
-   else if ( entry->GetVR() == "SQ" && EnableSequences)
+   else if ( entry->GetVR() == "SQ" )
    {
       foundLength = 0;      // ReadLength is unchanged 
    } 
index bf55d592aa374d6f54107e9693ec549e3a405a79..c999b59134f928d3fa671124660cfd6631987f18 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.h,v $
   Language:  C++
-  Date:      $Date: 2004/07/19 03:34:11 $
-  Version:   $Revision: 1.23 $
+  Date:      $Date: 2004/07/30 11:40:13 $
+  Version:   $Revision: 1.24 $
  
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -159,7 +159,6 @@ protected:
    gdcmDocument(bool exception_on_error  = false);
    gdcmDocument(std::string const & filename, 
                 bool  exception_on_error = false, 
-                bool  enable_sequences   = false,
                 bool  ignore_shadow      = false);
    virtual ~gdcmDocument();
    
index 8221bd388d21676f8b136f67a19089f411c128cf..c4672b6e9d3f9a021fa9817936a9e575aec2de40 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFile.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/07/16 15:18:05 $
-  Version:   $Revision: 1.116 $
+  Date:      $Date: 2004/07/30 11:40:13 $
+  Version:   $Revision: 1.117 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -63,24 +63,15 @@ gdcmFile::gdcmFile(gdcmHeader *header)
  *        seen as a side effect).   
  * @param filename file to be opened for parsing
  * @param   exception_on_error whether we throw an exception or not
- * @param   enable_sequences = true to allow the header 
- *          to be parsed *inside* the SeQuences, 
- *          when they have an actual length 
- * \warning enable_sequences *has to be* true for reading PAPYRUS 3.0 files
  * @param   ignore_shadow to allow skipping the shadow elements, 
  *          to save memory space.
- * \warning The TRUE value for this param has to be used 
- *          with a FALSE value for the 'enable_sequence' param.
- *          ('public elements' may be embedded in 'shadow Sequences')
  */
 gdcmFile::gdcmFile(std::string const & filename, 
                    bool exception_on_error,
-                   bool enable_sequences, 
                    bool ignore_shadow)
 {
    Header = new gdcmHeader( filename,
                             exception_on_error,
-                            enable_sequences,
                             ignore_shadow );
    SelfHeader = true;
    PixelRead  = -1; // no ImageData read yet.
index be828e5ecafdb9f600da74a22c23661f897f0e5d..dc1836226367ba2890ef6aaf9ab06cee594936f7 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFile.h,v $
   Language:  C++
-  Date:      $Date: 2004/07/16 15:18:05 $
-  Version:   $Revision: 1.38 $
+  Date:      $Date: 2004/07/30 11:40:13 $
+  Version:   $Revision: 1.39 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -34,7 +34,6 @@ public:
    gdcmFile(gdcmHeader *header);
    gdcmFile(std::string const & filename, 
             bool  exception_on_error = false, 
-            bool  enable_sequences   = false,
             bool  skip_shadow        = false);
  
    virtual ~gdcmFile();
index 1cffe3ac20a5614ba2795b3e28a4ebf46d0f7b60..5e01a8f37ecdc30f4a940207709bfb3ac9fd108c 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmHeader.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/07/19 15:16:18 $
-  Version:   $Revision: 1.178 $
+  Date:      $Date: 2004/07/30 11:40:13 $
+  Version:   $Revision: 1.179 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
  * \brief  Constructor 
  * @param  filename name of the file whose header we want to analyze
  * @param  exception_on_error whether we want to throw an exception or not
- * @param  enable_sequences = true to allow the header 
- *         to be parsed *inside* the SeQuences, when they have an actual length 
  * @param  ignore_shadow = true if user wants to skip shadow groups 
  *         during parsing, to save memory space
  */
 gdcmHeader::gdcmHeader( std::string const & filename, 
                         bool exception_on_error,
-                        bool enable_sequences, 
                         bool ignore_shadow ):
             gdcmDocument( filename,
                           exception_on_error,
-                          enable_sequences,
                           ignore_shadow )
 {    
    // for some ACR-NEMA images GrPixel, NumPixel is *not* 7fe0,0010
index b6cb2c21aaca4e0eeffd75e079536ce33c4857d3..c5afb10b8b484a08c1ea425d5b416b74a61dcfe3 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmHeader.h,v $
   Language:  C++
-  Date:      $Date: 2004/07/17 22:45:40 $
-  Version:   $Revision: 1.81 $
+  Date:      $Date: 2004/07/30 11:40:13 $
+  Version:   $Revision: 1.82 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -110,7 +110,6 @@ public:
    gdcmHeader(bool exception_on_error = false);
    gdcmHeader(std::string const & filename, 
               bool  exception_on_error = false, 
-              bool  enable_sequences   = false,
               bool  skip_shadow        = false);
  
    virtual ~gdcmHeader();