From: jpr Date: Wed, 27 Apr 2005 09:52:27 +0000 (+0000) Subject: Pb of 'Bits Allocated = 12' is now dealt with in X-Git-Tag: Version1.2.bp~746 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=77ae298f4ca7683d07165d386e9c02b36b8b0cde;p=gdcm.git Pb of 'Bits Allocated = 12' is now dealt with in FileHelper::CheckMandatoryElements, no longer in File::Write. Thx to Mathieu for reporting bug. --- diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index 71e8a778..daa3691f 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/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) { diff --git a/src/gdcmFileHelper.cxx b/src/gdcmFileHelper.cxx index 583a6192..32f480d3 100644 --- a/src/gdcmFileHelper.cxx +++ b/src/gdcmFileHelper.cxx @@ -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)