]> Creatis software - gdcm.git/commitdiff
Pb of 'Bits Allocated = 12' is now dealt with in
authorjpr <jpr>
Wed, 27 Apr 2005 09:52:27 +0000 (09:52 +0000)
committerjpr <jpr>
Wed, 27 Apr 2005 09:52:27 +0000 (09:52 +0000)
FileHelper::CheckMandatoryElements, no longer in File::Write.
Thx to Mathieu for reporting bug.

src/gdcmFile.cxx
src/gdcmFileHelper.cxx

index 71e8a7782c480f78418d2a0f8eed787410a826f3..daa3691fba442c2fc08a80832072116a85c46e7f 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFile.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/04/19 09:58:19 $
-  Version:   $Revision: 1.233 $
+  Date:      $Date: 2005/04/27 09:52:27 $
+  Version:   $Revision: 1.234 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -1347,12 +1347,6 @@ bool File::Write(std::string fileName, FileType writetype)
       e0000->SetValue(sLen.str());
    }
 
-   // Bits Allocated
-   if ( GetEntryValue(0x0028,0x0100) ==  "12")
-   {
-      SetValEntry("16", 0x0028,0x0100);
-   }
-
    int i_lgPix = GetEntryLength(GrPixel, NumPixel);
    if (i_lgPix != -2)
    {
index 583a619297edf04e7c93673f42596f9ae82416d3..32f480d3e3223263b9290acc4a25db9faa146ab6 100644 (file)
@@ -4,8 +4,8 @@
   Module:    $RCSfile: gdcmFileHelper.cxx,v $
   Language:  C++
 
-  Date:      $Date: 2005/04/19 12:31:56 $
-  Version:   $Revision: 1.34 $
+  Date:      $Date: 2005/04/27 09:52:28 $
+  Version:   $Revision: 1.35 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -1162,6 +1162,15 @@ void FileHelper::CheckMandatoryElements()
    Archive->Push(0x0028,0x0017);
    Archive->Push(0x0028,0x00199);
 
+   // Deal with the pb of (Bits Stored = 12)
+   // - we're gonna write the image as Bits Stored = 16
+   if ( FileInternal->GetEntryValue(0x0028,0x0100) ==  "12")
+   {
+      ValEntry *e_0028_0100 = CopyValEntry(0x0028,0x0100);
+      e_0028_0100->SetValue("16");
+      Archive->Push(e_0028_0100);
+   }
+
    // --- Check UID-related Entries ---
 
    // If 'SOP Class UID' exists ('true DICOM' image)