From bd217557a398371d5d0a27c5aa6e09e47eb65652 Mon Sep 17 00:00:00 2001 From: jpr Date: Thu, 13 Jan 2005 09:23:27 +0000 Subject: [PATCH] 2005-01-13 Jean-Pierre Roux * FIX : First entry following group 0002 was lost for Explicit Big Endian Transfer Syntax files (group and elem not swaped) --- src/gdcmDocument.cxx | 12 +++++++----- src/gdcmDocument.h | 6 +++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index efed9882..79bad798 100644 --- a/src/gdcmDocument.cxx +++ b/src/gdcmDocument.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocument.cxx,v $ Language: C++ - Date: $Date: 2005/01/12 22:19:23 $ - Version: $Revision: 1.186 $ + Date: $Date: 2005/01/13 09:23:27 $ + Version: $Revision: 1.187 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -989,7 +989,7 @@ BinEntry *Document::GetBinEntry(uint16_t group, uint16_t element) * \brief Loads the element while preserving the current * underlying file position indicator as opposed to * to LoadDocEntry that modifies it. - * @param entry Header Entry whose value shall be loaded. + * @param entry Header Entry whose value will be loaded. * @return */ void Document::LoadDocEntrySafe(DocEntry *entry) @@ -2400,7 +2400,7 @@ std::string Document::GetTransferSyntaxName() * whatever Transfer Syntax is * @return no return */ -void Document::HandleOutOfGroup0002(uint16_t group) +void Document::HandleOutOfGroup0002(uint16_t &group, uint16_t &elem) { // Endian reversion. Some files contain groups of tags with reversed endianess. if ( !Group0002Parsed && group != 0x0002) @@ -2423,6 +2423,8 @@ void Document::HandleOutOfGroup0002(uint16_t group) gdcmVerboseMacro("Transfer Syntax Name = [" << GetTransferSyntaxName() << "]" ); SwitchByteSwapCode(); + group = SwapShort(group); + elem = SwapShort(elem); } } } @@ -2457,7 +2459,7 @@ DocEntry *Document::ReadNextDocEntry() // In 'true DICOM' files Group 0002 is always little endian if ( HasDCMPreamble ) - HandleOutOfGroup0002(group); + HandleOutOfGroup0002(group, elem); std::string vr = FindDocEntryVR(); std::string realVR = vr; diff --git a/src/gdcmDocument.h b/src/gdcmDocument.h index eeb51125..0a74dcf4 100644 --- a/src/gdcmDocument.h +++ b/src/gdcmDocument.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocument.h,v $ Language: C++ - Date: $Date: 2005/01/12 15:22:23 $ - Version: $Revision: 1.85 $ + Date: $Date: 2005/01/13 09:23:27 $ + Version: $Revision: 1.86 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -234,7 +234,7 @@ private: DocEntrySet* set ); void HandleBrokenEndian(uint16_t &group, uint16_t &elem); - void HandleOutOfGroup0002(uint16_t group); + void HandleOutOfGroup0002(uint16_t &group, uint16_t &elem); // Variables /// Public dictionary used to parse this header -- 2.45.1