X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FTestAllReadCompareDicom.cxx;h=5d08ea35740eac6483365f0e6819b3ab63608e5a;hb=HEAD;hp=6819123c71bbbfae56ca4636e7a30771032949b8;hpb=a62b5eb4984601395f2e1296045bacd693ef860d;p=gdcm.git diff --git a/Testing/TestAllReadCompareDicom.cxx b/Testing/TestAllReadCompareDicom.cxx index 6819123c..5d08ea35 100644 --- a/Testing/TestAllReadCompareDicom.cxx +++ b/Testing/TestAllReadCompareDicom.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestAllReadCompareDicom.cxx,v $ Language: C++ - Date: $Date: 2007/06/21 14:59:05 $ - Version: $Revision: 1.60 $ + Date: $Date: 2008/09/15 15:49:21 $ + Version: $Revision: 1.62 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -542,7 +542,9 @@ int InternalTest(std::string const &filename, } // Test the data size - if (testedDataSize != referenceDataSize) + // *actual* image length may differ to 1 with Pixel Data Element length! + if ((testedDataSize+testedDataSize%2) != + (referenceDataSize+referenceDataSize%2) ) { std::cout << " Failed" << std::endl << " pixel (" @@ -553,7 +555,8 @@ int InternalTest(std::string const &filename, << " Image size: (" << tested->GetFile()->GetXSize() << "," << tested->GetFile()->GetYSize() << "," - << tested->GetFile()->GetZSize() << ")" + << tested->GetFile()->GetZSize() << ") nb of scalar components " + << tested->GetFile()->GetNumberOfScalarComponents() << std::endl; tested->Delete(); delete reference; @@ -562,8 +565,14 @@ int InternalTest(std::string const &filename, } // Test the data content + int length = tested->GetFile()->GetXSize()*tested->GetFile()->GetYSize()*tested->GetFile()->GetZSize() + *reference->GetScalarSize()*tested->GetFile()->GetNumberOfScalarComponents(); + + // *actual* image length may differ to 1 with Pixel Data Element length! + if (length != testedDataSize) + std::cout <<"--------------------length " << length << " != testedDataSize " << testedDataSize << std::endl; if ( memcmp(testedImageData, referenceImageData, - testedDataSize) != 0 ) + length/*testedDataSize*/) != 0 ) { std::string ts = tested->GetFile()->GetTransferSyntax(); @@ -679,7 +688,7 @@ GDCM_NAME_SPACE::Debug::WarningOn(); } //if (gdcmDataImages[i] == "D_CLUNIE_CT2_RLE.dcm") -// gdcm::Debug::DebugOn(); // track pb on BigEndian Proc +// GDCM_NAME_SPACE::Debug::DebugOn(); // track pb on BigEndian Proc //else GDCM_NAME_SPACE::Debug::DebugOff();