comparison Plugins/DicomWeb/Run.py @ 346:a56cbcbacfde

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 19 Oct 2020 19:18:13 +0200
parents 4d3b797aa5ae
children 79ce0f7a9714
comparison
equal deleted inserted replaced
345:4d3b797aa5ae 346:a56cbcbacfde
1377 self.assertTrue(ImageChops.difference(im2, im4).getbbox() is None) 1377 self.assertTrue(ImageChops.difference(im2, im4).getbbox() is None)
1378 self.assertTrue(ImageChops.difference(im2, im6).getbbox() is None) 1378 self.assertTrue(ImageChops.difference(im2, im6).getbbox() is None)
1379 self.assertTrue(ImageChops.difference(im3, im5).getbbox() is None) 1379 self.assertTrue(ImageChops.difference(im3, im5).getbbox() is None)
1380 self.assertTrue(ImageChops.difference(im4, im6).getbbox() is None) 1380 self.assertTrue(ImageChops.difference(im4, im6).getbbox() is None)
1381 1381
1382 # Tolerance of just 1 pixel of difference (needed on Windows)
1383 #print(im2.getpixel((238,275))) # => 255
1384 #print(truth.getpixel((238,275))) # => 254
1385 bbox = ImageChops.difference(im2, truth).getbbox() 1382 bbox = ImageChops.difference(im2, truth).getbbox()
1386 self.assertLessEqual(abs(bbox[2] - bbox[0]), 1) 1383 if bbox != None:
1387 self.assertLessEqual(abs(bbox[3] - bbox[1]), 1) 1384 # Tolerance of just 1 pixel of difference (needed on Windows)
1385 #print(im2.getpixel((238,275))) # => 255
1386 #print(truth.getpixel((238,275))) # => 254
1387 self.assertLessEqual(abs(bbox[2] - bbox[0]), 1)
1388 self.assertLessEqual(abs(bbox[3] - bbox[1]), 1)
1388 1389
1389 1390
1390 try: 1391 try:
1391 print('\nStarting the tests...') 1392 print('\nStarting the tests...')
1392 unittest.main(argv = [ sys.argv[0] ] + args.options) 1393 unittest.main(argv = [ sys.argv[0] ] + args.options)