-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.
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) {
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) {
-* 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)
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
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
from gdcmPython import *
import sys
+import os
### Get filename from command line or default it
try:
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
#include <string>
#include <algorithm>
#include <sys/types.h>
-#include <errno.h>
#ifdef _MSC_VER
#include <direct.h>
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
=========================================================================*/
-#include <errno.h>
#include "gdcmDebug.h"
#include "gdcmCommon.h"
#include "gdcmGlobal.h"
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
* \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();
:gdcmElementSet(-1)
{
(void)exception_on_error;
- //EnableSequences=0; // ?!? JPR
SetMaxSizeLoadEntry(MAX_SIZE_LOAD_ELEMENT_VALUE);
Initialise();
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
}
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
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();
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
* 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.
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
gdcmFile(gdcmHeader *header);
gdcmFile(std::string const & filename,
bool exception_on_error = false,
- bool enable_sequences = false,
bool skip_shadow = false);
virtual ~gdcmFile();
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
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
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();