Mercurial > hg > orthanc-tests
annotate Plugins/WSI/Run.py @ 579:5d157c486568
fix auth test startup sequence
author | Alain Mazy <am@osimis.io> |
---|---|
date | Mon, 11 Sep 2023 09:04:17 +0200 |
parents | e6cee85fe421 |
children | 8aa101e126d0 |
rev | line source |
---|---|
251 | 1 #!/usr/bin/python |
2 # -*- coding: utf-8 -*- | |
3 | |
4 | |
5 # Orthanc - A Lightweight, RESTful DICOM Store | |
6 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
7 # Department, University Hospital of Liege, Belgium | |
511
933fe1bbce4f
upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
460
diff
changeset
|
8 # Copyright (C) 2017-2023 Osimis S.A., Belgium |
933fe1bbce4f
upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
460
diff
changeset
|
9 # Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
251 | 10 # |
11 # This program is free software: you can redistribute it and/or | |
12 # modify it under the terms of the GNU General Public License as | |
13 # published by the Free Software Foundation, either version 3 of the | |
14 # License, or (at your option) any later version. | |
15 # | |
16 # This program is distributed in the hope that it will be useful, but | |
17 # WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
19 # General Public License for more details. | |
20 # | |
21 # You should have received a copy of the GNU General Public License | |
22 # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
23 | |
24 | |
25 import argparse | |
26 import os | |
27 import pprint | |
28 import re | |
29 import subprocess | |
30 import sys | |
31 import tempfile | |
32 import unittest | |
33 from shutil import copyfile | |
34 | |
35 sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'Tests')) | |
36 from Toolbox import * | |
37 | |
38 | |
39 ## | |
40 ## Parse the command-line arguments | |
41 ## | |
42 | |
43 parser = argparse.ArgumentParser(description = 'Run the integration tests for the WSI Dicomizer.') | |
44 | |
45 parser.add_argument('--server', | |
46 default = 'localhost', | |
47 help = 'Address of the Orthanc server to test') | |
48 parser.add_argument('--rest', | |
49 type = int, | |
50 default = 8042, | |
51 help = 'Port to the REST API') | |
52 parser.add_argument('--username', | |
53 default = 'alice', | |
54 help = 'Username to the REST API') | |
55 parser.add_argument('--password', | |
56 default = 'orthanctest', | |
57 help = 'Password to the REST API') | |
58 parser.add_argument('--dicomizer', | |
568
6399d3a1cd30
WSI: fix compatibility with Python 3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
567
diff
changeset
|
59 default = os.path.join(os.environ['HOME'], 'Subversion/orthanc-wsi/Applications/i/OrthancWSIDicomizer'), |
251 | 60 help = 'Password to the REST API') |
61 parser.add_argument('--to-tiff', | |
568
6399d3a1cd30
WSI: fix compatibility with Python 3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
567
diff
changeset
|
62 default = os.path.join(os.environ['HOME'], 'Subversion/orthanc-wsi/Applications/i/OrthancWSIDicomToTiff'), |
251 | 63 help = 'Password to the REST API') |
252 | 64 parser.add_argument('--valgrind', help = 'Use valgrind while running the DICOM-izer', |
65 action = 'store_true') | |
251 | 66 parser.add_argument('--force', help = 'Do not warn the user', |
67 action = 'store_true') | |
68 parser.add_argument('options', metavar = 'N', nargs = '*', | |
69 help='Arguments to Python unittest') | |
70 | |
71 args = parser.parse_args() | |
72 | |
73 if not args.force: | |
74 print(""" | |
75 WARNING: This test will remove all the content of your | |
76 Orthanc instance running on %s! | |
77 | |
78 Are you sure ["yes" to go on]?""" % args.server) | |
79 | |
80 if sys.stdin.readline().strip() != 'yes': | |
81 print('Aborting...') | |
82 exit(0) | |
83 | |
84 | |
85 | |
86 | |
87 ## | |
88 ## The tests | |
89 ## | |
90 | |
91 ORTHANC = DefineOrthanc(server = args.server, | |
92 username = args.username, | |
93 password = args.password, | |
94 restPort = args.rest) | |
95 | |
253 | 96 def CallCommand(command): |
252 | 97 prefix = [] |
98 if args.valgrind: | |
99 prefix = [ 'valgrind' ] | |
100 | |
253 | 101 log = subprocess.check_output(prefix + command, |
252 | 102 stderr=subprocess.STDOUT) |
571 | 103 |
104 if sys.version_info >= (3, 0): | |
105 log = log.decode('ascii') | |
106 | |
252 | 107 # If using valgrind, only print the lines from the log starting |
108 # with '==' (they contain the report from valgrind) | |
109 if args.valgrind: | |
110 print('\n'.join(filter(lambda x: x.startswith('=='), log.splitlines()))) | |
251 | 111 |
253 | 112 |
113 def CallDicomizer(suffix): | |
114 CallCommand([ args.dicomizer, | |
460 | 115 '--orthanc=http://%s:%s' % (args.server, args.rest), |
253 | 116 '--username=%s' % args.username, |
459 | 117 '--password=%s' % args.password ] + suffix |
118 ) | |
253 | 119 |
120 | |
121 def CallDicomToTiff(suffix): | |
316 | 122 CallCommand([ args.to_tiff, |
460 | 123 '--orthanc=http://%s:%s' % (args.server, args.rest), |
316 | 124 '--username=%s' % args.username, |
125 '--password=%s' % args.password ] + suffix) | |
253 | 126 |
127 | |
128 def CallTiffInfoOnSeries(series): | |
129 with tempfile.NamedTemporaryFile(delete = False) as temp: | |
130 temp.close() | |
131 CallDicomToTiff([ series, temp.name ]) | |
316 | 132 try: |
133 tiff = subprocess.check_output([ 'tiffinfo', temp.name ]) | |
134 except: | |
135 print('\ntiffinfo is probably not installed => sudo apt-get install libtiff-tools\n') | |
136 tiff = None | |
568
6399d3a1cd30
WSI: fix compatibility with Python 3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
567
diff
changeset
|
137 |
6399d3a1cd30
WSI: fix compatibility with Python 3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
567
diff
changeset
|
138 if (tiff != None and sys.version_info >= (3, 0)): |
6399d3a1cd30
WSI: fix compatibility with Python 3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
567
diff
changeset
|
139 tiff = tiff.decode('ascii') |
316 | 140 |
253 | 141 os.unlink(temp.name) |
142 | |
143 return tiff | |
144 | |
251 | 145 |
146 class Orthanc(unittest.TestCase): | |
147 def setUp(self): | |
148 if (sys.version_info >= (3, 0)): | |
149 # Remove annoying warnings about unclosed socket in Python 3 | |
150 import warnings | |
151 warnings.simplefilter("ignore", ResourceWarning) | |
152 | |
153 DropOrthanc(ORTHANC) | |
154 | |
155 | |
156 def test_single(self): | |
157 CallDicomizer([ GetDatabasePath('Lena.jpg') ]) | |
158 | |
159 i = DoGet(ORTHANC, '/instances') | |
160 self.assertEqual(1, len(i)) | |
161 | |
162 tags = DoGet(ORTHANC, '/instances/%s/tags?simplify' % i[0]) | |
163 self.assertEqual(1, int(tags['NumberOfFrames'])) | |
164 self.assertEqual(512, int(tags['Columns'])) | |
165 self.assertEqual(512, int(tags['Rows'])) | |
166 self.assertEqual('YBR_FULL_422', tags['PhotometricInterpretation']) | |
167 | |
168 s = DoGet(ORTHANC, '/series') | |
169 self.assertEqual(1, len(s)) | |
170 | |
171 pyramid = DoGet(ORTHANC, '/wsi/pyramids/%s' % s[0]) | |
172 self.assertEqual(s[0], pyramid['ID']) | |
173 self.assertEqual(1, len(pyramid['Resolutions'])) | |
174 self.assertEqual(1, len(pyramid['Sizes'])) | |
175 self.assertEqual(1, len(pyramid['TilesCount'])) | |
176 self.assertEqual(1, pyramid['Resolutions'][0]) | |
177 self.assertEqual(512, pyramid['Sizes'][0][0]) | |
178 self.assertEqual(512, pyramid['Sizes'][0][1]) | |
364
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
179 self.assertEqual(1, len(pyramid['TilesSizes'])) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
180 self.assertEqual(2, len(pyramid['TilesSizes'][0])) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
181 self.assertEqual(512, pyramid['TilesSizes'][0][0]) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
182 self.assertEqual(512, pyramid['TilesSizes'][0][1]) |
251 | 183 self.assertEqual(512, pyramid['TotalWidth']) |
184 self.assertEqual(512, pyramid['TotalHeight']) | |
185 self.assertEqual(1, pyramid['TilesCount'][0][0]) | |
186 self.assertEqual(1, pyramid['TilesCount'][0][1]) | |
187 | |
253 | 188 tiff = CallTiffInfoOnSeries(s[0]) |
568
6399d3a1cd30
WSI: fix compatibility with Python 3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
567
diff
changeset
|
189 p = list(filter(lambda x: 'Photometric Interpretation' in x, tiff.splitlines())) |
253 | 190 self.assertEqual(1, len(p)) |
191 self.assertTrue('YCbCr' in p[0]) | |
192 | |
251 | 193 |
194 def test_grayscale_pyramid(self): | |
195 CallDicomizer([ GetDatabasePath('LenaGrayscale.png'), '--tile-width=64', '--tile-height=64' ]) | |
196 | |
197 i = DoGet(ORTHANC, '/instances') | |
198 self.assertEqual(4, len(i)) | |
199 | |
200 for j in range(4): | |
201 tags = DoGet(ORTHANC, '/instances/%s/tags?simplify' % i[j]) | |
202 self.assertEqual(64, int(tags['Columns'])) | |
203 self.assertEqual(64, int(tags['Rows'])) | |
204 self.assertEqual('MONOCHROME2', tags['PhotometricInterpretation']) | |
205 | |
206 s = DoGet(ORTHANC, '/series') | |
207 self.assertEqual(1, len(s)) | |
208 | |
209 pyramid = DoGet(ORTHANC, '/wsi/pyramids/%s' % s[0]) | |
210 self.assertEqual(s[0], pyramid['ID']) | |
211 self.assertEqual(4, len(pyramid['Resolutions'])) | |
212 self.assertEqual(4, len(pyramid['Sizes'])) | |
213 self.assertEqual(4, len(pyramid['TilesCount'])) | |
364
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
214 self.assertEqual(4, len(pyramid['TilesSizes'])) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
215 |
251 | 216 self.assertEqual(1, pyramid['Resolutions'][0]) |
217 self.assertEqual(2, pyramid['Resolutions'][1]) | |
218 self.assertEqual(4, pyramid['Resolutions'][2]) | |
219 self.assertEqual(8, pyramid['Resolutions'][3]) | |
220 self.assertEqual(512, pyramid['Sizes'][0][0]) | |
221 self.assertEqual(512, pyramid['Sizes'][0][1]) | |
222 self.assertEqual(256, pyramid['Sizes'][1][0]) | |
223 self.assertEqual(256, pyramid['Sizes'][1][1]) | |
224 self.assertEqual(128, pyramid['Sizes'][2][0]) | |
225 self.assertEqual(128, pyramid['Sizes'][2][1]) | |
226 self.assertEqual(64, pyramid['Sizes'][3][0]) | |
227 self.assertEqual(64, pyramid['Sizes'][3][1]) | |
364
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
228 for i in range(4): |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
229 self.assertEqual(2, len(pyramid['TilesSizes'][i])) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
230 self.assertEqual(64, pyramid['TilesSizes'][i][0]) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
231 self.assertEqual(64, pyramid['TilesSizes'][i][1]) |
251 | 232 self.assertEqual(512, pyramid['TotalWidth']) |
233 self.assertEqual(512, pyramid['TotalHeight']) | |
234 self.assertEqual(8, pyramid['TilesCount'][0][0]) | |
235 self.assertEqual(8, pyramid['TilesCount'][0][1]) | |
236 self.assertEqual(4, pyramid['TilesCount'][1][0]) | |
237 self.assertEqual(4, pyramid['TilesCount'][1][1]) | |
238 self.assertEqual(2, pyramid['TilesCount'][2][0]) | |
239 self.assertEqual(2, pyramid['TilesCount'][2][1]) | |
240 self.assertEqual(1, pyramid['TilesCount'][3][0]) | |
241 self.assertEqual(1, pyramid['TilesCount'][3][1]) | |
253 | 242 |
243 tiff = CallTiffInfoOnSeries(s[0]) | |
568
6399d3a1cd30
WSI: fix compatibility with Python 3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
567
diff
changeset
|
244 p = list(filter(lambda x: 'Photometric Interpretation' in x, tiff.splitlines())) |
253 | 245 self.assertEqual(4, len(p)) |
246 for j in range(4): | |
247 self.assertTrue('min-is-black' in p[j]) | |
248 | |
249 | |
250 def test_import_tiff_grayscale(self): | |
251 CallDicomizer([ GetDatabasePath('WSI/LenaGrayscaleJpeg.tiff') ]) | |
252 | |
253 s = DoGet(ORTHANC, '/series') | |
254 self.assertEqual(1, len(s)) | |
255 | |
256 pyramid = DoGet(ORTHANC, '/wsi/pyramids/%s' % s[0]) | |
257 self.assertEqual(4, len(pyramid['Resolutions'])) | |
258 | |
259 tiff = CallTiffInfoOnSeries(s[0]) | |
568
6399d3a1cd30
WSI: fix compatibility with Python 3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
567
diff
changeset
|
260 p = list(filter(lambda x: 'Photometric Interpretation' in x, tiff.splitlines())) |
253 | 261 self.assertEqual(4, len(p)) |
262 for j in range(4): | |
263 self.assertTrue('min-is-black' in p[j]) | |
264 | |
265 | |
266 def test_import_tiff_ycbcr(self): | |
267 CallDicomizer([ GetDatabasePath('WSI/LenaColorJpegYCbCr.tiff') ]) | |
268 | |
269 s = DoGet(ORTHANC, '/series') | |
270 self.assertEqual(1, len(s)) | |
271 | |
272 pyramid = DoGet(ORTHANC, '/wsi/pyramids/%s' % s[0]) | |
273 self.assertEqual(4, len(pyramid['Resolutions'])) | |
274 | |
275 tiff = CallTiffInfoOnSeries(s[0]) | |
568
6399d3a1cd30
WSI: fix compatibility with Python 3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
567
diff
changeset
|
276 p = list(filter(lambda x: 'Photometric Interpretation' in x, tiff.splitlines())) |
253 | 277 self.assertEqual(4, len(p)) |
278 for j in range(4): | |
279 self.assertTrue('YCbCr' in p[j]) | |
280 | |
281 | |
282 def test_import_tiff_rgb(self): | |
283 CallDicomizer([ GetDatabasePath('WSI/LenaColorJpegRGB.tiff') ]) | |
284 | |
285 s = DoGet(ORTHANC, '/series') | |
286 self.assertEqual(1, len(s)) | |
287 | |
288 pyramid = DoGet(ORTHANC, '/wsi/pyramids/%s' % s[0]) | |
289 self.assertEqual(4, len(pyramid['Resolutions'])) | |
290 | |
291 tiff = CallTiffInfoOnSeries(s[0]) | |
568
6399d3a1cd30
WSI: fix compatibility with Python 3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
567
diff
changeset
|
292 p = list(filter(lambda x: 'Photometric Interpretation' in x, tiff.splitlines())) |
253 | 293 self.assertEqual(4, len(p)) |
294 for j in range(4): | |
295 self.assertTrue('RGB' in p[j]) | |
296 | |
364
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
297 |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
298 def test_concatenation(self): |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
299 # https://bugs.orthanc-server.com/show_bug.cgi?id=145 |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
300 CallDicomizer([ GetDatabasePath('LenaGrayscale.png'), '--levels=1', ]) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
301 i = DoGet(ORTHANC, '/instances') |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
302 self.assertEqual(1, len(i)) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
303 tags = DoGet(ORTHANC, '/instances/%s/tags?short' % i[0]) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
304 self.assertTrue('0020,0242' in tags) # SOP Instance UID of Concatenation Source |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
305 self.assertTrue('0020,9161' in tags) # Concatenation UID |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
306 self.assertTrue('0020,9162' in tags) # In-concatenation Number |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
307 self.assertTrue('0020,9228' in tags) # Concatenation Frame Offset Number |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
308 self.assertEqual('1', tags['0020,9162']) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
309 self.assertEqual('0', tags['0020,9228']) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
310 |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
311 DropOrthanc(ORTHANC) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
312 |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
313 # "--max-size" disables the concatenation |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
314 CallDicomizer([ GetDatabasePath('LenaGrayscale.png'), '--levels=1', '--max-size=0' ]) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
315 i = DoGet(ORTHANC, '/instances') |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
316 self.assertEqual(1, len(i)) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
317 tags = DoGet(ORTHANC, '/instances/%s/tags?short' % i[0]) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
318 self.assertFalse('0020,0242' in tags) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
319 self.assertFalse('0020,9161' in tags) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
320 self.assertFalse('0020,9162' in tags) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
321 self.assertFalse('0020,9228' in tags) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
322 |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
323 DropOrthanc(ORTHANC) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
324 |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
325 # This creates a series with 2 instances of roughly 1.5MB (= 2 frames x 512 x 512 x 3 (RGB24) + DICOM overhead) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
326 CallDicomizer([ GetDatabasePath('WSI/Lena2x2.png'), '--levels=1', '--max-size=1', '--compression=none' ]) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
327 i = DoGet(ORTHANC, '/instances') |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
328 self.assertEqual(2, len(i)) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
329 t1 = DoGet(ORTHANC, '/instances/%s/tags?short' % i[0]) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
330 t2 = DoGet(ORTHANC, '/instances/%s/tags?short' % i[1]) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
331 self.assertTrue('0020,0242' in t1) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
332 self.assertTrue('0020,9161' in t1) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
333 self.assertTrue('0020,9162' in t1) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
334 self.assertTrue('0020,9228' in t1) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
335 self.assertEqual(t1['0020,0242'], t2['0020,0242']) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
336 self.assertEqual(t1['0020,9161'], t2['0020,9161']) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
337 if t1['0020,9162'] == '1': |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
338 self.assertEqual('1', t1['0020,9162']) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
339 self.assertEqual('0', t1['0020,9228']) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
340 self.assertEqual('2', t2['0020,9162']) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
341 self.assertEqual('2', t2['0020,9228']) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
342 else: |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
343 self.assertEqual('1', t2['0020,9162']) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
344 self.assertEqual('0', t2['0020,9228']) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
345 self.assertEqual('2', t1['0020,9162']) |
6fa8218cf8db
wsi: test_concatenation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
363
diff
changeset
|
346 self.assertEqual('2', t1['0020,9228']) |
365
27cb0b60f2d3
wsi: test_pixel_spacing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
364
diff
changeset
|
347 |
27cb0b60f2d3
wsi: test_pixel_spacing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
364
diff
changeset
|
348 |
27cb0b60f2d3
wsi: test_pixel_spacing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
364
diff
changeset
|
349 def test_pixel_spacing(self): |
27cb0b60f2d3
wsi: test_pixel_spacing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
364
diff
changeset
|
350 # https://bugs.orthanc-server.com/show_bug.cgi?id=139 |
27cb0b60f2d3
wsi: test_pixel_spacing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
364
diff
changeset
|
351 CallDicomizer([ GetDatabasePath('LenaGrayscale.png'), # Image is 512x512 |
27cb0b60f2d3
wsi: test_pixel_spacing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
364
diff
changeset
|
352 '--levels=4', '--tile-width=64', '--tile-height=64', '--max-size=0', |
27cb0b60f2d3
wsi: test_pixel_spacing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
364
diff
changeset
|
353 '--imaged-width=20', '--imaged-height=10' ]) |
27cb0b60f2d3
wsi: test_pixel_spacing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
364
diff
changeset
|
354 |
27cb0b60f2d3
wsi: test_pixel_spacing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
364
diff
changeset
|
355 instances = DoGet(ORTHANC, '/instances') |
27cb0b60f2d3
wsi: test_pixel_spacing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
364
diff
changeset
|
356 self.assertEqual(4, len(instances)) |
27cb0b60f2d3
wsi: test_pixel_spacing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
364
diff
changeset
|
357 |
27cb0b60f2d3
wsi: test_pixel_spacing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
364
diff
changeset
|
358 spacings = {} |
27cb0b60f2d3
wsi: test_pixel_spacing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
364
diff
changeset
|
359 for i in instances: |
27cb0b60f2d3
wsi: test_pixel_spacing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
364
diff
changeset
|
360 t = DoGet(ORTHANC, '/instances/%s/tags?short' % i) |
27cb0b60f2d3
wsi: test_pixel_spacing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
364
diff
changeset
|
361 spacings[t['0028,0008']] = t['5200,9229'][0]['0028,9110'][0]['0028,0030'] |
27cb0b60f2d3
wsi: test_pixel_spacing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
364
diff
changeset
|
362 |
27cb0b60f2d3
wsi: test_pixel_spacing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
364
diff
changeset
|
363 self.assertEqual(4, len(spacings)) |
27cb0b60f2d3
wsi: test_pixel_spacing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
364
diff
changeset
|
364 for i in range(4): |
27cb0b60f2d3
wsi: test_pixel_spacing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
364
diff
changeset
|
365 s = spacings[str(4 ** i)].split('\\') |
27cb0b60f2d3
wsi: test_pixel_spacing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
364
diff
changeset
|
366 self.assertEqual(2, len(s)) |
27cb0b60f2d3
wsi: test_pixel_spacing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
364
diff
changeset
|
367 self.assertEqual(20.0 / 512.0 * (2.0 ** (3 - i)), float(s[0])) |
27cb0b60f2d3
wsi: test_pixel_spacing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
364
diff
changeset
|
368 self.assertEqual(10.0 / 512.0 * (2.0 ** (3 - i)), float(s[1])) |
27cb0b60f2d3
wsi: test_pixel_spacing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
364
diff
changeset
|
369 |
567
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
370 |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
371 def test_http_accept(self): |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
372 # https://discourse.orthanc-server.org/t/orthanc-wsi-image-quality-issue/3331 |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
373 |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
374 def TestTransferSyntax(s, expected): |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
375 instance = DoGet(ORTHANC, '/series/%s' % s[0]) ['Instances'][0] |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
376 self.assertEqual(expected, DoGet(ORTHANC, '/instances/%s/metadata/TransferSyntax' % instance)) |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
377 |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
378 def TestDefaultAccept(s, mime): |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
379 tile = GetImage(ORTHANC, '/wsi/tiles/%s/0/0/0' % s[0]) |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
380 self.assertEqual(mime, tile.format) |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
381 |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
382 tile = GetImage(ORTHANC, '/wsi/tiles/%s/0/0/0' % s[0], { |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
383 'Accept' : 'text/html,*/*' |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
384 }) |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
385 self.assertEqual(mime, tile.format) |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
386 |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
387 tile = GetImage(ORTHANC, '/wsi/tiles/%s/0/0/0' % s[0], { |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
388 'Accept' : 'image/*,text/html' |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
389 }) |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
390 self.assertEqual(mime, tile.format) |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
391 |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
392 tile = DoGetRaw(ORTHANC, '/wsi/tiles/%s/0/0/0' % s[0], headers = { |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
393 'Accept' : 'text/html' |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
394 }) |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
395 self.assertEqual(406, int(tile[0]['status'])) |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
396 |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
397 def TestForceAccept(s): |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
398 tile = GetImage(ORTHANC, '/wsi/tiles/%s/0/0/0' % s[0], { |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
399 'Accept' : 'image/jpeg' |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
400 }) |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
401 self.assertEqual('JPEG', tile.format) |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
402 |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
403 tile = GetImage(ORTHANC, '/wsi/tiles/%s/0/0/0' % s[0], { |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
404 'Accept' : 'image/png' |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
405 }) |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
406 self.assertEqual('PNG', tile.format) |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
407 |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
408 tile = GetImage(ORTHANC, '/wsi/tiles/%s/0/0/0' % s[0], { |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
409 'Accept' : 'image/jp2' |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
410 }) |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
411 self.assertEqual('JPEG2000', tile.format) |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
412 |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
413 |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
414 CallDicomizer([ GetDatabasePath('Lena.jpg') ]) |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
415 |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
416 s = DoGet(ORTHANC, '/series') |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
417 self.assertEqual(1, len(s)) |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
418 TestTransferSyntax(s, '1.2.840.10008.1.2.4.50') |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
419 TestDefaultAccept(s, 'JPEG') |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
420 TestForceAccept(s) |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
421 |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
422 DoDelete(ORTHANC, '/series/%s' % s[0]) |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
423 |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
424 CallDicomizer([ GetDatabasePath('Lena.jpg'), '--compression', 'none' ]) |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
425 s = DoGet(ORTHANC, '/series') |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
426 self.assertEqual(1, len(s)) |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
427 |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
428 TestTransferSyntax(s, '1.2.840.10008.1.2') |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
429 TestDefaultAccept(s, 'PNG') |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
430 TestForceAccept(s) |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
431 |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
432 DoDelete(ORTHANC, '/series/%s' % s[0]) |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
433 |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
434 CallDicomizer([ GetDatabasePath('Lena.jpg'), '--compression', 'jpeg2000' ]) |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
435 s = DoGet(ORTHANC, '/series') |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
436 self.assertEqual(1, len(s)) |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
437 |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
438 TestTransferSyntax(s, '1.2.840.10008.1.2.4.90') |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
439 TestDefaultAccept(s, 'PNG') |
13169c8ddc96
added test_http_accept for WSI
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
511
diff
changeset
|
440 TestForceAccept(s) |
365
27cb0b60f2d3
wsi: test_pixel_spacing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
364
diff
changeset
|
441 |
569
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
442 def test_iiif(self): |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
443 CallDicomizer([ GetDatabasePath('LenaGrayscale.png'), # Image is 512x512 |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
444 '--levels=3', '--tile-width=128', '--tile-height=128' ]) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
445 |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
446 self.assertEqual(3, len(DoGet(ORTHANC, '/instances'))) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
447 |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
448 s = DoGet(ORTHANC, '/series') |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
449 self.assertEqual(1, len(s)) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
450 |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
451 uri = '/wsi/iiif/tiles/%s' % s[0] |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
452 info = DoGet(ORTHANC, '%s/info.json' % uri) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
453 self.assertEqual('http://iiif.io/api/image/3/context.json', info['@context']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
454 self.assertEqual('http://iiif.io/api/image', info['protocol']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
455 self.assertEqual('http://localhost:8042%s' % uri, info['id']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
456 self.assertEqual('level0', info['profile']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
457 self.assertEqual('ImageService3', info['type']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
458 self.assertEqual(512, info['width']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
459 self.assertEqual(512, info['height']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
460 |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
461 self.assertEqual(3, len(info['sizes'])) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
462 self.assertEqual(512, info['sizes'][0]['width']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
463 self.assertEqual(512, info['sizes'][0]['height']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
464 self.assertEqual(256, info['sizes'][1]['width']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
465 self.assertEqual(256, info['sizes'][1]['height']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
466 self.assertEqual(128, info['sizes'][2]['width']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
467 self.assertEqual(128, info['sizes'][2]['height']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
468 |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
469 self.assertEqual(1, len(info['tiles'])) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
470 self.assertEqual(128, info['tiles'][0]['width']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
471 self.assertEqual(128, info['tiles'][0]['height']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
472 self.assertEqual([ 1, 2, 4 ], info['tiles'][0]['scaleFactors']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
473 |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
474 # The list of URIs below was generated by "orthanc-wsi/Resources/TestIIIFTiles.py" |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
475 |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
476 # Level 0 |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
477 GetImage(ORTHANC, '/%s/0,0,128,128/128,128/0/default.jpg' % uri) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
478 GetImage(ORTHANC, '/%s/128,0,128,128/128,128/0/default.jpg' % uri) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
479 GetImage(ORTHANC, '/%s/256,0,128,128/128,128/0/default.jpg' % uri) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
480 GetImage(ORTHANC, '/%s/384,0,128,128/128,128/0/default.jpg' % uri) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
481 GetImage(ORTHANC, '/%s/0,128,128,128/128,128/0/default.jpg' % uri) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
482 GetImage(ORTHANC, '/%s/128,128,128,128/128,128/0/default.jpg' % uri) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
483 GetImage(ORTHANC, '/%s/256,128,128,128/128,128/0/default.jpg' % uri) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
484 GetImage(ORTHANC, '/%s/384,128,128,128/128,128/0/default.jpg' % uri) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
485 GetImage(ORTHANC, '/%s/0,256,128,128/128,128/0/default.jpg' % uri) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
486 GetImage(ORTHANC, '/%s/128,256,128,128/128,128/0/default.jpg' % uri) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
487 GetImage(ORTHANC, '/%s/256,256,128,128/128,128/0/default.jpg' % uri) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
488 GetImage(ORTHANC, '/%s/384,256,128,128/128,128/0/default.jpg' % uri) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
489 GetImage(ORTHANC, '/%s/0,384,128,128/128,128/0/default.jpg' % uri) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
490 GetImage(ORTHANC, '/%s/128,384,128,128/128,128/0/default.jpg' % uri) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
491 GetImage(ORTHANC, '/%s/256,384,128,128/128,128/0/default.jpg' % uri) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
492 GetImage(ORTHANC, '/%s/384,384,128,128/128,128/0/default.jpg' % uri) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
493 |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
494 # Level 1 |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
495 GetImage(ORTHANC, '/%s/0,0,256,256/128,128/0/default.jpg' % uri) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
496 GetImage(ORTHANC, '/%s/256,0,256,256/128,128/0/default.jpg' % uri) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
497 GetImage(ORTHANC, '/%s/0,256,256,256/128,128/0/default.jpg' % uri) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
498 GetImage(ORTHANC, '/%s/256,256,256,256/128,128/0/default.jpg' % uri) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
499 |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
500 # Level 2 |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
501 i = GetImage(ORTHANC, '/%s/0,0,512,512/128,128/0/default.jpg' % uri) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
502 self.assertEqual(128, i.width) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
503 self.assertEqual(128, i.height) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
504 |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
505 uri2 = '/wsi/iiif/series/%s/manifest.json' % s[0] |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
506 manifest = DoGet(ORTHANC, uri2) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
507 self.assertEqual('http://iiif.io/api/presentation/3/context.json', manifest['@context']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
508 self.assertEqual('http://localhost:8042%s' % uri2, manifest['id']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
509 |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
510 self.assertEqual(1, len(manifest['items'])) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
511 self.assertEqual(1, len(manifest['items'][0]['items'])) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
512 self.assertEqual(1, len(manifest['items'][0]['items'][0]['items'])) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
513 |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
514 self.assertEqual('Manifest', manifest['type']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
515 self.assertEqual('Canvas', manifest['items'][0]['type']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
516 self.assertEqual('AnnotationPage', manifest['items'][0]['items'][0]['type']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
517 self.assertEqual('Annotation', manifest['items'][0]['items'][0]['items'][0]['type']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
518 |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
519 self.assertEqual(512, manifest['items'][0]['width']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
520 self.assertEqual(512, manifest['items'][0]['height']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
521 |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
522 body = manifest['items'][0]['items'][0]['items'][0]['body'] |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
523 self.assertEqual(1, len(body['service'])) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
524 self.assertEqual('image/jpeg', body['format']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
525 self.assertEqual('Image', body['type']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
526 self.assertEqual(512, body['width']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
527 self.assertEqual(512, body['height']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
528 self.assertEqual('level0', body['service'][0]['profile']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
529 self.assertEqual('ImageService3', body['service'][0]['type']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
530 self.assertEqual('http://localhost:8042%s' % uri, body['service'][0]['id']) |
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
531 |
570
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
532 def test_iiif_radiology(self): |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
533 a = UploadInstance(ORTHANC, 'ColorTestMalaterre.dcm') ['ID'] |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
534 b = UploadInstance(ORTHANC, 'Multiframe.dcm') ['ID'] |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
535 c = UploadInstance(ORTHANC, 'Brainix/Epi/IM-0001-0001.dcm') ['ID'] |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
536 d = UploadInstance(ORTHANC, 'Brainix/Epi/IM-0001-0002.dcm') ['ID'] |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
537 |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
538 s1 = DoGet(ORTHANC, '/instances/%s/series' % a) ['ID'] |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
539 s2 = DoGet(ORTHANC, '/instances/%s/series' % b) ['ID'] |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
540 s3 = DoGet(ORTHANC, '/instances/%s/series' % c) ['ID'] |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
541 |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
542 manifest = DoGet(ORTHANC, '/wsi/iiif/series/%s/manifest.json' % s1) |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
543 self.assertEqual(1, len(manifest['items'])) |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
544 |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
545 manifest = DoGet(ORTHANC, '/wsi/iiif/series/%s/manifest.json' % s2) |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
546 self.assertEqual(76, len(manifest['items'])) |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
547 |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
548 manifest = DoGet(ORTHANC, '/wsi/iiif/series/%s/manifest.json' % s3) |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
549 self.assertEqual(2, len(manifest['items'])) |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
550 |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
551 for (i, width, height) in [ (a, 41, 41), |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
552 (b, 512, 512), |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
553 (c, 256, 256), |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
554 (d, 256, 256) ]: |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
555 uri = '/wsi/iiif/frames/%s/0' % i |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
556 info = DoGet(ORTHANC, uri + '/info.json') |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
557 self.assertEqual(8, len(info)) |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
558 self.assertEqual('http://iiif.io/api/image/3/context.json', info['@context']) |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
559 self.assertEqual('http://iiif.io/api/image', info['protocol']) |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
560 self.assertEqual('http://localhost:8042%s' % uri, info['id']) |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
561 self.assertEqual('level0', info['profile']) |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
562 self.assertEqual('ImageService3', info['type']) |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
563 self.assertEqual(width, info['width']) |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
564 self.assertEqual(height, info['height']) |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
565 self.assertEqual(1, len(info['tiles'])) |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
566 self.assertEqual(3, len(info['tiles'][0])) |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
567 self.assertEqual(width, info['tiles'][0]['width']) |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
568 self.assertEqual(height, info['tiles'][0]['height']) |
9d41b7f18be8
WSI: added test_iiif_radiology
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
569
diff
changeset
|
569 self.assertEqual([ 1 ], info['tiles'][0]['scaleFactors']) |
569
201e69006cff
WSI: added test_iiif
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
568
diff
changeset
|
570 |
251 | 571 try: |
572 print('\nStarting the tests...') | |
573 unittest.main(argv = [ sys.argv[0] ] + args.options) | |
574 | |
575 finally: | |
576 print('\nDone') |