(Group length) of each 'zero level' group.
Program: gdcm
Module: $RCSfile: gdcmDataEntry.cxx,v $
Language: C++
- Date: $Date: 2005/11/04 15:31:34 $
- Version: $Revision: 1.18 $
+ Date: $Date: 2005/11/07 09:46:36 $
+ Version: $Revision: 1.19 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
fp->seekp(1, std::ios::cur);
}
+/**
+ * \brief Compute the full length of the elementary DataEntry (not only value
+ * length) depending on the VR.
+ */
+uint32_t DataEntry::ComputeFullLength()
+{
+ return GetFullLength();
+}
+
//-----------------------------------------------------------------------------
// Protected
void DataEntry::NewBinArea(void)
Program: gdcm
Module: $RCSfile: gdcmDataEntry.h,v $
Language: C++
- Date: $Date: 2005/10/26 15:56:51 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2005/11/07 09:46:36 $
+ Version: $Revision: 1.7 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// Write
virtual void WriteContent(std::ofstream *fp, FileType filetype);
-
+ uint32_t ComputeFullLength();
+
// Set/Get data
/// Sets the value (string) of the current Dicom entry
//virtual void SetValue(std::string const &val);
Program: gdcm
Module: $RCSfile: gdcmDocEntry.h,v $
Language: C++
- Date: $Date: 2005/10/24 16:00:47 $
- Version: $Revision: 1.55 $
+ Date: $Date: 2005/11/07 09:46:36 $
+ Version: $Revision: 1.56 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
virtual void SetLength(uint32_t l) { Length = l; }
/// \brief Returns the actual value length of the current Dicom entry
/// \warning this value is not *always* the one stored in the Dicom header
- /// in case of well knowned bugs
+ /// in case of well known bugs
const uint32_t &GetLength() const { return Length; }
uint32_t GetFullLength();
+ virtual uint32_t ComputeFullLength() = 0;
// The following 3 members, for internal use only !
/// \brief Sets the offset of the Dicom entry
Program: gdcm
Module: $RCSfile: gdcmSQItem.cxx,v $
Language: C++
- Date: $Date: 2005/10/27 09:52:33 $
- Version: $Revision: 1.78 $
+ 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
}
}
+/**
+ * \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
Program: gdcm
Module: $RCSfile: gdcmSQItem.h,v $
Language: C++
- Date: $Date: 2005/10/25 14:52:35 $
- Version: $Revision: 1.47 $
+ Date: $Date: 2005/11/07 09:46:37 $
+ Version: $Revision: 1.48 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
virtual void Print(std::ostream &os = std::cout, std::string const &indent = "" );
void WriteContent(std::ofstream *fp, FileType filetype);
+ uint32_t ComputeFullLength();
bool AddEntry(DocEntry *Entry); // add to the List
bool RemoveEntry(DocEntry *EntryToRemove);
Program: gdcm
Module: $RCSfile: gdcmSeqEntry.cxx,v $
Language: C++
- Date: $Date: 2005/11/03 08:36:19 $
- Version: $Revision: 1.61 $
+ Date: $Date: 2005/11/07 09:46:36 $
+ Version: $Revision: 1.62 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
binary_write(*fp, seq_term_lg);
}
+/**
+ * \brief Compute the full length of the SeqEntry (not only value
+ * length) depending on the VR.
+ */
+uint32_t SeqEntry::ComputeFullLength()
+{
+ uint32_t l = 12; // Tag (4) + VR (explicit) 4 + 4 (length);
+ for(ListSQItem::iterator cc = Items.begin();
+ cc != Items.end();
+ ++cc)
+ {
+ l += (*cc)->ComputeFullLength();
+ }
+ l += 8; // seq_term Tag (4) + seq_term_lg (4)
+ return l;
+}
+
/**
* \brief adds the passed ITEM to the ITEM chained List for this SeQuence.
* @param sqItem SQItem to be pushed back in the SeqEntry
Program: gdcm
Module: $RCSfile: gdcmSeqEntry.h,v $
Language: C++
- Date: $Date: 2005/10/24 16:00:48 $
- Version: $Revision: 1.36 $
+ Date: $Date: 2005/11/07 09:46:36 $
+ Version: $Revision: 1.37 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
void Print(std::ostream &os = std::cout, std::string const &indent = "" );
void WriteContent(std::ofstream *fp, FileType filetype);
-
+ uint32_t ComputeFullLength();
+
void AddSQItem(SQItem *it, int itemNumber);
void ClearSQItem();
SQItem *GetFirstSQItem();