]> Creatis software - gdcm.git/commitdiff
Now Print displays the BinEntry Content (if it's printable, and loaded)
authorjpr <jpr>
Thu, 25 Aug 2005 14:59:49 +0000 (14:59 +0000)
committerjpr <jpr>
Thu, 25 Aug 2005 14:59:49 +0000 (14:59 +0000)
Usefull for a lot od Implicit VR 'Bin'Entry (if we knew there VR, they wouldn't
be Bin ...)
Appreciate the difference having a look at PrintFile result for
gdcmData/SIEMENS_MAGNETOM-12-MONO2-FileSeq0.dcm.

src/gdcmBinEntry.cxx

index 3f2325e39bdac0d58f0ce7759df9b88394b1c41b..fdbda3f1a9b4dd4cc33a3a8b81e564bde90123c8 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmBinEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/08/25 13:45:40 $
-  Version:   $Revision: 1.73 $
+  Date:      $Date: 2005/08/25 14:59:49 $
+  Version:   $Revision: 1.74 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -156,10 +156,33 @@ void BinEntry::Print(std::ostream &os, std::string const & )
             }
             s << "]";
       }
+      else if ( GetVR() == "FD" )
+      {
+         int l = GetReadLength()/8 - 1;
+         double *beg = (double *)GetBinArea();
+         s << " [" << *beg;
+         if ( l!= 0)
+            for (int i=0;i<l;i++)
+            {
+               beg++;
+               s << "\\" << *beg;
+            }
+            s << "]";
+      }
       else
       {
-         s << " [" << GetValue()
-           << "; length = " << GetLength() << "]";
+         if ( Util::IsCleanArea( GetBinArea(),GetLength()  ) )
+         {
+            std::string cleanString = 
+                   Util::CreateCleanString( GetBinArea(),GetLength()  );
+            s << " [" << cleanString << "]";
+         }
+         else
+         {
+            s << " [" << GetValue()
+              << "; length = " << GetLength() << "]";
+         }
       }
    }
    else