From: frog Date: Fri, 30 Jul 2004 11:40:12 +0000 (+0000) Subject: * src/gdcmDicomDir.cxx, gdcmDocEntrySet.cxx: removed inclusion of errno.h X-Git-Tag: Version0.5.bp~27 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=4c8c80589b3770976ea27fc03b290b97db5da3e6;p=gdcm.git * 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. --- diff --git a/ChangeLog b/ChangeLog index fcadcbf2..3f67163a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,11 @@ -2004-07-27 Jean-Pierre Roux +2004-07-06 Eric Boix + * 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 * Test/CMakeLists.txt: newly re-introduced SIEMENS_Sonata-12-MONO2-SQ.dcm in gdcmData (previously known as E00001S03I0015.dcm) is blacklisted. diff --git a/Example/PrintHeader.cxx b/Example/PrintHeader.cxx index 49cd54e7..c8ec5d6c 100644 --- a/Example/PrintHeader.cxx +++ b/Example/PrintHeader.cxx @@ -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;jGetHeader(); if (argc > 2) { diff --git a/TODO b/TODO index 82bba741..31b1fe98 100644 --- 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 ) 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 diff --git a/gdcmPython/demo/PrintHeader.py b/gdcmPython/demo/PrintHeader.py index 52a1ae58..65698538 100644 --- a/gdcmPython/demo/PrintHeader.py +++ b/gdcmPython/demo/PrintHeader.py @@ -1,5 +1,6 @@ from gdcmPython import * import sys +import os ### Get filename from command line or default it try: diff --git a/src/gdcmDicomDir.cxx b/src/gdcmDicomDir.cxx index f3dc7315..b80d6bac 100644 --- a/src/gdcmDicomDir.cxx +++ b/src/gdcmDicomDir.cxx @@ -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 #include #include -#include #ifdef _MSC_VER #include diff --git a/src/gdcmDocEntrySet.cxx b/src/gdcmDocEntrySet.cxx index ad85c126..f2ba8903 100644 --- a/src/gdcmDocEntrySet.cxx +++ b/src/gdcmDocEntrySet.cxx @@ -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 #include "gdcmDebug.h" #include "gdcmCommon.h" #include "gdcmGlobal.h" diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index 53b39e75..4a204595 100644 --- a/src/gdcmDocument.cxx +++ b/src/gdcmDocument.cxx @@ -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 } diff --git a/src/gdcmDocument.h b/src/gdcmDocument.h index bf55d592..c999b591 100644 --- a/src/gdcmDocument.h +++ b/src/gdcmDocument.h @@ -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(); diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index 8221bd38..c4672b6e 100644 --- a/src/gdcmFile.cxx +++ b/src/gdcmFile.cxx @@ -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. diff --git a/src/gdcmFile.h b/src/gdcmFile.h index be828e5e..dc183622 100644 --- a/src/gdcmFile.h +++ b/src/gdcmFile.h @@ -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(); diff --git a/src/gdcmHeader.cxx b/src/gdcmHeader.cxx index 1cffe3ac..5e01a8f3 100644 --- a/src/gdcmHeader.cxx +++ b/src/gdcmHeader.cxx @@ -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 @@ -31,18 +31,14 @@ * \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 diff --git a/src/gdcmHeader.h b/src/gdcmHeader.h index b6cb2c21..c5afb10b 100644 --- a/src/gdcmHeader.h +++ b/src/gdcmHeader.h @@ -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();