]> Creatis software - gdcm.git/commitdiff
Final removal of gdcmFileHelper::InitializeDefaultFile();
authorjpr <jpr>
Fri, 11 Mar 2005 11:12:13 +0000 (11:12 +0000)
committerjpr <jpr>
Fri, 11 Mar 2005 11:12:13 +0000 (11:12 +0000)
src/gdcmFile.cxx
src/gdcmFile.h
src/gdcmFileHelper.cxx

index 5b23a36815ebc012a3227def9dd2f5a9e888e7db..fff552358a69c7065db477b7bf9cc2110deb11c4 100644 (file)
@@ -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
index b0dabaf9d467dced021089c6deaf54388d707504..36777fe68c9660f93e95b349e57aad16ad639099 100644 (file)
@@ -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;
index 6852fe48219254ddba59d6d48b64d0085ee98690..51ca3b5c3a614be3401bf3c4aabe978f3a17d1b8 100644 (file)
@@ -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: