]> Creatis software - gdcm.git/commitdiff
The way we dealt with 16 bits 'Pixel Data' on Big Endian processors
authorjpr <jpr>
Tue, 11 Oct 2005 08:55:58 +0000 (08:55 +0000)
committerjpr <jpr>
Tue, 11 Oct 2005 08:55:58 +0000 (08:55 +0000)
  *looked* us very clever.
  but it does exactly the opposite of what we expected.
  (i.e. we get the the result we were affraid to obtain
  *without* our clever stuff :-( )
  Since I've no access for the moment to a big endian proc
  I comment it out, to see the result on the dash board

src/gdcmBinEntry.cxx

index e27e6982aeca670876a447f266fda95c11e6293d..486271760f45ca9549ae80a3a57800d0e6efb238 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmBinEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/09/21 09:44:59 $
-  Version:   $Revision: 1.78 $
+  Date:      $Date: 2005/10/11 08:55:58 $
+  Version:   $Revision: 1.79 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -100,8 +100,18 @@ void BinEntry::WriteContent(std::ofstream *fp, FileType filetype)
 
       // 8 Bits Pixels *are* OB, 16 Bits Pixels *are* OW
       // -value forced while Reading process-
+      
+      //-->
+      // -->
+      // -->  WARNING
+      // -->        the following lines *looked* very clever, 
+      // -->        but they don't work on big endian processors.
+      // -->        since I've no access for the moment to a big endian proc :-(
+      // -->        I comment them out, to see the result on the dash board 
+      // -->     
+      /*     
       if (GetGroup() == 0x7fe0 && GetVR() == "OW")
-      {     
+      {  
          uint16_t *binArea16 = (uint16_t*)binArea8;
          binary_write (*fp, binArea16, lgr );
       }
@@ -110,6 +120,15 @@ void BinEntry::WriteContent(std::ofstream *fp, FileType filetype)
          // For any other VR, BinEntry is re-written as-is
          binary_write (*fp, binArea8, lgr );
       }
+      */
+      
+      //-->
+      // -->
+      // -->  WARNING      
+      // -->         remove the following line, an uncomment the previous ones, 
+      // -->         if it doesn't work better
+      // -->     
+      binary_write ( *fp, binArea8, lgr ); // Elem value
 #else
       binary_write ( *fp, binArea8, lgr ); // Elem value
 #endif //GDCM_WORDS_BIGENDIAN