From: frog Date: Fri, 30 Jul 2004 16:09:25 +0000 (+0000) Subject: * src/gdcmDocument.[h|cxx], gdcmFile.[h|cxx], gdcmHeader.[h|cxx]: X-Git-Tag: Version0.5.bp~26 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=220ad8c527f2b2edf1ba19af8897aca8f4a49cf7;p=gdcm.git * src/gdcmDocument.[h|cxx], gdcmFile.[h|cxx], gdcmHeader.[h|cxx]: skip_shadow removed from gdcmHeader constructor and dependencies. * Example/*.cxx and Test/*.cxx changed accordingly. --- diff --git a/ChangeLog b/ChangeLog index 3f67163a..3a66c168 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,9 @@ enable_sequences removed from gdcmHeader constructor and dependencies. * Example/PrintHeader.cxx: fixed accordingly (enable_sequences removal). * gdcmPython/demo/PrintHeader.py: dummy fix. + * src/gdcmDocument.[h|cxx], gdcmFile.[h|cxx], gdcmHeader.[h|cxx]: + skip_shadow removed from gdcmHeader constructor and dependencies. + * Example/*.cxx and Test/*.cxx changed accordingly. 2004-07-27 Eric Boix * Test/CMakeLists.txt: newly re-introduced SIEMENS_Sonata-12-MONO2-SQ.dcm diff --git a/Example/PrintDocument.cxx b/Example/PrintDocument.cxx index d3ceeb25..85e4b297 100644 --- a/Example/PrintDocument.cxx +++ b/Example/PrintDocument.cxx @@ -8,8 +8,10 @@ int main(int argc, char* argv[]) std::string fileName; if (argc != 2) { - std::cout << " Usage : " << argv[0] - << " filename." << std::endl; + std::cout << " Usage : " + << argv[0] + << " filename." + << std::endl; } if (argc > 1) { @@ -19,8 +21,7 @@ int main(int argc, char* argv[]) fileName += "/test.acr"; } - e1= new gdcmHeader - (fileName.c_str(),false, true); + e1= new gdcmHeader( fileName.c_str(), false ); e1->SetPrintLevel(2); diff --git a/Example/PrintFile.cxx b/Example/PrintFile.cxx index edc2957f..0beeda3f 100644 --- a/Example/PrintFile.cxx +++ b/Example/PrintFile.cxx @@ -18,8 +18,7 @@ int main(int argc, char* argv[]) fileName += "/test.acr"; } - e1= new gdcmHeader - (fileName.c_str(),false, true); + e1= new gdcmHeader( fileName.c_str(), false ); f1 = new gdcmFile(e1); diff --git a/Example/PrintHeader.cxx b/Example/PrintHeader.cxx index c8ec5d6c..be38cc4f 100644 --- a/Example/PrintHeader.cxx +++ b/Example/PrintHeader.cxx @@ -3,28 +3,24 @@ int main(int argc, char* argv[]) { - bool dropPriv = false; 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; + if (argc == 1) + { + std::cout << argv[0] << " fileName" << std::endl; } - if (argc > 1) { + if (argc > 1) + { fileName=argv[1]; - } else { + } + else + { fileName += GDCM_DATA_ROOT; fileName += "/test.acr"; } - for (int j=0;jGetHeader(); if (argc > 2) { diff --git a/Example/TestWrite.cxx b/Example/TestWrite.cxx index cb9b9e69..402f7c68 100644 --- a/Example/TestWrite.cxx +++ b/Example/TestWrite.cxx @@ -46,8 +46,9 @@ int main(int argc, char* argv[]) toto = argv[1]; - e1 = new gdcmHeader(toto.c_str(), false, true); - if (!e1->IsReadable()) { + e1 = new gdcmHeader( toto.c_str(), false ); + if (!e1->IsReadable()) + { std::cerr << "Sorry, not a Readable DICOM / ACR File" <IsReadable()) { std::cerr << "Sorry, not a Readable DICOM / ACR File" <IsReadable()) { std::cerr << "Sorry, " << toto <<" not a Readable DICOM / ACR File" <IsReadable()) { std::cerr << "Sorry, " << zozo << " not a Readable DICOM / ACR File" <first; cout << Indent << "FileName: " << fileName << endl; - gdcmHeader* tested = new gdcmHeader( fileName.c_str(), false, true ); + gdcmHeader* tested = new gdcmHeader( fileName.c_str(), false ); if( !tested->IsReadable() ) { cerr << Indent << "Image not gdcm compatible:" diff --git a/Testing/TestAllReadCompareDicom.cxx b/Testing/TestAllReadCompareDicom.cxx index 0c0595c8..386a6ffb 100644 --- a/Testing/TestAllReadCompareDicom.cxx +++ b/Testing/TestAllReadCompareDicom.cxx @@ -73,7 +73,7 @@ int TestAllReadCompareDicom(int argc, char* argv[]) std::cout << " Testing: " << filename << std::endl; - gdcmFile* tested = new gdcmFile( filename, false, true ); + gdcmFile* tested = new gdcmFile( filename, false ); if( !tested->GetHeader()->IsReadable() ) { std::cout << " Image not gdcm compatible:" @@ -116,8 +116,7 @@ int TestAllReadCompareDicom(int argc, char* argv[]) ////// When reference file is not gdcm readable test is failed: - gdcmFile* reference = new gdcmFile( referenceFileName.c_str(), - false, true ); + gdcmFile* reference = new gdcmFile( referenceFileName.c_str(), false ); if( !reference->GetHeader()->IsReadable() ) { std::cout << " Reference image " << std::endl diff --git a/Testing/TestReadWriteReadCompare.cxx b/Testing/TestReadWriteReadCompare.cxx index 3df0cbdf..ed14c08a 100644 --- a/Testing/TestReadWriteReadCompare.cxx +++ b/Testing/TestReadWriteReadCompare.cxx @@ -39,7 +39,7 @@ int TestReadWriteReadCompare(int argc, char* argv[]) //////////////// Step 1 (see above description): - gdcmHeader *header = new gdcmHeader( filename, false, true ); + gdcmHeader *header = new gdcmHeader( filename, false ); if( !header->IsReadable() ) { std::cerr << "Test::TestReadWriteReadCompare: Image not gdcm compatible:" @@ -74,8 +74,7 @@ int TestReadWriteReadCompare(int argc, char* argv[]) //////////////// Step 3: - gdcmFile* reread = new gdcmFile( "TestReadWriteReadCompare.dcm", - false, true ); + gdcmFile* reread = new gdcmFile( "TestReadWriteReadCompare.dcm", false ); if( !reread->GetHeader()->IsReadable() ) { std::cerr << "Test::TestReadWriteReadCompare: Could not reread image " diff --git a/src/gdcmDicomDir.cxx b/src/gdcmDicomDir.cxx index b80d6bac..3dcefe86 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/30 11:40:13 $ - Version: $Revision: 1.60 $ + Date: $Date: 2004/07/30 16:09:27 $ + Version: $Revision: 1.61 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -75,7 +75,7 @@ gdcmDicomDir::gdcmDicomDir(bool exception_on_error): */ gdcmDicomDir::gdcmDicomDir(std::string const & fileName, bool parseDir, bool exception_on_error): - gdcmDocument( fileName, exception_on_error, true) // true : enable SeQuences + gdcmDocument( fileName, exception_on_error) { // que l'on ai passe un root directory ou un DICOMDIR // et quelle que soit la valeur de parseDir, @@ -451,21 +451,29 @@ void gdcmDicomDir::CreateDicomDirChainedList(std::string const & path) break; } - header = new gdcmHeader(it->c_str(),false,true); - if(!header) { - std::cout << "failure in new Header " << it->c_str() << std::endl; // JPR - } - if(header->IsReadable()) { - list.push_back(header); // adds the file header to the chained list - std::cout << "readable : " <c_str() << std::endl; // JPR - } - else + header = new gdcmHeader( it->c_str(),false ); + if( !header ) { - delete header; + dbg.Verbose( 1, + "gdcmDicomDir::CreateDicomDirChainedList: " + "failure in new Header ", + it->c_str() ); } - count++; - + if( header->IsReadable() ) + { + // Add the file header to the chained list: + list.push_back(header); + dbg.Verbose( 1, + "gdcmDicomDir::CreateDicomDirChainedList: readable ", + it->c_str() ); + } + else + { + delete header; + } + count++; } + // sorts Patient/Study/Serie/ std::sort(list.begin(), list.end(), gdcmDicomDir::HeaderLessThan ); diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index 4a204595..ccd0b644 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/30 11:40:13 $ - Version: $Revision: 1.59 $ + Date: $Date: 2004/07/30 16:09:27 $ + 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 @@ -84,15 +84,11 @@ 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 ignore_shadow to allow skipping the shadow elements, - * to save memory space. */ gdcmDocument::gdcmDocument( std::string const & filename, - bool exception_on_error, - bool ignore_shadow) + bool exception_on_error) : gdcmElementSet(-1) { - IgnoreShadow = ignore_shadow; SetMaxSizeLoadEntry(MAX_SIZE_LOAD_ELEMENT_VALUE); Filename = filename; Initialise(); diff --git a/src/gdcmDocument.h b/src/gdcmDocument.h index c999b591..12563947 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/30 11:40:13 $ - Version: $Revision: 1.24 $ + Date: $Date: 2004/07/30 16:09:27 $ + Version: $Revision: 1.25 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -158,8 +158,7 @@ protected: // gdcmDicomDir are meaningfull). gdcmDocument(bool exception_on_error = false); gdcmDocument(std::string const & filename, - bool exception_on_error = false, - bool ignore_shadow = false); + bool exception_on_error = false); virtual ~gdcmDocument(); void gdcmDocument::Parse7FE0 (); diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index c4672b6e..248fc34d 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/30 11:40:13 $ - Version: $Revision: 1.117 $ + Date: $Date: 2004/07/30 16:09:27 $ + Version: $Revision: 1.118 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -63,16 +63,11 @@ 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 ignore_shadow to allow skipping the shadow elements, - * to save memory space. */ gdcmFile::gdcmFile(std::string const & filename, - bool exception_on_error, - bool ignore_shadow) + bool exception_on_error ) { - Header = new gdcmHeader( filename, - exception_on_error, - ignore_shadow ); + Header = new gdcmHeader( filename, exception_on_error ); SelfHeader = true; PixelRead = -1; // no ImageData read yet. diff --git a/src/gdcmFile.h b/src/gdcmFile.h index dc183622..b7a39582 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/30 11:40:13 $ - Version: $Revision: 1.39 $ + Date: $Date: 2004/07/30 16:09:27 $ + Version: $Revision: 1.40 $ 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,7 @@ class GDCM_EXPORT gdcmFile public: gdcmFile(gdcmHeader *header); gdcmFile(std::string const & filename, - bool exception_on_error = false, - bool skip_shadow = false); + bool exception_on_error = false); virtual ~gdcmFile(); diff --git a/src/gdcmHeader.cxx b/src/gdcmHeader.cxx index 5e01a8f3..5023fad1 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/30 11:40:13 $ - Version: $Revision: 1.179 $ + Date: $Date: 2004/07/30 16:09:27 $ + Version: $Revision: 1.180 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -31,15 +31,11 @@ * \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 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 ignore_shadow ): + bool exception_on_error ): gdcmDocument( filename, - exception_on_error, - ignore_shadow ) + exception_on_error ) { // for some ACR-NEMA images GrPixel, NumPixel is *not* 7fe0,0010 // We may encounter the 'RETired' (0x0028, 0x0200) tag @@ -49,8 +45,7 @@ gdcmHeader::gdcmHeader( std::string const & filename, // Inside the group pointed by "Image Location" the searched element // is conventionally the element 0x0010 (when the norm is respected). // When the "Image Location" is absent we default to group 0x7fe0. - - // This IS the right place for the code + // Note: this IS the right place for the code // Image Location std::string imgLocation = GetEntryByNumber(0x0028, 0x0200); diff --git a/src/gdcmHeader.h b/src/gdcmHeader.h index c5afb10b..4835fb81 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/30 11:40:13 $ - Version: $Revision: 1.82 $ + Date: $Date: 2004/07/30 16:09:27 $ + Version: $Revision: 1.83 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -109,8 +109,7 @@ protected: public: gdcmHeader(bool exception_on_error = false); gdcmHeader(std::string const & filename, - bool exception_on_error = false, - bool skip_shadow = false); + bool exception_on_error = false); virtual ~gdcmHeader(); diff --git a/vtk/vtkGdcmReader.cxx b/vtk/vtkGdcmReader.cxx index 11d9f680..7953ac8e 100644 --- a/vtk/vtkGdcmReader.cxx +++ b/vtk/vtkGdcmReader.cxx @@ -58,7 +58,7 @@ #include #include -vtkCxxRevisionMacro(vtkGdcmReader, "$Revision: 1.46 $"); +vtkCxxRevisionMacro(vtkGdcmReader, "$Revision: 1.47 $"); vtkStandardNewMacro(vtkGdcmReader); //----------------------------------------------------------------------------- @@ -444,8 +444,7 @@ int vtkGdcmReader::CheckFileCoherence() fclose(fp); // Stage 1.2: check for Gdcm parsability - gdcmHeader GdcmHeader(FileName->c_str(), false, true); - // true : for enableSequences + gdcmHeader GdcmHeader(FileName->c_str(), false ); if (!GdcmHeader.IsReadable()) { vtkErrorMacro("Gdcm cannot parse file " << FileName->c_str()); @@ -611,8 +610,7 @@ size_t vtkGdcmReader::LoadImageInMemory( unsigned long & UpdateProgressCount) { vtkDebugMacro("Copying to memory image [" << FileName.c_str() << "]"); - gdcmFile GdcmFile(FileName.c_str(),false,true); - // true : to enable SeQuences + gdcmFile GdcmFile( FileName.c_str(), false ); size_t size; // If the data structure of vtk for image/volume representation