Mercurial > hg > orthanc-tests
changeset 436:9f87d5b2b382
added test_dicom_seg
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 25 Nov 2021 15:26:37 +0100 |
parents | d8dd920ab4fc |
children | e769bcf2b94f |
files | Database/DicomSeg.dcm Database/README.txt Tests/Tests.py |
diffstat | 3 files changed, 48 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/Database/README.txt Tue Aug 31 11:02:35 2021 +0200 +++ b/Database/README.txt Thu Nov 25 15:26:37 2021 +0100 @@ -40,6 +40,21 @@ ftp://medical.nema.org/medical/Dicom/DataSets/WG04/ +--------------------------------- +The Cancer Imaging Archive (TCIA) +--------------------------------- + +Some images come from the "TCGA-GBM" data collection: +https://wiki.cancerimagingarchive.net/display/Public/TCGA-GBM + +Scarpace, L., Mikkelsen, T., Cha, S., Rao, S., Tekchandani, S., +Gutman, D., Saltz, J. H., Erickson, B. J., Pedano, N., Flanders, +A. E., Barnholtz-Sloan, J., Ostrom, Q., Barboriak, D., & Pierce, +L. J. (2016). Radiology Data from The Cancer Genome Atlas Glioblastoma +Multiforme [TCGA-GBM] collection [Data set]. The Cancer Imaging +Archive. https://doi.org/10.7937/K9/TCIA.2016.RNYFUYE9 + + ------------- Other sources ------------- @@ -61,6 +76,7 @@ - ColorTestImageJ.dcm : From ImageJ, http://imagej.nih.gov/ij/images/cardio.dcm - ColorTestMalaterre.dcm : From Mathieu Malaterre <mathieu.malaterre@gmail.com>, Debian bug #698417 - Comunix/* : From OsiriX, "COMUNIX" (sample of PET/CT study). +- DicomSeg.dcm : From TCIA, "TCGA-GBM" collection, "TCGA-08-0360" patient. - DummyCT.dcm : From Osirix, "KNIX" with PixelData removed. - HierarchicalAnonymization/RTH/* : From https://wiki.cancerimagingarchive.net/display/Public/Lung+CT+Segmentation+Challenge+2017 - HierarchicalAnonymization/StructuredReports/* : Courtesy of Collective Minds Radiology AB
--- a/Tests/Tests.py Tue Aug 31 11:02:35 2021 +0200 +++ b/Tests/Tests.py Thu Nov 25 15:26:37 2021 +0100 @@ -8195,3 +8195,35 @@ self.assertEqual(127 + 2 * 16, im.getpixel((0, 1))) self.assertEqual(127 + 2 * 32, im.getpixel((1, 1))) + + def test_dicom_seg(self): + # This test fails in Orthanc <= 1.9.7 + a = UploadInstance(_REMOTE, 'DicomSeg.dcm') ['ID'] + + self.assertEqual(96, len(DoGet(_REMOTE, '/instances/%s/frames' % a))) + self.assertRaises(Exception, lambda: DoGet(_REMOTE, '/instances/%s/frames/96/preview' % a)) + + nonEmptyFrames = [ 11, 12, 13, 14, 15, 16, 39, 40, 42, 43, 44, 45, + 46, 47, 48, 49, 75, 76, 77, 78, 79, 80, 81 ] + + for i in range(96): + im = GetImage(_REMOTE, '/instances/%s/frames/%d/preview' % (a, i)) + self.assertEqual('L', im.mode) + self.assertEqual(256, im.size[0]) + self.assertEqual(256, im.size[1]) + + e = im.getextrema() + self.assertEqual(0, e[0]) + + if e[1] == 0: + self.assertFalse(i in nonEmptyFrames) + else: + self.assertTrue(i in nonEmptyFrames) + + im1 = GetImage(_REMOTE, '/instances/%s/frames/44/preview' % a) + + # Generated by "dcm2pnm +F 45 DicomSeg.dcm DicomSeg-Frame45.pgm" + im2 = Image.open(GetDatabasePath('DicomSeg-Frame45.pgm')) + im2 = im2.point(lambda p: 255 if p == 128 else 0) + + self.assertTrue(ImageChops.difference(im1, im2).getbbox() is None)