Program: gdcm
Module: $RCSfile: gdcmDocEntry.cxx,v $
Language: C++
- Date: $Date: 2004/08/31 14:24:47 $
- Version: $Revision: 1.16 $
+ Date: $Date: 2004/10/06 13:12:42 $
+ Version: $Revision: 1.24 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
- http://www.creatis.insa-lyon.fr/Public/Gdcm/License.htm for details.
+ http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
gdcmDocEntry::gdcmDocEntry(gdcmDictEntry* in)
{
ImplicitVR = false;
- DictEntry = in;
+ DictEntry = in;
+ SetKey( in->GetKey( ) );
+ Offset = 0 ; // To avoid further missprinting
}
//-----------------------------------------------------------------------------
* \brief Prints the common part of gdcmValEntry, gdcmBinEntry, gdcmSeqEntry
* @param os ostream we want to print in
*/
-void gdcmDocEntry::Print(std::ostream & os)
+void gdcmDocEntry::Print(std::ostream& os)
{
PrintLevel = 2; // FIXME
std::string d2, vr;
std::ostringstream s;
uint32_t lgth;
- char greltag[10]; //group element tag
g = GetGroup();
e = GetElement();
o = GetOffset();
vr = GetVR();
- sprintf(greltag,"%04x|%04x ",g,e);
- s << greltag ;
-
+
+ s << gdcmDictEntry::TranslateToKey(GetGroup(),GetElement());
+
if (PrintLevel >= 2)
{
- s << "lg : ";
+ s << " lg : ";
lgth = GetReadLength(); // ReadLength, as opposed to UsableLength
if (lgth == 0xffffffff)
{
s << std::setw(10-strlen(st)) << " ";
s << st << " ";
s.setf(std::ios::left);
- s << std::setw(8) << "-1";
+ s << std::setw(8) << "-1";
}
else
{
sprintf(st,"x(%x)",lgth);
s.setf(std::ios::left);
- s << std::setw(10-strlen(st)) << " ";
+ s << std::setw(10-strlen(st)) << " ";
s << st << " ";
s.setf(std::ios::left);
s << std::setw(8) << lgth;
* @param fp already open file pointer
* @param filetype type of the file to be written
*/
-void gdcmDocEntry::Write(FILE *fp, FileType filetype)
+void gdcmDocEntry::Write(FILE* fp, FileType filetype)
{
uint32_t FFFF = 0xffffffff;
uint16_t group = GetGroup();
// Unknown was 'written'
// deal with Little Endian
fwrite ( &shortLgr,(size_t)2 ,(size_t)1 ,fp);
- fwrite ( &z, (size_t)2 ,(size_t)1 ,fp);
+ fwrite ( &z, (size_t)2 ,(size_t)1 ,fp);
}
else
{
/**
* \ingroup gdcmDocEntry
- * \brief Gets the full length of the elementary DocEntry (not only value length)
+ * \brief Gets the full length of the elementary DocEntry (not only value
+ * length) depending on the VR.
*/
uint32_t gdcmDocEntry::GetFullLength()
{