From 8a6622e63dd21202b5be2bbcf08db3943ef9655a Mon Sep 17 00:00:00 2001 From: malaterre Date: Mon, 11 Jul 2005 18:13:16 +0000 Subject: [PATCH] ENH: Ok PrintFile should be working with FASTKEY 1 --- src/gdcmCommon.h | 17 +++++++++++++---- src/gdcmDocEntry.cxx | 11 ++++------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/gdcmCommon.h b/src/gdcmCommon.h index 516d397d..77bb044f 100644 --- a/src/gdcmCommon.h +++ b/src/gdcmCommon.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmCommon.h,v $ Language: C++ - Date: $Date: 2005/07/11 16:20:55 $ - Version: $Revision: 1.75 $ + Date: $Date: 2005/07/11 18:13:16 $ + Version: $Revision: 1.76 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -136,7 +136,9 @@ inline std::ostream& operator<<(std::ostream& _O, TagKey _val) { return ( _O << std::right << std::setw(4) << std::setfill('0') << std::hex << _val.tab[0] << "|" << std::right << std::setw(4) << - std::setfill('0') << std::hex << _val.tab[1]); + std::setfill('0') << std::hex << _val.tab[1] + // put back defaults: + << std::setfill(' ') << std::left << std::dec); }; inline bool operator==(TagKey _self, TagKey _val) { @@ -144,7 +146,14 @@ inline bool operator==(TagKey _self, TagKey _val) }; inline bool operator<(TagKey _self, TagKey _val) { - return _self.tagkey < _val.tagkey; + // This expression is a tad faster but PrintFile output + // is more difficult to read + //return _self.tagkey < _val.tagkey; + + // More usal order of dicom tags: + if( _self.tab[0] == _val.tab[0] ) + return _self.tab[1] < _val.tab[1]; + return _self.tab[0] < _val.tab[0]; }; #else typedef std::string TagKey; diff --git a/src/gdcmDocEntry.cxx b/src/gdcmDocEntry.cxx index a4cf42c2..edccc2db 100644 --- a/src/gdcmDocEntry.cxx +++ b/src/gdcmDocEntry.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocEntry.cxx,v $ Language: C++ - Date: $Date: 2005/07/11 16:28:04 $ - Version: $Revision: 1.60 $ + Date: $Date: 2005/07/11 18:13:16 $ + Version: $Revision: 1.61 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -222,11 +222,8 @@ void DocEntry::Print(std::ostream &os, std::string const & ) vr = GetVR(); if ( vr==GDCM_UNKNOWN ) vr=" "; - - char sKey[10]; - sprintf(sKey,"%04x|%04x",GetGroup(),GetElement() ); - // s << sKey; - //s << DictEntry::TranslateToKey(GetGroup(),GetElement()); + + s << DictEntry::TranslateToKey(GetGroup(),GetElement()); if (PrintLevel >= 2) { -- 2.48.1