From: regrain Date: Thu, 6 Jan 2005 09:51:52 +0000 (+0000) Subject: * src/gdcmDocument.cxx : amelioration of code X-Git-Tag: Version1.0.bp~477 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=1bcc15cc0975fcef0be4743ced0a354515d23c83;hp=d97e9432393b8515630a11586e0e95df6be9eb43;p=gdcm.git * src/gdcmDocument.cxx : amelioration of code -- BeNours --- diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index 2d595c5b..417fc90a 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/06 09:34:58 $ - Version: $Revision: 1.153 $ + Date: $Date: 2005/01/06 09:51:52 $ + Version: $Revision: 1.154 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -1921,7 +1921,7 @@ bool Document::CheckDocEntryVR(DocEntry *entry, VRKey vr) entry->SetVR(vr); } } - else if ( entry->GetVR() != vr ) + else if ( entry->GetVR() != vr ) { // The VR present in the file and the dictionary disagree. We assume // the file writer knew best and use the VR of the file. Since it would @@ -3149,24 +3149,23 @@ int Document::ComputeGroup0002Length( FileType filetype ) gr = entry->GetGroup(); if (gr == 0x0002) + { found0002 = true; - else - if (found0002 ) - break; - else - continue; - el = entry->GetElement(); - vr = entry->GetVR(); + el = entry->GetElement(); + vr = entry->GetVR(); - if (filetype == ExplicitVR) - { - if ( (vr == "OB") || (vr == "OW") || (vr == "SQ") ) + if (filetype == ExplicitVR) { - groupLength += 4; // explicit VR AND OB, OW, SQ : 4 more bytes + if ( (vr == "OB") || (vr == "OW") || (vr == "SQ") ) + { + groupLength += 4; // explicit VR AND OB, OW, SQ : 4 more bytes + } } + groupLength += 2 + 2 + 4 + entry->GetLength(); } - groupLength += 2 + 2 + 4 + entry->GetLength(); + else if (found0002 ) + break; entry = GetNextEntry(); }