From ef8ed3af8c91289da3f6a6e64da7aafda69b8b62 Mon Sep 17 00:00:00 2001 From: jpr Date: Fri, 11 Mar 2005 11:12:13 +0000 Subject: [PATCH] Final removal of gdcmFileHelper::InitializeDefaultFile(); --- src/gdcmFile.cxx | 26 ++++---------------------- src/gdcmFile.h | 6 ++---- src/gdcmFileHelper.cxx | 11 +++++++++-- 3 files changed, 15 insertions(+), 28 deletions(-) diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index 5b23a368..fff55235 100644 --- a/src/gdcmFile.cxx +++ b/src/gdcmFile.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmFile.cxx,v $ Language: C++ - Date: $Date: 2005/03/09 19:31:54 $ - Version: $Revision: 1.229 $ + Date: $Date: 2005/03/11 11:12:13 $ + Version: $Revision: 1.230 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -153,7 +153,8 @@ File::File(): { RLEInfo = new RLEFramesInfo; JPEGInfo = new JPEGFragmentsInfo; - InitializeDefaultFile(); + GrPixel = 0x7fe0; + NumPixel = 0x0010; } /** @@ -1404,26 +1405,7 @@ bool File::Write(std::string fileName, FileType writetype) //----------------------------------------------------------------------------- // Protected -/** - * \brief Initialize a default DICOM File that should contain all the - * fields required by other readers. DICOM standard does not - * explicitely defines those fields, heuristic has been choosen. - * \todo final removal of this method - * with FileHelper::CheckMandatoryElements() - */ -void File::InitializeDefaultFile() -{ - // fixme - // Just to avoid further trouble if user asks - //to write the file ACR-NEMA mode - InsertValEntry("", 0x0008, 0x0010); // Recognition Code (RET) - - // fixme - GrPixel = 0x7fe0; - NumPixel = 0x0010; - -} //----------------------------------------------------------------------------- // Private diff --git a/src/gdcmFile.h b/src/gdcmFile.h index b0dabaf9..36777fe6 100644 --- a/src/gdcmFile.h +++ b/src/gdcmFile.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmFile.h,v $ Language: C++ - Date: $Date: 2005/02/15 18:12:35 $ - Version: $Revision: 1.104 $ + Date: $Date: 2005/03/11 11:12:13 $ + Version: $Revision: 1.105 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -168,8 +168,6 @@ public: bool Write(std::string fileName, FileType filetype); protected: - /// Initialize DICOM File when none - void InitializeDefaultFile(); /// Store the RLE frames info obtained during parsing of pixels. RLEFramesInfo *RLEInfo; diff --git a/src/gdcmFileHelper.cxx b/src/gdcmFileHelper.cxx index 6852fe48..51ca3b5c 100644 --- a/src/gdcmFileHelper.cxx +++ b/src/gdcmFileHelper.cxx @@ -4,8 +4,8 @@ Module: $RCSfile: gdcmFileHelper.cxx,v $ Language: C++ - Date: $Date: 2005/03/09 09:45:33 $ - Version: $Revision: 1.29 $ + Date: $Date: 2005/03/11 11:12:13 $ + Version: $Revision: 1.30 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -617,6 +617,13 @@ bool FileHelper::Write(std::string const &fileName) break; case ACR: case ACR_LIBIDO: + // Just to avoid further trouble if user create a file ex-nihilo, + // wants to write it as an ACR-NEMA file, + // and forget to create any Entry belonging to group 0008 + // (shame on him !) + // We add Recognition Code (RET) + if ( ! FileInternal->GetValEntry(0x0008, 0x0010) ) + FileInternal->InsertValEntry("", 0x0008, 0x0010); SetWriteFileTypeToACR(); break; default: -- 2.48.1