From: jpr Date: Mon, 14 Nov 2005 12:27:57 +0000 (+0000) Subject: Try to track Big Endian problems (are the in the library, or in the test X-Git-Tag: Version1.3~91 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=248d9c246d8576b5fb5786dc25f5716b4c096f88;p=gdcm.git Try to track Big Endian problems (are the in the library, or in the test programs ?) --- diff --git a/Testing/TestAllReadCompareDicom.cxx b/Testing/TestAllReadCompareDicom.cxx index e1dc9df5..caff81ed 100644 --- a/Testing/TestAllReadCompareDicom.cxx +++ b/Testing/TestAllReadCompareDicom.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestAllReadCompareDicom.cxx,v $ Language: C++ - Date: $Date: 2005/11/09 10:52:37 $ - Version: $Revision: 1.53 $ + Date: $Date: 2005/11/14 12:27:57 $ + Version: $Revision: 1.54 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -137,7 +137,7 @@ TestFile::TestFile() Components = 0; Data = NULL; - SwapCode = 1234; + //SwapCode = 1234; } TestFile::~TestFile() @@ -259,7 +259,7 @@ bool TestFile::ReadFileHeader(std::ifstream *fp) SizeX = ReadInt32(fp); // Size X SizeY = ReadInt32(fp); // Size Y SizeZ = ReadInt32(fp); // Size Z - ScalarSize = ReadInt16(fp)/8; // bits per scalar + ScalarSize = ReadInt16(fp)/8; // bytes per scalar Components = ReadInt16(fp); // Number of components return(true); @@ -276,7 +276,12 @@ bool TestFile::ReadFileData(std::ifstream *fp) // Read data fp->read((char *)Data,GetDataSize()); - + + // Track BigEndian troubles + std::cout << " ScalarSize : " << GetScalarSize() + << " SwapCode:" << GetSwapCode() + << std::endl; + if (GetScalarSize() == 1 || GetSwapCode() == 1234) { return true; @@ -285,11 +290,8 @@ bool TestFile::ReadFileData(std::ifstream *fp) // We *know* DataSize may be 1 or 2 ! uint16_t g; -// Track BigEndian troubles -std::cout << " calarSize : " << GetScalarSize() - << " SwapCode:" << GetSwapCode() - << std::endl; - + std::cout << " Let's swap Pixels" <