]> Creatis software - gdcm.git/blobdiff - src/gdcmBinEntry.cxx
Fix typo
[gdcm.git] / src / gdcmBinEntry.cxx
index 70a277807da4e5f5e2df5c5445494242bd593b70..f376df9847d68511acb98ecf6fcdbfb04db609e5 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmBinEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/02/11 19:00:39 $
-  Version:   $Revision: 1.70 $
+  Date:      $Date: 2005/09/07 15:19:37 $
+  Version:   $Revision: 1.77 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -77,11 +77,11 @@ void BinEntry::WriteContent(std::ofstream *fp, FileType filetype)
    size_t lgr = GetLength();
    if (BinArea) // the binArea was *actually* loaded
    {
-   /// \todo  Probabely, the same operation will have to be done when we want 
-   ///        to write image with Big Endian Transfert Syntax, 
-   ///        and we are working on Little Endian Processor
+   /// \todo  Probably, the same operation should be done if we wanted 
+   ///        to write image with Big Endian Transfer Syntax, 
+   ///        while working on Little Endian Processor
 
-#ifdef GDCM_WORDS_BIGENDIAN
+#if defined(GDCM_WORDS_BIGENDIAN) || defined(GDCM_FORCE_BIGENDIAN_EMULATION)
       /// \todo FIXME Right now, we only care of Pixels element
       ///       we should deal with *all* the BinEntries
       ///       well not really since we are not interpreting values read...
@@ -143,8 +143,47 @@ void BinEntry::Print(std::ostream &os, std::string const & )
    void* binArea = GetBinArea();
    if (binArea)
    {
-      s << " [" << GetValue()
-        << "; length = " << GetLength() << "]";
+      if ( GetVR() == "FL" )
+      {
+         int l = GetReadLength()/4 - 1;
+         float *beg = (float *)GetBinArea();
+         s << " [" << *beg;
+         if ( l!= 0)
+            for (int i=0;i<l;i++)
+            {
+               beg++;
+               s << "\\" << *beg;
+            }
+            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
+      { 
+         if ( Util::IsCleanArea( GetBinArea(),GetLength()  ) )
+         {
+            std::string cleanString = 
+                   Util::CreateCleanString( GetBinArea(),GetLength()  );
+            s << " [" << cleanString << "]";
+         }
+         else
+         {
+            //s << " [" << GetValue()
+            s << " [" << GDCM_BINLOADED << ";"
+              << "length = " << GetLength() << "]";
+         } 
+      }
    }
    else
    {