X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FTestAllReadCompareDicom.cxx;h=56aecc31634df67bce56481e673b2aeb846c6f9e;hb=0c1b69c840b2ab0f42ef1cdbbc1897c44a5ed264;hp=51149b60bff4dca9d642b981d351e02d6de25c37;hpb=d7531a8099267279c067b9115309cdc10f8eb46d;p=gdcm.git diff --git a/Testing/TestAllReadCompareDicom.cxx b/Testing/TestAllReadCompareDicom.cxx index 51149b60..56aecc31 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/28 13:33:38 $ - Version: $Revision: 1.57 $ + Date: $Date: 2007/06/04 08:51:24 $ + Version: $Revision: 1.59 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -170,7 +170,7 @@ int TestFile::ComputeSwapCode(uint32_t tag) { // FIXME : 100 % useless method ! // "gdcm" was written on disc byte per byte. -// when you fread if, you'll get *allways* "gdcm" +// when you fread it, you'll get *always* "gdcm" // whatever the processor indianess is ! int swap = 0; @@ -197,6 +197,7 @@ int TestFile::ComputeSwapCode(uint32_t tag) } tag >>= 8; } + //std::cout << std::hex << "0x(" << tag << ")" << std::dec << tag << std::endl; return swap; } @@ -260,6 +261,7 @@ bool TestFile::ReadFileHeader(std::ifstream *fp) SwapCode = ComputeSwapCode(tag); if( SwapCode == 0 ) { + // We shall *never* come here! std::cout << "TestFile: Bad tag - Must be 'gdcm'" << std::endl; return(false); } @@ -282,15 +284,17 @@ bool TestFile::ReadFileData(std::ifstream *fp) if( !Data ) return(false); - // Read data + // Read data Note : .tst images are *always* created + // on little endian processor ! fp->read((char *)Data,GetDataSize()); // Track BigEndian troubles std::cout << " ScalarSize : " << GetScalarSize() - << " SwapCode:" << GetSwapCode() + << " IsCurrentProcessorBigEndian:" + << gdcm::Util::IsCurrentProcessorBigEndian() << std::endl; - //if (GetScalarSize() == 1 || GetSwapCode() == 1234) + //if (GetScalarSize() == 1 || GetSwapCode() == 1234) if (GetScalarSize() == 1 || !gdcm::Util::IsCurrentProcessorBigEndian() ) { return true;