changeset 531:8a920ab91cf4

YBR_FULL RLE
author Alain Mazy <am@osimis.io>
date Fri, 21 Apr 2023 10:35:41 +0200
parents 937bee4a2fe3
children f96c023ce523
files Database/2023-04-21-RLEPlanarConfigurationYBR_FULL.dcm Tests/Tests.py
diffstat 2 files changed, 20 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
Binary file Database/2023-04-21-RLEPlanarConfigurationYBR_FULL.dcm has changed
--- a/Tests/Tests.py	Tue Apr 18 17:14:01 2023 +0200
+++ b/Tests/Tests.py	Fri Apr 21 10:35:41 2023 +0200
@@ -9231,15 +9231,26 @@
             DropOrthanc(_LOCAL)        
 
     def test_rle_planar_configuration(self):
-        # This test failed in Orthanc <= 1.11.2
-        # https://groups.google.com/g/orthanc-users/c/CSVWfRasSR0/m/y1XDRXVnAgAJ
-        a = UploadInstance(_REMOTE, '2022-11-14-RLEPlanarConfiguration.dcm') ['ID']
-        uri = '/instances/%s/preview' % a
-        im = GetImage(_REMOTE, uri)
-        self.assertEqual('RGB', im.mode)
-        self.assertEqual(1475, im.size[0])
-        self.assertEqual(1475, im.size[1])
-        self.assertEqual('c684b0050dc2523041240bf2d26dc85e', ComputeMD5(DoGet(_REMOTE, uri)))
+        if IsOrthancVersionAbove(_REMOTE, 1, 11, 2):
+            # https://groups.google.com/g/orthanc-users/c/CSVWfRasSR0/m/y1XDRXVnAgAJ
+            a = UploadInstance(_REMOTE, '2022-11-14-RLEPlanarConfiguration.dcm') ['ID']
+            uri = '/instances/%s/preview' % a
+            im = GetImage(_REMOTE, uri)
+            self.assertEqual('RGB', im.mode)
+            self.assertEqual(1475, im.size[0])
+            self.assertEqual(1475, im.size[1])
+            self.assertEqual('c684b0050dc2523041240bf2d26dc85e', ComputeMD5(DoGet(_REMOTE, uri)))
+
+        if IsOrthancVersionAbove(_REMOTE, 1, 12, 1):
+            a = UploadInstance(_REMOTE, '2023-04-21-RLEPlanarConfigurationYBR_FULL.dcm') ['ID']
+            uri = '/instances/%s/preview' % a
+            im = GetImage(_REMOTE, uri)
+            pprint.pprint(im)
+            self.assertEqual('RGB', im.mode)
+            self.assertEqual(1260, im.size[0])
+            self.assertEqual(910, im.size[1])
+            self.assertEqual('07a3ea7ea08d54362f744cc5945e8743', ComputeMD5(DoGet(_REMOTE, uri)))
+
 
     def test_rest_api_write_to_file_system(self):
         if IsOrthancVersionAbove(_REMOTE, 1, 12, 0):