]> Creatis software - gdcm.git/commitdiff
ENH: Ok PrintFile should be working with FASTKEY 1
authormalaterre <malaterre>
Mon, 11 Jul 2005 18:13:16 +0000 (18:13 +0000)
committermalaterre <malaterre>
Mon, 11 Jul 2005 18:13:16 +0000 (18:13 +0000)
src/gdcmCommon.h
src/gdcmDocEntry.cxx

index 516d397de615ca5b51d0ee6976976819dfe88176..77bb044f87875569897858bcbe4b8dcc91cf816e 100644 (file)
@@ -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;
index a4cf42c2b7ba7bc38ebd1df042949bce330d7083..edccc2db446bf9d5552f0437c27baf2951c0905f 100644 (file)
@@ -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)
    {