changeset 5:19eb87a45685

test_images
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 17 Jun 2015 10:42:24 +0200
parents 292a46fe374c
children 6d645b3011e1
files Database/Brainix/Flair/IM-0001-0001.dcm Database/Brainix/Flair/IM-0001-0002.dcm Database/Brainix/Flair/IM-0001-0003.dcm Database/Brainix/Flair/IM-0001-0004.dcm Database/Brainix/Flair/IM-0001-0005.dcm Database/Brainix/Flair/IM-0001-0006.dcm Database/Brainix/Flair/IM-0001-0007.dcm Database/Brainix/Flair/IM-0001-0008.dcm Database/Brainix/Flair/IM-0001-0009.dcm Database/Brainix/Flair/IM-0001-0010.dcm Database/Brainix/Flair/IM-0001-0011.dcm Database/Brainix/Flair/IM-0001-0012.dcm Database/Brainix/Flair/IM-0001-0013.dcm Database/Brainix/Flair/IM-0001-0014.dcm Database/Brainix/Flair/IM-0001-0015.dcm Database/Brainix/Flair/IM-0001-0016.dcm Database/Brainix/Flair/IM-0001-0017.dcm Database/Brainix/Flair/IM-0001-0018.dcm Database/Brainix/Flair/IM-0001-0019.dcm Database/Brainix/Flair/IM-0001-0020.dcm Database/Brainix/Flair/IM-0001-0021.dcm Database/Brainix/Flair/IM-0001-0022.dcm Database/Phenix/IM-0001-0001.dcm Database/README.txt Tests/Run.py Tests/Tests.py
diffstat 26 files changed, 48 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
Binary file Database/Brainix/Flair/IM-0001-0001.dcm has changed
Binary file Database/Brainix/Flair/IM-0001-0002.dcm has changed
Binary file Database/Brainix/Flair/IM-0001-0003.dcm has changed
Binary file Database/Brainix/Flair/IM-0001-0004.dcm has changed
Binary file Database/Brainix/Flair/IM-0001-0005.dcm has changed
Binary file Database/Brainix/Flair/IM-0001-0006.dcm has changed
Binary file Database/Brainix/Flair/IM-0001-0007.dcm has changed
Binary file Database/Brainix/Flair/IM-0001-0008.dcm has changed
Binary file Database/Brainix/Flair/IM-0001-0009.dcm has changed
Binary file Database/Brainix/Flair/IM-0001-0010.dcm has changed
Binary file Database/Brainix/Flair/IM-0001-0011.dcm has changed
Binary file Database/Brainix/Flair/IM-0001-0012.dcm has changed
Binary file Database/Brainix/Flair/IM-0001-0013.dcm has changed
Binary file Database/Brainix/Flair/IM-0001-0014.dcm has changed
Binary file Database/Brainix/Flair/IM-0001-0015.dcm has changed
Binary file Database/Brainix/Flair/IM-0001-0016.dcm has changed
Binary file Database/Brainix/Flair/IM-0001-0017.dcm has changed
Binary file Database/Brainix/Flair/IM-0001-0018.dcm has changed
Binary file Database/Brainix/Flair/IM-0001-0019.dcm has changed
Binary file Database/Brainix/Flair/IM-0001-0020.dcm has changed
Binary file Database/Brainix/Flair/IM-0001-0021.dcm has changed
Binary file Database/Brainix/Flair/IM-0001-0022.dcm has changed
Binary file Database/Phenix/IM-0001-0001.dcm has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Database/README.txt	Wed Jun 17 10:42:24 2015 +0200
@@ -0,0 +1,14 @@
+=========================
+Source of the test images
+=========================
+
+Many of the images that are used by the integration tests of Orthanc
+come from the OsiriX samples available at:
+http://www.osirix-viewer.com/datasets/
+
+Other images were posted by external contributors or generated
+manually. Here is the source of each set of sample images:
+
+- Brainix/* : From OsiriX, "BRAINIX".
+- DummyCT.dcm : From Osirix, "KNEE" with PixelData removed.
+- Phenix/* : From OsiriX, "PHENIX"
--- a/Tests/Run.py	Wed Jun 17 10:05:27 2015 +0200
+++ b/Tests/Run.py	Wed Jun 17 10:42:24 2015 +0200
@@ -25,8 +25,8 @@
 import unittest
 import pprint
 
-from Toolbox import *
 from Tests import *
+from Toolbox import DoGet
 
 
 ##
@@ -123,7 +123,7 @@
 try:
     print('\nStarting the tests...')
     SetOrthancParameters(LOCAL, REMOTE)
-    unittest.main(argv = [ sys.argv[0] ]) #argv = args)
+    unittest.main(argv = [ sys.argv[0] ])
 
 finally:
     print('\nDone')
--- a/Tests/Tests.py	Wed Jun 17 10:05:27 2015 +0200
+++ b/Tests/Tests.py	Wed Jun 17 10:42:24 2015 +0200
@@ -54,7 +54,7 @@
         self.assertEqual('20070101', i['StudyDate'])
 
 
-    def test_rest_grid(self):
+    def test_upload_2(self):
         i = UploadInstance(_REMOTE, 'DummyCT.dcm')['ID']
         instance = DoGet(_REMOTE, '/instances/%s' % i)
         self.assertEqual(i, instance['ID'])
@@ -81,4 +81,35 @@
         self.assertEqual('TWINOW', DoGet(_REMOTE, '/instances/%s/tags' % i)['0008,1010']['Value'])
 
 
+    def test_images(self):
+        i = UploadInstance(_REMOTE, 'Phenix/IM-0001-0001.dcm')['ID']
+        self.assertEqual(1, len(DoGet(_REMOTE, '/instances/%s/frames' % i)))
 
+        im = GetImage(_REMOTE, '/instances/%s/preview' % i)
+        self.assertEqual("L", im.mode)
+        self.assertEqual(512, im.size[0])
+        self.assertEqual(358, im.size[1])
+
+        im = GetImage(_REMOTE, '/instances/%s/image-uint8' % i)
+        self.assertEqual("L", im.mode)
+        self.assertEqual(512, im.size[0])
+        self.assertEqual(358, im.size[1])
+
+        im = GetImage(_REMOTE, '/instances/%s/image-uint16' % i)
+        self.assertEqual(512, im.size[0])
+        self.assertEqual(358, im.size[1])
+
+        im = GetImage(_REMOTE, '/instances/%s/frames/0/preview' % i)
+        self.assertEqual("L", im.mode)
+        self.assertEqual(512, im.size[0])
+        self.assertEqual(358, im.size[1])
+
+        im = GetImage(_REMOTE, '/instances/%s/frames/0/image-uint8' % i)
+        self.assertEqual("L", im.mode)
+        self.assertEqual(512, im.size[0])
+        self.assertEqual(358, im.size[1])
+
+        im = GetImage(_REMOTE, '/instances/%s/frames/0/image-uint16' % i)
+        self.assertEqual(512, im.size[0])
+        self.assertEqual(358, im.size[1])
+