Skip to content

Commit b5bcb62

Browse files
hackermdCPBridgeChristopher Bridge
authored
Implementation of Microscopy Bulk Simple Annotations (#114)
* Catch errors in module generation script * Update IOD and module mappings * Minor reformatting of code in seg package * Implement Microscopy Bulk Simple Annotations * Increase package version * Update pydicom dependency * Fixed annotation module import files (#115) * Copy patient, study, and specimen information * Update README Co-authored-by: Chris Bridge <chrisbridge44@googlemail.com> Co-authored-by: Christopher Bridge <chrisbridge44@gmail.com>
1 parent 5e15d00 commit b5bcb62

21 files changed

Lines changed: 105807 additions & 81933 deletions

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44

55
# High DICOM
66

7-
A library that provides high-level DICOM abstractions for the Python programming language to facilitate the creation and handling of DICOM objects for image-derived information, including image annotations and image analysis results.
7+
A library that provides high-level DICOM abstractions for the Python programming language to facilitate the creation and handling of DICOM objects for image-derived information, including image annotations, and image analysis results.
88
It currently provides tools for creating and decoding the following DICOM information object definitions (IODs):
9+
* Annotations
10+
* Parametric Maps
911
* Segmentation images
1012
* Structured Reports
1113
* Secondary Capture images
@@ -31,4 +33,4 @@ The developers gratefully acknowledge their support:
3133
* The [MGH & BWH Center for Clinical Data Science](https://www.ccds.io/)
3234
* [Quantitative Image Informatics for Cancer Research (QIICR)](http://qiicr.org)
3335
* [Radiomics](http://radiomics.io)
34-
* The [NCI Imaging Data Commons](https://imagingdatacommons.github.io/)
36+
* The [NCI Imaging Data Commons](https://imaging.datacommons.cancer.gov/)

bin/create_iods_modules.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,13 @@ def _create_sop_to_iods(directory):
3838

3939
sop_id_to_ciod_name = {sop['id']: sop['ciod'] for sop in sops}
4040
ciod_name_to_ciod_id = {ciod['name']: ciod['id'] for ciod in ciods}
41-
sop_id_to_ciod_id = {
42-
sop_id: ciod_name_to_ciod_id[sop_id_to_ciod_name[sop_id]]
43-
for sop_id in sop_id_to_ciod_name
44-
}
41+
sop_id_to_ciod_id = {}
42+
for sop_id in sop_id_to_ciod_name:
43+
ciod_name = sop_id_to_ciod_name[sop_id]
44+
try:
45+
sop_id_to_ciod_id[sop_id] = ciod_name_to_ciod_id[ciod_name]
46+
except KeyError:
47+
logger.error(f'could not map IOD "{ciod_name}"')
4548
return sop_id_to_ciod_id
4649

4750

docs/package.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,16 @@ highdicom.legacy package
8080
:undoc-members:
8181
:show-inheritance:
8282

83+
.. _highdicom-ann-subpackage:
84+
85+
highdicom.ann package
86+
---------------------
87+
88+
.. automodule:: highdicom.ann
89+
:members:
90+
:special-members: __call__
91+
:undoc-members:
92+
:show-inheritance:
8393

8494
.. _highdicom-seg-subpackage:
8595

requirements_docs.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
sphinx-autodoc-typehints==1.12.0
2-
sphinx-pyreverse==0.0.16
3-
sphinx-rtd-theme==0.5.2
2+
sphinx-pyreverse==0.0.17
3+
sphinx-rtd-theme==1.0.0
44
sphinxcontrib-autoprogram==0.1.7
55
sphinxcontrib-websupport==1.2.4

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
package_dir={'': 'src'},
3939
python_requires='>=3.6',
4040
install_requires=[
41-
'pydicom>=2.2.1',
41+
'pydicom>=2.2.2',
4242
'numpy>=1.19',
4343
'pillow>=8.3'
4444
],

src/highdicom/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from highdicom import sc
44
from highdicom import seg
55
from highdicom import sr
6+
from highdicom import ann
67
from highdicom import color
78
from highdicom.content import (
89
AlgorithmIdentificationSequence,
@@ -60,6 +61,7 @@
6061
'SpecimenStaining',
6162
'UID',
6263
'UniversalEntityIDTypeValues',
64+
'ann',
6365
'color',
6466
'frame',
6567
'io',

0 commit comments

Comments
 (0)