X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmSQItem.cxx;h=431ac51e1702320ba439dc4557effbe70d50d815;hb=779c8f5232ad160d353b90d3fa47d0503e17965d;hp=7c8d61c6e5373241d79a2ecac1a420541bfbc4cf;hpb=4f189b7cd8d7aff962887245b7b30ede39b7856c;p=gdcm.git diff --git a/src/gdcmSQItem.cxx b/src/gdcmSQItem.cxx index 7c8d61c6..431ac51e 100644 --- a/src/gdcmSQItem.cxx +++ b/src/gdcmSQItem.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSQItem.cxx,v $ Language: C++ - Date: $Date: 2005/10/24 16:00:48 $ - Version: $Revision: 1.77 $ + Date: $Date: 2005/11/07 09:46:37 $ + Version: $Revision: 1.79 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -99,6 +99,29 @@ void SQItem::WriteContent(std::ofstream *fp, FileType filetype) } } +/** + * \brief Compute the full length of the SQItem (not only value + * length) depending on the VR. + */ +uint32_t SQItem::ComputeFullLength() +{ + uint32_t l = 8; // Item Starter length + for (ListDocEntry::iterator it = DocEntries.begin(); + it != DocEntries.end(); + ++it) + { + // we skip delimitors (start and end one) because + // we force them as 'no length' + if ( (*it)->GetGroup() == 0xfffe ) + { + continue; + } + l += (*it)->ComputeFullLength(); + } + l += 8; // 'Item Delimitation' item + return l; +} + /** * \brief Inserts *in the right place* any Entry (Dicom Element) * into the Sequence Item @@ -154,7 +177,7 @@ bool SQItem::RemoveEntry( DocEntry *entryToRemove ) if ( *it == entryToRemove ) { DocEntries.erase(it); - gdcmWarningMacro( "One element erased: " << entryToRemove->GetKey() ); + gdcmDebugMacro( "One element erased: " << entryToRemove->GetKey() ); entryToRemove->Unregister(); return true; }