From: jpr Date: Tue, 11 Oct 2005 08:55:58 +0000 (+0000) Subject: The way we dealt with 16 bits 'Pixel Data' on Big Endian processors X-Git-Tag: Version1.2.bp~30 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;ds=sidebyside;h=50373dfc67812e79453d0bba0686ec40093fa7dd;p=gdcm.git The way we dealt with 16 bits 'Pixel Data' on Big Endian processors *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 --- diff --git a/src/gdcmBinEntry.cxx b/src/gdcmBinEntry.cxx index e27e6982..48627176 100644 --- a/src/gdcmBinEntry.cxx +++ b/src/gdcmBinEntry.cxx @@ -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