From: jpr Date: Thu, 22 Jan 2004 17:41:35 +0000 (+0000) Subject: in ordrer to display the *stored* length when xxx.Print() X-Git-Tag: Version0.4~64 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=3dc2328d98ad8d9e9f2b8516f8b04053e9cb9ccf;p=gdcm.git in ordrer to display the *stored* length when xxx.Print() --- diff --git a/src/gdcmHeaderEntry.cxx b/src/gdcmHeaderEntry.cxx index 32a83b60..d11b342f 100644 --- a/src/gdcmHeaderEntry.cxx +++ b/src/gdcmHeaderEntry.cxx @@ -51,7 +51,7 @@ void gdcmHeaderEntry::Print(std::ostream & os) { s << "lg : "; lgth = GetReadLength(); if (lgth == 0xffffffff) { - sprintf(st,"x(ff)"); // I said : "x(ff)" ! + sprintf(st,"x(ffff)"); // I said : "x(ffff)" ! s.setf(std::ios::left); s << std::setw(10-strlen(st)) << " "; s << st << " "; @@ -67,7 +67,7 @@ void gdcmHeaderEntry::Print(std::ostream & os) { } s << " Off.: "; sprintf(st,"x(%x)",o); - s << std::setw(10-strlen(st)) << " "; + s << std::setw(10-strlen(st)) << " "; s << st << " "; s << std::setw(8) << o; } diff --git a/src/gdcmParser.cxx b/src/gdcmParser.cxx index 2c8981b3..e9a4b026 100644 --- a/src/gdcmParser.cxx +++ b/src/gdcmParser.cxx @@ -354,8 +354,7 @@ bool gdcmParser::CloseFile(void) * (ACR-NEMA, ExplicitVR, ImplicitVR) * @return always "True" ?! */ -bool gdcmParser::Write(FILE *fp, FileType type) -{ +bool gdcmParser::Write(FILE *fp, FileType type) { // ============== // TODO The stuff has been rewritten using the chained list instead // of the H table @@ -603,7 +602,6 @@ bool gdcmParser::SetEntryByNumber(std::string content, content = content + '\0'; } - //tagHT[key]->SetValue(content); gdcmHeaderEntry * a; IterHT p; TagHeaderEntryHT::iterator p2; @@ -617,7 +615,6 @@ bool gdcmParser::SetEntryByNumber(std::string content, a-> SetValue(content); - //std::string vr = tagHT[key]->GetVR(); std::string vr = a->GetVR(); guint32 lgr; @@ -628,7 +625,6 @@ bool gdcmParser::SetEntryByNumber(std::string content, else lgr = l; - //tagHT[key]->SetLength(lgr); a->SetLength(lgr); return true; } @@ -647,12 +643,12 @@ bool gdcmParser::SetEntryByNumber(std::string content, */ bool gdcmParser::SetEntryLengthByNumber(guint32 length, - guint16 group, guint16 element) { + guint16 group, + guint16 element) { TagKey key = gdcmDictEntry::TranslateToKey(group, element); if ( ! tagHT.count(key)) return false; if (length%2) length++; // length must be even - //tagHT[key]->SetLength(length); ( ((tagHT.equal_range(key)).first)->second )->SetLength(length); return true ; @@ -736,7 +732,6 @@ bool gdcmParser::SetEntryVoidAreaByNumber(void * area,guint16 group, guint16 ele TagKey key = gdcmDictEntry::TranslateToKey(group, element); if ( ! tagHT.count(key)) return false; - //tagHT[key]->SetVoidArea(area); ( ((tagHT.equal_range(key)).first)->second )->SetVoidArea(area); return true; } @@ -761,7 +756,8 @@ void gdcmParser::UpdateShaEntries(void) // Peer group => search the corresponding dict entry if(RefShaDict) - entry=RefShaDict->GetDictEntryByNumber((*it)->GetGroup(),(*it)->GetElement()); + entry=RefShaDict->GetDictEntryByNumber((*it)->GetGroup(), + (*it)->GetElement()); else entry=NULL; @@ -1221,9 +1217,8 @@ void gdcmParser::LoadHeaderEntry(gdcmHeaderEntry *Entry) if( group == 0xfffe ) SkipLoad = true; - if ( SkipLoad ) - { - Entry->SetLength(0); + if ( SkipLoad ) { + Entry->SetUsableLength(0); Entry->SetValue("gdcm::Skipped"); return; } @@ -1682,8 +1677,7 @@ void gdcmParser::FixHeaderEntryFoundLength(gdcmHeaderEntry *Entry, guint32 Found { Entry->SetReadLength(FoundLength); // will be updated only if a bug is found - if ( FoundLength == 0xffffffff) - { + if ( FoundLength == 0xffffffff) { FoundLength = 0; }