Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
16019a0
newly designed multi-frame conversion based on pixelmed
afshinmessiah Jun 25, 2020
6f62073
mend
afshinmessiah Jun 30, 2020
5af4d97
Flake8 verified code
afshinmessiah Jul 1, 2020
a05e189
Verified by mypy and flake8. Added stack module adder
afshinmessiah Jul 9, 2020
408cdde
mend
afshinmessiah Jul 9, 2020
2444cc5
mend
afshinmessiah Jul 9, 2020
09467ce
mend
afshinmessiah Jul 9, 2020
8f92d68
mend
afshinmessiah Jul 9, 2020
69b1892
Added frameset collection class
afshinmessiah Jul 14, 2020
55ebc0a
mend
afshinmessiah Jul 15, 2020
716c581
mend
afshinmessiah Aug 13, 2020
505d272
Debugged for exception on string conversion to DA, DT, TM
afshinmessiah Aug 27, 2020
cd9e8c5
mend
afshinmessiah Aug 27, 2020
c3f27d6
mend
afshinmessiah Sep 1, 2020
17d39e6
Fixed issues related to Marcus minor comments
afshinmessiah Sep 8, 2020
531b3ce
mend
afshinmessiah Sep 8, 2020
79f0194
mend
afshinmessiah Oct 4, 2020
918b842
mend
afshinmessiah Oct 4, 2020
942d6fc
mend
afshinmessiah Oct 4, 2020
4c8da89
added logger for conversion
afshinmessiah Oct 12, 2020
477f614
mend
afshinmessiah Oct 24, 2020
4a7c906
Modified the way frameanatomysequence was added
afshinmessiah Oct 28, 2020
4f17d11
mend
afshinmessiah Nov 8, 2020
7e2aa9c
mend
afshinmessiah Nov 8, 2020
a179f71
mend
afshinmessiah Nov 9, 2020
5b0bdba
mend
afshinmessiah Nov 9, 2020
32e9983
Image/Frame-Type bug was fixed
afshinmessiah Feb 9, 2021
fb8cc9b
Merge branch 'master' into dev_pixelmed_converstion_00
afshinmessiah Mar 30, 2021
aafa65c
changed the class structures for sop
afshinmessiah Apr 2, 2021
ac45b5e
modified the code to apply all major comments
afshinmessiah Apr 2, 2021
3277b49
mend
afshinmessiah Apr 2, 2021
5c1687c
mend
afshinmessiah Apr 2, 2021
fe51ca2
Added tests to dicom legacy converter
afshinmessiah Apr 4, 2021
b6559c3
mend
afshinmessiah Apr 4, 2021
7f7df4a
Modified code based on Markus's comments
afshinmessiah Apr 11, 2021
a6551fb
Modified code based on Markus's comments
afshinmessiah Apr 11, 2021
c417da5
finished applying Markus's comments
afshinmessiah Apr 12, 2021
831e3da
Finished applying Markus/Andrey's commnets
afshinmessiah Apr 15, 2021
9850125
modified commnets for 3rd round
afshinmessiah Apr 27, 2021
6455b85
Applied Chris's comments
afshinmessiah May 9, 2021
9326b97
Merge branch 'master' into dev_pixelmed_converstion_00
afshinmessiah May 9, 2021
64190d7
Swapped voctors in normal calculation
afshinmessiah May 9, 2021
ee44fd1
Corrected how the normal vector was calculated
afshinmessiah May 10, 2021
6c6fbe0
Moved FrameSet, FrameSetCollection and _DicomHelper classes into high…
afshinmessiah May 12, 2021
6382dec
mend
afshinmessiah May 12, 2021
796dc5d
made both FrameSet and FrameSetCollection classes private
afshinmessiah May 12, 2021
55fec52
applied Chris's comments for the 2nd round
afshinmessiah May 14, 2021
a601fda
Rebase and basic tidy-up
CPBridge Jul 6, 2025
dfd5618
Further tidy up
CPBridge Jul 6, 2025
c9188a0
Flake8 fixes
CPBridge Jul 6, 2025
d42af41
Refactor modality-specific components to modality-specific subclasses
CPBridge Jul 7, 2025
1086d96
Minor refactor
CPBridge Jul 7, 2025
e0afcaf
refactor all lines ending in backslash
CPBridge Jul 7, 2025
b691188
wip
CPBridge Sep 12, 2025
ae39d02
Rename methods for clarity
CPBridge Jan 15, 2026
fc6f44c
Merge branch 'master' into legacy_conversion_revamp
CPBridge Jan 20, 2026
02ba5c0
Rebase on Image class, implement pixel data transcoding
CPBridge Jan 21, 2026
14a324a
Merge branch 'v0.28.0dev' into legacy_conversion_revamp
CPBridge Jan 23, 2026
be2c57d
Major refactor of legacy conversion
CPBridge Mar 17, 2026
c271109
Merge branch 'v0.28.0dev' into legacy_conversion_revamp
CPBridge Mar 17, 2026
61b23ae
Improvements using validator
CPBridge Mar 17, 2026
3c653c1
Clarify docstings of get_volume_positions and get_series_volume_posit…
CPBridge Mar 18, 2026
271262c
Implement BodyPartExamined -> AnatomicRegionSequence mapping
CPBridge Mar 19, 2026
eb86f2a
Fix standard JSON file packaging
CPBridge Mar 19, 2026
e12cab2
Refactor handling of Enhanced X Image modules
CPBridge Mar 19, 2026
9a5963f
Skip optional modules if not all attributes have values
CPBridge Mar 20, 2026
62c644f
Refactor to remove configs
CPBridge Mar 20, 2026
9e96572
Correct handling of private attributes
CPBridge Mar 20, 2026
74a7d9d
Improve functional group inclusion logic
CPBridge Mar 20, 2026
e17288e
Factor out common docstring
CPBridge Mar 20, 2026
d396b1f
Improve error messages
CPBridge Mar 20, 2026
101a5e8
Minor docstring improvements
CPBridge Mar 20, 2026
b645499
Add .mailmap to consolidate author identities (#401)
yarikoptic Mar 23, 2026
2b9c7b8
Fix readthedocs build errors (#402)
CPBridge Mar 23, 2026
ec92b07
Move .readthedocs.yaml to use dependency groups (#403)
CPBridge Mar 23, 2026
186b5ba
Move readthedocs.yaml to manual pip install
CPBridge Mar 23, 2026
808c3a7
Move readthedocs.yaml to manual pip install
CPBridge Mar 23, 2026
9750a6f
Fix merge conflict markers
CPBridge Mar 23, 2026
48cae06
Add logic to determine when to include frame anatomy information
CPBridge Mar 26, 2026
46e153c
Add min/max pixel values
CPBridge Mar 26, 2026
c7545c3
Remove unused import
CPBridge Mar 26, 2026
93e7d28
Refactor copy pixels method
CPBridge Mar 26, 2026
f3917cf
Add checks on functional groups
CPBridge Mar 27, 2026
4efedf4
Further tests and refactor to rmove test classes
CPBridge Mar 27, 2026
431b671
Lint fixes
CPBridge Mar 27, 2026
6324783
Further tests
CPBridge Mar 27, 2026
565d41f
Add missing keywork marks
Mar 28, 2026
6fc35d5
Fix for aggregating ImageType, with test
CPBridge Mar 30, 2026
b3289a9
Fix for aggregating ImageType, with test
CPBridge Mar 30, 2026
92e4430
Further tests and fix for inconsistent type 2 attribute
CPBridge Mar 30, 2026
bf066bd
Linting
CPBridge Mar 30, 2026
b351fb5
Fix grammatical error in README
CPBridge Mar 30, 2026
51ad7b5
Set photometric interpretation based on transfer syntax
CPBridge Apr 1, 2026
b85c171
Add common instance reference module
Apr 2, 2026
a0835e7
Add tests for color transcoding
Apr 5, 2026
21b3b3e
Add tests for from_datasets
Apr 5, 2026
a8a45e6
Consolidate legacy classes, improve from_dataset
Apr 5, 2026
89e8fa5
Add read functions
Apr 5, 2026
60988b0
Fix specific character set
Apr 5, 2026
0af9e6e
Add check for regularly volume
Apr 5, 2026
a6337b3
Add default series description
Apr 5, 2026
be3dd5e
Improve handling of lossy image compression attributes
Apr 6, 2026
ecabdb0
Move all standard data from python to JSON files
CPBridge Apr 7, 2026
2f8eee2
Adjust _module_utils imports
CPBridge Apr 7, 2026
3d63b33
Remove outdated flake8 exclusion
CPBridge Apr 7, 2026
dea3ad3
Small bug fixes
CPBridge Apr 7, 2026
c6e5075
Further exclusions
CPBridge Apr 7, 2026
228bc86
Further minor fixes
CPBridge Apr 7, 2026
3c6dbb8
Merge branch 'master' into legacy_conversion_revamp
CPBridge Apr 8, 2026
45693e9
Add docs and quickstart page
CPBridge Apr 8, 2026
adf3567
Minor docs typo
CPBridge Apr 8, 2026
fc15ea0
Fix for re-encapsulating compressed pixel data
CPBridge Apr 9, 2026
01856da
Merge branch 'master' into v0.28.0dev
CPBridge Apr 9, 2026
f18d6c3
Merge branch 'v0.28.0dev' into legacy_conversion_revamp
CPBridge Apr 9, 2026
3e6bc6d
Add tests for decompressing to native transfer syntax
CPBridge Apr 9, 2026
2398bf6
mypy fixes for legacy module
CPBridge Apr 9, 2026
6b4e409
Remove sort_key parameter in favour of boolean sort option
Apr 14, 2026
07b7c1c
Docstring improvements
Apr 14, 2026
a153ad6
Improvements to legacy doc page
Apr 14, 2026
e352f30
remove print statement
CPBridge Apr 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/run_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
pip install ${{ matrix.dependencies }}
- name: Lint with flake8
run: |
flake8 --exclude='bin,build,.eggs,src/highdicom/_*'
flake8 --exclude='bin,build,.eggs'
- name: Test with pytest
run: |
pytest --cov=highdicom --cov-fail-under=80
Expand Down
34 changes: 34 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# .mailmap - Consolidate git author identities
# See: https://git-scm.com/docs/gitmailmap
#
# Format: Canonical Name <canonical@email.com> Old Name <old@email.com>

# Afshin Zade
Afshin Zade <afshin.akbarzadeh@childrens.harvard.edu> afshinmessiah <afshin.akbarzadeh@childrens.harvard.edu>
Afshin Zade <afshin.akbarzadeh@childrens.harvard.edu> Afshin Zade <42010605+afshinmessiah@users.noreply.github.com>

# Andrey Fedorov
Andrey Fedorov <andrey.fedorov@gmail.com> <fedorov@bwh.harvard.edu>

# Christopher P. Bridge
Christopher P. Bridge <chrisbridge44@googlemail.com> Chris Bridge <cbridge@partners.org>
Christopher P. Bridge <chrisbridge44@googlemail.com> Christopher Bridge <cbridge@partners.org>
Christopher P. Bridge <chrisbridge44@googlemail.com> Christopher Bridge <chrisbridge44@gmail.com>
Christopher P. Bridge <chrisbridge44@googlemail.com> CPBridge <chrisbridge44@googlemail.com>
Christopher P. Bridge <chrisbridge44@googlemail.com> Christopher P Bridge <cpb28@glacier.nmr.mgh.harvard.edu>
Christopher P. Bridge <chrisbridge44@googlemail.com> Chris Bridge <chrisbridge44@googlemail.com>

# Dimitri Papadopoulos Orfanos
Dimitri Papadopoulos Orfanos <3234522+DimitriPapadopoulos@users.noreply.github.com> Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>

# Erik O Gabrielsson
Erik O Gabrielsson <erik.o.gabrielsson@sectra.com> erikogabrielsson <83275777+erikogabrielsson@users.noreply.github.com>
Erik O Gabrielsson <erik.o.gabrielsson@sectra.com> Erik O Gabrielsson <83275777+erikogabrielsson@users.noreply.github.com>

# Markus D. Herrmann
Markus D. Herrmann <hackermd@protonmail.com> hackermd <hackermd@protonmail.com>
Markus D. Herrmann <hackermd@protonmail.com> Markus D. Herrmann <hackermd@users.noreply.github.com>
Markus D. Herrmann <hackermd@protonmail.com> hackermd <markusdherrmann@gmail.com>

# Robin Fourcade
Robin Fourcade <29704178+RobinFrcd@users.noreply.github.com> RobinFrcd <29704178+RobinFrcd@users.noreply.github.com>
16 changes: 6 additions & 10 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,17 @@ sphinx:
configuration: docs/conf.py

build:
os: ubuntu-22.04
os: ubuntu-24.04
tools:
python: "3.11"
python: "3.14"
jobs:
install:
- pip install --upgrade pip
- pip install . --group 'docs'

# Build documentation with MkDocs
#mkdocs:
# configuration: mkdocs.yml

# Optionally build your docs in additional formats such as PDF and ePub
formats: all

# Optionally set the version of Python and requirements required to build your docs
python:
install:
- method: pip
path: .
extra_requirements:
- docs
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

`highdicom` is a pure Python package built on top of `pydicom` to provide a higher-level application programming interface (API) for working with DICOM files. Its focus is on common operations required for machine learning, computer vision, and other similar computational analyses. Broadly speaking, the package helps with three types of task:

1. Reading existing DICOM image files of a wide variety of modalities (covering radiology, pathology, and more) and selecting and formatting its frames for computational analysis. This includes considerations such as spatial arrangements of frames, and application of pixel transforms, which are not handled by `pydicom`.
1. Reading existing DICOM image files of a wide variety of modalities (covering radiology, pathology, and more) and selecting and formatting their frames for computational analysis. This includes considerations such as spatial arrangements of frames and application of pixel transforms, which are not handled by `pydicom`.
2. Storing image-derived information, for example from computational analyses or human annotation, in derived DICOM objects for communication and storage. This includes:
* Annotations
* Parametric Map images
Expand Down
56 changes: 17 additions & 39 deletions bin/create_iods_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
logger = logging.getLogger(__name__)


PGK_PATH = os.path.join(
PKG_JSON_PATH = os.path.join(
os.path.dirname(__file__),
'..',
'src',
'highdicom'
'highdicom',
'_standard',
)


Expand All @@ -25,10 +26,6 @@ def _load_json_from_file(filename):
return json.load(f)


def _dump_json(data):
return json.dumps(data, indent=4, sort_keys=True)


def _create_sop_to_iods(directory):
filename = os.path.join(directory, 'sops.json')
sops = _load_json_from_file(filename)
Expand Down Expand Up @@ -97,14 +94,16 @@ def _create_modules(directory):
return modules


if __name__ == '__main__':

if __name__ == "__main__":
logging.basicConfig()
logger.setLevel(logging.DEBUG)

# Positional argument is path to directory containing JSON files generated
# using the dicom-standard Python package, see
# https://github.com/innolitics/dicom-standard/tree/master/standard
# If generating yourself using the instructions in that repo, be sure to
# use "make all" instead of just "make", otherwise some of the required
# files are skipped
try:
directory = sys.argv[1]
except IndexError as e:
Expand All @@ -119,37 +118,16 @@ def _create_modules(directory):
current_time = datetime.datetime.time(now).strftime('%H:%M:%S')

iods = _create_iods(directory)
iods_docstr = '\n'.join([
'"""DICOM Information Object Definitions (IODs)',
f'auto-generated on {current_date} at {current_time}.',
'"""',
'from typing import Dict, List'
])
iods_filename = os.path.join(PKG_JSON_PATH, 'iods.json')
with open(iods_filename, 'w') as jf:
json.dump(iods, jf, indent=2)

sop_to_iods = _create_sop_to_iods(directory)
iods_filename = os.path.join(PGK_PATH, '_iods.py')
with open(iods_filename, 'w') as fp:
fp.write(iods_docstr)
fp.write('\n\n')
iods_formatted = _dump_json(iods).replace('null', 'None')
fp.write(
f'IOD_MODULE_MAP: Dict[str, List[Dict[str, str]]] = {iods_formatted}'
)
fp.write('\n\n')
sop_to_iods_formatted = _dump_json(sop_to_iods).replace('null', 'None')
fp.write(f'SOP_CLASS_UID_IOD_KEY_MAP = {sop_to_iods_formatted}')
sop_to_iods_filename = os.path.join(PKG_JSON_PATH, 'sop_class_to_iod.json')
with open(sop_to_iods_filename, 'w') as jf:
json.dump(sop_to_iods, jf, indent=2)

modules = _create_modules(directory)
modules_docstr = '\n'.join([
'"""DICOM modules'
f'auto-generated on {current_date} at {current_time}.'
'"""',
'from typing import Dict, List, Sequence, Union'
])
modules_filename = os.path.join(PGK_PATH, '_modules.py')
with open(modules_filename, 'w') as fp:
fp.write(modules_docstr)
fp.write('\n\n')
modules_formatted = _dump_json(modules).replace('null', 'None')
fp.write(
f'MODULE_ATTRIBUTE_MAP: Dict[str, List[Dict[str, Union[str, Sequence[str]]]]] = {modules_formatted}' # noqa: E501
)
modules_filename = os.path.join(PKG_JSON_PATH, 'modules.json')
with open(modules_filename, 'w') as jf:
json.dump(modules, jf, indent=2)
11 changes: 6 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#
import os
import sys
import pkg_resources
import datetime
import importlib.metadata

source_dir = os.path.dirname(__file__)
pkg_dir = os.path.join(source_dir, '..', '..', 'src', 'highdicom')
Expand All @@ -23,14 +23,15 @@

project = 'highdicom'
copyright = f'2020-{datetime.datetime.now().year}, highdicom contributors'
author = 'Markus D. Herrmann'
author = 'Markus D. Herrmann, Christopher P. Bridge'

# The full version, including alpha/beta/rc tags
try:
release = pkg_resources.get_distribution('highdicom').version
except pkg_resources.DistributionNotFound:
release = importlib.metadata.version("highdicom")
except importlib.metadata.PackageNotFoundError:
print('Package "highdicom" must be installed to build docs.')
sys.exit(1)

# The short X.Y version
version = '.'.join(release.split('.')[:2])

Expand All @@ -48,7 +49,7 @@
'sphinxcontrib.autoprogram',
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx_autodoc_typehints',
# 'sphinx_autodoc_typehints',
'sphinx.ext.extlinks',
]

Expand Down
Loading
Loading