comparison Plugins/DicomWeb/Run.py @ 272:a94b0409fdac

test_rendered_studies_series
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 03 Mar 2020 10:43:06 +0100
parents d202bfcd7b96
children afcd550a9216
comparison
equal deleted inserted replaced
271:d202bfcd7b96 272:a94b0409fdac
1024 1024
1025 a = DoGet(ORTHANC, '/dicom-web/studies?00090010=Lunit2&includefield=00091001') 1025 a = DoGet(ORTHANC, '/dicom-web/studies?00090010=Lunit2&includefield=00091001')
1026 self.assertEqual(0, len(a)) 1026 self.assertEqual(0, len(a))
1027 1027
1028 1028
1029 def test_rendered_studies_series(self):
1030 i = UploadInstance(ORTHANC, 'Phenix/IM-0001-0001.dcm') ['ID']
1031 study = DoGet(ORTHANC, '/instances/%s/tags?simplify' % i) ['StudyInstanceUID']
1032 series = DoGet(ORTHANC, '/instances/%s/tags?simplify' % i) ['SeriesInstanceUID']
1033 instance = DoGet(ORTHANC, '/instances/%s/tags?simplify' % i) ['SOPInstanceUID']
1034
1035 a = DoPost(ORTHANC, '/dicom-web/servers/sample/get', {
1036 'Uri' : '/studies/%s/series/%s/instances/%s/rendered' % (study, series, instance)
1037 })
1038
1039 im = UncompressImage(a)
1040 self.assertEqual("L", im.mode)
1041 self.assertEqual(512, im.size[0])
1042 self.assertEqual(358, im.size[1])
1043
1044 b = DoPost(ORTHANC, '/dicom-web/servers/sample/get', {
1045 'Uri' : '/studies/%s/series/%s/rendered' % (study, series)
1046 })
1047
1048 self.assertEqual(len(a), len(b))
1049 self.assertEqual(a, b)
1050
1051 c = DoPost(ORTHANC, '/dicom-web/servers/sample/get', {
1052 'Uri' : '/studies/%s/rendered' % study
1053 })
1054
1055 self.assertEqual(len(a), len(c))
1056 self.assertEqual(a, c)
1057
1058
1029 try: 1059 try:
1030 print('\nStarting the tests...') 1060 print('\nStarting the tests...')
1031 unittest.main(argv = [ sys.argv[0] ] + args.options) 1061 unittest.main(argv = [ sys.argv[0] ] + args.options)
1032 1062
1033 finally: 1063 finally: