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/21 09:46:27 $
+ Version: $Revision: 1.80 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
uint16_t itemt[4]= { 0xfffe, 0xe00d, 0xffff, 0xffff };
//we force the writting of an 'Item' Start Element
- // because we want to write the Item as a 'no Length' item
+ // because we want to write the Item as a 'No Length' item
for(j=0;j<4;++j)
{
binary_write( *fp, item[j]); // fffe e000 ffff ffff
}
}
+/**
+ * \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
if ( *it == entryToRemove )
{
DocEntries.erase(it);
- gdcmWarningMacro( "One element erased: " << entryToRemove->GetKey() );
+ gdcmDebugMacro( "One element erased: " << entryToRemove->GetKey() );
entryToRemove->Unregister();
return true;
}