X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=gdcmPython%2FtestSuite.py;h=cbde0e9bd9b08632ec2b48613e08fbf4b3cdf8fd;hb=b9871dd9dcecf2d8894fa617f963025bf8f638cc;hp=29d5987c6968932c4273ee81702f736266db6e50;hpb=2fde1103e77a2448cce41d061781d0ec89ef239b;p=gdcm.git diff --git a/gdcmPython/testSuite.py b/gdcmPython/testSuite.py index 29d5987c..cbde0e9b 100644 --- a/gdcmPython/testSuite.py +++ b/gdcmPython/testSuite.py @@ -514,29 +514,33 @@ class gdcmTestCase(unittest.TestCase): # at 9f8 : fragment length 212866 x(00033f82) # at 3497e : ItemTag b00c,0eb6 (should be fffe,e000 or fffe,e0dd): -# ["gdcm-JPEG-LossLessThoravision.dcm", -# # Interest: - Jpeg compression [Lossless, hierar., first-order -# # pred. 14, Select. Val. 1] -# # - encoding is sligthly different from LossLess3a.dcm ??? -# [ ["Transfer Syntax UID", "1.2.840.10008.1.2.4.70"], -# ["Modality", "CR"], -# ["Photometric Interpretation", "MONOCHROME2"], -# ["Rows", "2076"], -# ["Columns", "1876"], -# ["Bits Stored", "15"], -# ["Bits Allocated", "16"], -# ["High Bit", "14"], -# ["Pixel Representation", "0"], -# ["Manufacturer", "Philips Medical Systems"], -# ["Manufacturer's Model Name", "Cassette Holder Type 9840 500 35201"], -# ["Pixel Data", "gdcm::NotLoaded. Address:3144 Length:4795668"] ] ], + ["gdcm-JPEG-LossLessThoravision.dcm", + # Interest: - Jpeg compression [Lossless, hierar., first-order + # pred. 14, Select. Val. 1] + # - encoding is sligthly different from LossLess3a.dcm ??? + [ ["Transfer Syntax UID", "1.2.840.10008.1.2.4.70"], + ["Modality", "CR"], + ["Photometric Interpretation", "MONOCHROME2"], + ["Rows", "2076"], + ["Columns", "1876"], + ["Bits Stored", "15"], + ["Bits Allocated", "16"], + ["High Bit", "14"], + ["Pixel Representation", "0"], + ["Manufacturer", "Philips Medical Systems"], + ["Manufacturer's Model Name", "Cassette Holder Type 9840 500 35201"], + ["Pixel Data", "gdcm::NotLoaded. Address:3144 Length:4795668 x(492d14)"] + ] ], ] def _BaseTest(self, FileSet): for entry in FileSet: fileName = os.path.join(GDCM_TEST_DATA_PATH, entry[0]) - toRead = gdcmHeader(fileName) - valDict = toRead.GetPubElVal() + reader = gdcmHeader(fileName) + assert reader.IsReadable(),\ + "File '%s' is not readable by gdcmHeader" % fileName + + valDict = reader.GetEntry() for subEntry in entry[1]: element = subEntry[0] value = subEntry[1] @@ -544,7 +548,6 @@ class gdcmTestCase(unittest.TestCase): ("Wrong %s for file %s (got %s, shoud be %s)" % (element,fileName, valDict[element], value)) ) - def testBarre(self): gdcmTestCase._BaseTest(self, gdcmTestCase.BarreFiles) @@ -565,8 +568,8 @@ class gdcmTestCase(unittest.TestCase): Source.GetImageData() TargetFileName = "junk" Target = Source.WriteDcmImplVR(TargetFileName) - # Sign = 'c3d27238647b7eaa773bff6ea0692b54' # old signature in the file - Sign = 'a1e2abdc2f6abedd86b93c8b88db5203' # new signature (found on Win) +# Sign = 'a1e2abdc2f6abedd86b93c8b88db5203' # new signature (found on Win) + Sign = '849e722e004d3bb37b87ab6006509b8f' # new signature without field strip ComputeSign = md5.new(open(TargetFileName).read()).hexdigest() self.assertEqual(ComputeSign, Sign, ("Wrong signature for file %s (got %s, shoud be %s)"