dicom-parser 1.2.3__tar.gz → 1.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/.pre-commit-config.yaml +1 -1
- dicom_parser-1.3.0/.readthedocs.yaml +16 -0
- dicom_parser-1.3.0/PKG-INFO +304 -0
- dicom_parser-1.3.0/README.md +228 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/docs/conf.py +1 -1
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/docs/index.rst +7 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/docs/release_notes.rst +12 -1
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/setup.cfg +15 -18
- dicom_parser-1.3.0/src/dicom_parser/__init__.py +22 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_element.py +3 -3
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/header.py +1 -1
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/bids/header_queries.py +22 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/bids/sequence_to_bids.py +2 -1
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/siemens/csa/ascii/ascconv.py +29 -13
- dicom_parser-1.3.0/src/dicom_parser.egg-info/PKG-INFO +304 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser.egg-info/SOURCES.txt +0 -3
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser.egg-info/requires.txt +11 -28
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/fixtures.py +3 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/utils/siemens/csa/ascii/test_header.py +18 -7
- dicom_parser-1.2.3/.readthedocs.yaml +0 -9
- dicom_parser-1.2.3/PKG-INFO +0 -349
- dicom_parser-1.2.3/README.md +0 -314
- dicom_parser-1.2.3/docs/.coverage +0 -0
- dicom_parser-1.2.3/docs/Makefile +0 -20
- dicom_parser-1.2.3/docs/make.bat +0 -35
- dicom_parser-1.2.3/src/dicom_parser/__init__.py +0 -8
- dicom_parser-1.2.3/src/dicom_parser.egg-info/PKG-INFO +0 -349
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/CODE_OF_CONDUCT.md +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/CONTRIBUTING.md +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/LICENSE +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/MANIFEST.in +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/docs/installation.rst +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/docs/modules/dicom_parser.data_elements.rst +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/docs/modules/dicom_parser.utils.code_strings.rst +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/docs/modules/dicom_parser.utils.multi_frame.rst +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/docs/modules/dicom_parser.utils.rst +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/docs/modules/dicom_parser.utils.sequence_detector.rst +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/docs/modules/dicom_parser.utils.siemens.csa.rst +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/docs/modules/dicom_parser.utils.siemens.rst +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/docs/modules/reference.rst +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/docs/multi_frame.rst +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/docs/overview.rst +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/docs/quickstart.rst +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/docs/resources.rst +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/docs/siemens/csa_headers.rst +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/docs/siemens/mosaic.rst +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/docs/siemens/private_tags.rst +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/docs/siemens/siemens.rst +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/docs/value_representation.rst +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/docs/vendors.rst +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/pyproject.toml +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/__init__.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/age_string.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/application_entity.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/attribute_tag.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/code_string.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/date.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/date_time.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/decimal_string.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/floating_point_double.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/floating_point_single.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/integer_string.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/long_string.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/long_text.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/messages.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/other_64bit_very_long.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/other_byte.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/other_double.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/other_float.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/other_long.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/other_word.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/person_name.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/private_data_element.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/sequence_of_items.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/short_string.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/short_text.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/signed_64bit_very_long.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/signed_long.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/signed_short.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/time.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/unique_identifier.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/unlimited_characters.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/unlimited_text.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/unsigned_64bit_very_long.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/unsigned_long.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/unsigned_short.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/data_elements/url.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/image.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/messages.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/series.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/__init__.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/bids/__init__.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/bids/bids_detector.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/bids/messages.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/bids/utils.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/choice_enum.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/code_strings/__init__.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/code_strings/modality.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/code_strings/patient_position.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/code_strings/scanning_sequence.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/code_strings/sequence_variant.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/code_strings/sex.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/exceptions.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/format_header_df.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/image_generator.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/messages.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/mime_generator.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/multi_frame/__init__.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/multi_frame/functional_groups.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/multi_frame/messages.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/multi_frame/multi_frame.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/parse_tag.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/path_generator.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/peek.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/plane.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/private_tags.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/read_file.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/requires_pandas.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/__init__.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/lookups.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/messages.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/operators.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequence_detector.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/__init__.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/mr/__init__.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/mr/anat/__init__.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/mr/anat/anat.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/mr/anat/flair.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/mr/anat/fspgr.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/mr/anat/ir_epi.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/mr/anat/localizer.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/mr/anat/mprage.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/mr/anat/spgr.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/mr/anat/t2w.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/mr/anat/tirm.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/mr/dwi/__init__.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/mr/dwi/derived.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/mr/dwi/diffusion.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/mr/dwi/dwi.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/mr/dwi/fieldmap.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/mr/dwi/sbref.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/mr/func/__init__.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/mr/func/bold.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/mr/func/fieldmap.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/mr/func/func.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/mr/func/sbref.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/mr/mr_sequences.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/mr/physio/__init__.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/mr/physio/log.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/mr/physio/physio.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/sequence_detector/sequences/sequences.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/siemens/__init__.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/siemens/csa/__init__.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/siemens/csa/ascii/__init__.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/siemens/csa/ascii/header.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/siemens/csa/ascii/messages.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/siemens/csa/exceptions.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/siemens/csa/header.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/siemens/csa/messages.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/siemens/csa/unpacker.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/siemens/csa/utils.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/siemens/messages.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/siemens/mosaic.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/siemens/private_tags.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/value_representation.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser/utils/vr_to_data_element.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser.egg-info/dependency_links.txt +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/src/dicom_parser.egg-info/top_level.txt +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/__init__.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/__init__.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/fixtures.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_age_string.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_application_entity.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_attribute_tag.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_code_string.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_date.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_date_time.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_decimal_string.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_floating_point_double.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_floating_point_single.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_integer_string.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_long_string.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_long_text.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_other_64bit_very_long.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_other_byte.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_other_double.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_other_float.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_other_long.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_other_word.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_person_name.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_private_data_element.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_sequence_of_items.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_short_string.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_short_text.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_signed_64bit_very_long.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_signed_long.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_signed_short.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_time.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_unique_identifier.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_unlimited_characters.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_unlimited_text.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_unsigned_64bit_very_long.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_unsigned_long.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/data_elements/test_unsigned_short.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/test_data_element.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/test_header.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/test_image.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/test_series.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/utils/__init__.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/utils/bids/__init__.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/utils/bids/fixtures.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/utils/bids/test_bids_detector.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/utils/siemens/__init__.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/utils/siemens/csa/__init__.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/utils/siemens/csa/ascii/__init__.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/utils/siemens/csa/ascii/fixtures.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/utils/siemens/csa/ascii/test_ascconv_parsing.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/utils/siemens/csa/ascii/test_ascconv_sample.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/utils/siemens/csa/test_header.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/utils/siemens/test_mosaic.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/utils/test_choice_enum.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/utils/test_image_generator.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/utils/test_mime_generator.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/utils/test_multi_frame.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/utils/test_path_generator.py +0 -0
- {dicom_parser-1.2.3 → dicom_parser-1.3.0}/tests/utils/test_sequence_detector.py +0 -0
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dicom_parser
|
|
3
|
+
Version: 1.3.0
|
|
4
|
+
Summary: Deprecated: DICOM files parser meant to facilitate data access. See the README for maintained replacements.
|
|
5
|
+
Home-page: https://github.com/open-dicom/dicom_parser
|
|
6
|
+
Author: Zvi Baratz
|
|
7
|
+
Author-email: z.baratz@gmail.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Source, https://github.com/open-dicom/dicom_parser/
|
|
10
|
+
Project-URL: Documentation, https://dicom-parser.readthedocs.io/en/latest/
|
|
11
|
+
Keywords: dicom,dcm,mri,ct,radiology
|
|
12
|
+
Classifier: Development Status :: 7 - Inactive
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Intended Audience :: Healthcare Industry
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
24
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
25
|
+
Requires-Python: >=3.9
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
Requires-Dist: numpy>=1.21
|
|
29
|
+
Requires-Dist: pydicom<4,>=2.1
|
|
30
|
+
Provides-Extra: magic
|
|
31
|
+
Requires-Dist: python-magic~=0.4; platform_system != "Windows" and extra == "magic"
|
|
32
|
+
Provides-Extra: dist
|
|
33
|
+
Requires-Dist: build; extra == "dist"
|
|
34
|
+
Requires-Dist: twine; extra == "dist"
|
|
35
|
+
Provides-Extra: docs
|
|
36
|
+
Requires-Dist: sphinx>=7; extra == "docs"
|
|
37
|
+
Requires-Dist: sphinx-rtd-theme>=2; extra == "docs"
|
|
38
|
+
Provides-Extra: pandas
|
|
39
|
+
Requires-Dist: jinja2; extra == "pandas"
|
|
40
|
+
Requires-Dist: pandas; extra == "pandas"
|
|
41
|
+
Provides-Extra: test
|
|
42
|
+
Requires-Dist: coverage[toml]>=6.2; extra == "test"
|
|
43
|
+
Requires-Dist: pytest>=7; extra == "test"
|
|
44
|
+
Requires-Dist: python-magic~=0.4; platform_system != "Windows" and extra == "test"
|
|
45
|
+
Provides-Extra: dev
|
|
46
|
+
Requires-Dist: black~=22.1; extra == "dev"
|
|
47
|
+
Requires-Dist: doc8~=0.10; extra == "dev"
|
|
48
|
+
Requires-Dist: flake8~=4.0; extra == "dev"
|
|
49
|
+
Requires-Dist: ipython; extra == "dev"
|
|
50
|
+
Requires-Dist: isort~=5.10; extra == "dev"
|
|
51
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
52
|
+
Requires-Dist: pre-commit-hooks; extra == "dev"
|
|
53
|
+
Requires-Dist: sphinx>=7; extra == "dev"
|
|
54
|
+
Requires-Dist: sphinx-rtd-theme>=2; extra == "dev"
|
|
55
|
+
Requires-Dist: coverage[toml]>=6.2; extra == "dev"
|
|
56
|
+
Requires-Dist: pytest>=7; extra == "dev"
|
|
57
|
+
Requires-Dist: python-magic~=0.4; platform_system != "Windows" and extra == "dev"
|
|
58
|
+
Provides-Extra: all
|
|
59
|
+
Requires-Dist: black~=22.1; extra == "all"
|
|
60
|
+
Requires-Dist: doc8~=0.10; extra == "all"
|
|
61
|
+
Requires-Dist: flake8~=4.0; extra == "all"
|
|
62
|
+
Requires-Dist: ipython; extra == "all"
|
|
63
|
+
Requires-Dist: isort~=5.10; extra == "all"
|
|
64
|
+
Requires-Dist: pre-commit; extra == "all"
|
|
65
|
+
Requires-Dist: pre-commit-hooks; extra == "all"
|
|
66
|
+
Requires-Dist: sphinx>=7; extra == "all"
|
|
67
|
+
Requires-Dist: sphinx-rtd-theme>=2; extra == "all"
|
|
68
|
+
Requires-Dist: coverage[toml]>=6.2; extra == "all"
|
|
69
|
+
Requires-Dist: pytest>=7; extra == "all"
|
|
70
|
+
Requires-Dist: python-magic~=0.4; platform_system != "Windows" and extra == "all"
|
|
71
|
+
Requires-Dist: build; extra == "all"
|
|
72
|
+
Requires-Dist: twine; extra == "all"
|
|
73
|
+
Requires-Dist: jinja2; extra == "all"
|
|
74
|
+
Requires-Dist: pandas; extra == "all"
|
|
75
|
+
Dynamic: license-file
|
|
76
|
+
|
|
77
|
+
# dicom_parser
|
|
78
|
+
|
|
79
|
+
> **dicom_parser is deprecated and no longer maintained.** Version 1.3.0 is the last release. It works with
|
|
80
|
+
> pydicom 2.1 to 3.x on Python 3.9 to 3.14, and it will get no further fixes. Everything it did is now covered
|
|
81
|
+
> by maintained tools. The guide below maps each feature to its replacement.
|
|
82
|
+
|
|
83
|
+
*dicom_parser* wrapped [pydicom][] to return "pythonic" values from DICOM headers, and added Siemens-specific
|
|
84
|
+
parsing: CSA headers, mosaics and diffusion vectors. Since it was written, pydicom 3, [nibabel][], [csa_header][]
|
|
85
|
+
and [dcm2niix][] have come to cover all of it, with active maintainers and wider testing.
|
|
86
|
+
|
|
87
|
+
* [Replacing dicom_parser](#replacing-dicom_parser)
|
|
88
|
+
* [Known problems in dicom_parser's results](#known-problems-in-dicom_parsers-results)
|
|
89
|
+
* [Installing the last release](#installing-the-last-release)
|
|
90
|
+
* [Credits](#credits)
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Replacing dicom_parser
|
|
95
|
+
|
|
96
|
+
| dicom_parser | Use instead |
|
|
97
|
+
|---|---|
|
|
98
|
+
| `Image`, `Header`: reading a file, dict-like access by keyword or tag | `pydicom.dcmread` and pydicom's `Dataset` |
|
|
99
|
+
| Parsed values (DS, IS, DA, TM, DT, PN) | pydicom: numbers are already `float`/`int` subclasses; dates and times with one config switch |
|
|
100
|
+
| `Header.keyword_contains`, `to_dict`, `to_dataframe` | `Dataset.dir`, `Dataset.to_json_dict`, a short pandas snippet |
|
|
101
|
+
| Siemens private tags by keyword (`B_value`, `MosaicRefAcqTimes`, …) | pydicom's `Dataset.private_block` |
|
|
102
|
+
| `CsaHeader`, `parse_ascconv` | [csa_header][] (`CsaHeader`), or `nibabel.nicom.ascconv.parse_ascconv` |
|
|
103
|
+
| `Image.data` (rescaling, Siemens mosaics, enhanced multi-frame) | `pydicom.pixels.apply_rescale`; nibabel's DICOM wrappers |
|
|
104
|
+
| `affine`, `slice_normal`, `spatial_resolution`, `image_position` | nibabel's DICOM wrappers |
|
|
105
|
+
| `b_matrix`, `q_vector`, `b_vector`, `b_value` | nibabel's DICOM wrappers |
|
|
106
|
+
| `Series` | a few lines of pydicom, or [dcm2niix][] for whole volumes |
|
|
107
|
+
| `detected_sequence`, `bids_path` | dcm2niix's `BidsGuess`; [HeuDiConv][], [dcm2bids][] or [BIDScoin][] for whole studies |
|
|
108
|
+
| Verbose code strings (`"MR"` → `"Magnetic Resonance"`) | none: pydicom returns the codes |
|
|
109
|
+
|
|
110
|
+
Each replacement below was checked against dicom_parser's own test files.
|
|
111
|
+
|
|
112
|
+
### Reading files and header values
|
|
113
|
+
|
|
114
|
+
```python
|
|
115
|
+
import pydicom
|
|
116
|
+
|
|
117
|
+
pydicom.config.datetime_conversion = True # DA, TM and DT values become date/time objects
|
|
118
|
+
|
|
119
|
+
ds = pydicom.dcmread("image.dcm")
|
|
120
|
+
ds.ImagingFrequency # DS: already a float subclass
|
|
121
|
+
ds.InstanceNumber # IS: already an int subclass
|
|
122
|
+
ds.StudyDate # a datetime.date subclass
|
|
123
|
+
ds.PatientName.family_name # PN components
|
|
124
|
+
ds.get("MissingKeyword", "default")
|
|
125
|
+
ds[0x0018, 0x0050].value # access by tag
|
|
126
|
+
ds.dir("echo") # keywords containing "echo"
|
|
127
|
+
ds.to_json_dict() # the whole header as a dict
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Age strings such as `"027Y"` stay strings in pydicom. To get years:
|
|
131
|
+
|
|
132
|
+
```python
|
|
133
|
+
AGE_UNITS_PER_YEAR = {"Y": 1, "M": 12, "W": 52.1429, "D": 365.2422}
|
|
134
|
+
age_in_years = float(ds.PatientAge[:-1]) / AGE_UNITS_PER_YEAR[ds.PatientAge[-1]]
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
For a table of the header, like `Header.to_dataframe`:
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
import pandas as pd
|
|
141
|
+
|
|
142
|
+
header_table = pd.DataFrame(
|
|
143
|
+
[(str(element.tag), element.keyword, element.VR, element.VM, element.value) for element in ds],
|
|
144
|
+
columns=["Tag", "Keyword", "VR", "VM", "Value"],
|
|
145
|
+
).set_index("Tag")
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Siemens private tags
|
|
149
|
+
|
|
150
|
+
pydicom knows the Siemens private dictionary, so private elements come back typed:
|
|
151
|
+
|
|
152
|
+
```python
|
|
153
|
+
block = ds.private_block(0x0019, "SIEMENS MR HEADER")
|
|
154
|
+
block[0x0A].value # NumberOfImagesInMosaic
|
|
155
|
+
block[0x0C].value # B_value
|
|
156
|
+
block[0x0E].value # DiffusionGradientDirection
|
|
157
|
+
block[0x28].value # BandwidthPerPixelPhaseEncode
|
|
158
|
+
block[0x29].value # MosaicRefAcqTimes (slice timing, ms)
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
The B matrix (`block[0x27]`) is stored as its 6 upper-triangle values. To get the 3×3 matrix:
|
|
162
|
+
|
|
163
|
+
```python
|
|
164
|
+
import numpy as np
|
|
165
|
+
|
|
166
|
+
upper_triangle = np.asarray(block[0x27].value, dtype=float)
|
|
167
|
+
b_matrix = upper_triangle[[0, 1, 2, 1, 3, 4, 2, 4, 5]].reshape(3, 3)
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Siemens CSA headers
|
|
171
|
+
|
|
172
|
+
dicom_parser's CSA parser now lives on as [csa_header][], and gives the same result. The only change is that each
|
|
173
|
+
tag's `index` field is gone (csa_header 2.0 dropped it):
|
|
174
|
+
|
|
175
|
+
```python
|
|
176
|
+
from csa_header import CsaHeader # pip install "csa_header>=2.0.1"
|
|
177
|
+
|
|
178
|
+
image_csa = CsaHeader(ds[0x0029, 0x1010].value).read()
|
|
179
|
+
series_csa = CsaHeader(ds[0x0029, 0x1020].value).read()
|
|
180
|
+
image_csa["B_value"]["value"]
|
|
181
|
+
protocol = series_csa["MrPhoenixProtocol"]["value"] # the parsed ASCCONV protocol
|
|
182
|
+
protocol["sDiffusion"]["lDiffDirections"]
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
To parse ASCCONV text yourself, `parse_ascconv` has the same signature and output in csa_header
|
|
186
|
+
(`csa_header.ascii.ascconv`) and in nibabel (`nibabel.nicom.ascconv`).
|
|
187
|
+
|
|
188
|
+
### Pixel data, mosaics and multi-frame images
|
|
189
|
+
|
|
190
|
+
```python
|
|
191
|
+
from pydicom.pixels import apply_rescale
|
|
192
|
+
|
|
193
|
+
pixels = apply_rescale(ds.pixel_array, ds) # applies RescaleSlope and RescaleIntercept
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
For Siemens mosaics and enhanced multi-frame images, nibabel unpacks and scales the data, and returns geometry that
|
|
197
|
+
matches it:
|
|
198
|
+
|
|
199
|
+
```python
|
|
200
|
+
from nibabel.nicom import dicomwrappers
|
|
201
|
+
|
|
202
|
+
wrapper = dicomwrappers.wrapper_from_file("image.dcm")
|
|
203
|
+
volume = wrapper.get_data() # a mosaic unpacked to 3D; a multi-frame image sorted into N-D
|
|
204
|
+
wrapper.affine # voxel indices to patient coordinates (DICOM LPS, mm)
|
|
205
|
+
wrapper.voxel_sizes
|
|
206
|
+
wrapper.slice_normal
|
|
207
|
+
wrapper.image_position
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
nibabel orders the axes differently from dicom_parser, so the arrays are transposed and flipped relative to
|
|
211
|
+
`Image.data`. The voxels are the same, and nibabel's affine matches nibabel's axes.
|
|
212
|
+
|
|
213
|
+
### Diffusion
|
|
214
|
+
|
|
215
|
+
For Siemens DWI, nibabel's wrapper gives the same voxel-space values dicom_parser computed:
|
|
216
|
+
|
|
217
|
+
```python
|
|
218
|
+
dwi = dicomwrappers.wrapper_from_file("dwi.dcm")
|
|
219
|
+
dwi.b_matrix # voxel space, as Image.voxel_space_b_matrix
|
|
220
|
+
dwi.q_vector
|
|
221
|
+
dwi.b_vector
|
|
222
|
+
dwi.b_value # as Image.voxel_space_b_value
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Series
|
|
226
|
+
|
|
227
|
+
```python
|
|
228
|
+
from pathlib import Path
|
|
229
|
+
|
|
230
|
+
import numpy as np
|
|
231
|
+
import pydicom
|
|
232
|
+
from pydicom.misc import is_dicom
|
|
233
|
+
from pydicom.pixels import apply_rescale
|
|
234
|
+
|
|
235
|
+
paths = [path for path in Path("series_directory").rglob("*") if path.is_file() and is_dicom(path)]
|
|
236
|
+
datasets = sorted((pydicom.dcmread(path) for path in paths), key=lambda dataset: dataset.InstanceNumber)
|
|
237
|
+
volume = np.stack([apply_rescale(dataset.pixel_array, dataset) for dataset in datasets], axis=-1)
|
|
238
|
+
echo_times = {dataset.EchoTime for dataset in datasets}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
`is_dicom` finds DICOM files by content, as `Series(path, mime=True)` did, without libmagic. To turn a series into a
|
|
242
|
+
NIfTI volume with correct geometry, use [dcm2niix][].
|
|
243
|
+
|
|
244
|
+
### Sequence detection and BIDS names
|
|
245
|
+
|
|
246
|
+
dcm2niix writes a JSON sidecar next to each volume (`dcm2niix -b y …`). Its `BidsGuess` field gives the BIDS data
|
|
247
|
+
type and entities, e.g. `["func", "_acq-epfid2p2m2_dir-AP_run-11_bold"]`, or `["discard", …]` for a localizer. To
|
|
248
|
+
organise a whole study into BIDS, use [HeuDiConv][], [dcm2bids][] or [BIDScoin][]. All three let you write the
|
|
249
|
+
rules that dicom_parser hard-coded.
|
|
250
|
+
|
|
251
|
+
### Verbose code strings
|
|
252
|
+
|
|
253
|
+
dicom_parser expanded some code strings (`Modality`, `PatientPosition`, `PatientSex`, `ScanningSequence`,
|
|
254
|
+
`SequenceVariant`), e.g. `"HFS"` to `"Head First-Supine"`. pydicom returns the codes themselves. If you need the long
|
|
255
|
+
forms, the tables are in [`src/dicom_parser/utils/code_strings/`](src/dicom_parser/utils/code_strings/) (MIT
|
|
256
|
+
licensed).
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## Known problems in dicom_parser's results
|
|
261
|
+
|
|
262
|
+
Comparing dicom_parser with the replacements on its own test files found these errors. If your results depend on
|
|
263
|
+
any of them, re-check them with the tools above.
|
|
264
|
+
|
|
265
|
+
* **`Image.affine` on Siemens mosaics** disagrees with dcm2niix's conversion by up to 283 mm for the same voxel. Its
|
|
266
|
+
slice normal points the opposite way, and the affine does not follow the axis flips that `Image.data` applies to
|
|
267
|
+
the mosaic. nibabel's affine for the same file agrees with dcm2niix.
|
|
268
|
+
* **`spatial_resolution`, and therefore `affine`,** take the slice size from `SliceThickness` rather than from the
|
|
269
|
+
spacing between slices, so they are wrong when slices have gaps
|
|
270
|
+
([#84](https://github.com/open-dicom/dicom_parser/issues/84)).
|
|
271
|
+
* **`Header.n_diffusion_directions`** always returns `None`.
|
|
272
|
+
* **`Header.phase_encoding_direction`** disagrees with dcm2niix for row (left–right) phase encoding: `i-` where
|
|
273
|
+
dcm2niix gives `i`.
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## Installing the last release
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
pip install dicom_parser
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
Version 1.3.0 supports pydicom 2.1 to 3.x and Python 3.9 to 3.14. It warns on import that the package is
|
|
284
|
+
deprecated. The [documentation site][] still describes the full API.
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## Credits
|
|
289
|
+
|
|
290
|
+
Written by Zvi Baratz during his PhD at Tel Aviv University, with contributions from
|
|
291
|
+
[@GalKepler](https://github.com/GalKepler), [@matthew-brett](https://github.com/matthew-brett),
|
|
292
|
+
[@taleinat](https://github.com/taleinat), [@Aharonyn](https://github.com/Aharonyn),
|
|
293
|
+
[@jstorrs](https://github.com/jstorrs), [@LilianYou](https://github.com/LilianYou) and
|
|
294
|
+
[@juliam98](https://github.com/juliam98). The CSA header parsing builds on nibabel's `nicom` module, and continues
|
|
295
|
+
in [csa_header][]. To cite dicom_parser, use its [Zenodo record](https://zenodo.org/badge/latestdoi/241392223).
|
|
296
|
+
|
|
297
|
+
[BIDScoin]: https://github.com/Donders-Institute/bidscoin
|
|
298
|
+
[csa_header]: https://github.com/open-dicom/csa_header
|
|
299
|
+
[dcm2bids]: https://github.com/UNFmontreal/Dcm2Bids
|
|
300
|
+
[dcm2niix]: https://github.com/rordenlab/dcm2niix
|
|
301
|
+
[HeuDiConv]: https://github.com/nipy/heudiconv
|
|
302
|
+
[nibabel]: https://github.com/nipy/nibabel
|
|
303
|
+
[pydicom]: https://github.com/pydicom/pydicom
|
|
304
|
+
[documentation site]: https://dicom-parser.readthedocs.io/
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# dicom_parser
|
|
2
|
+
|
|
3
|
+
> **dicom_parser is deprecated and no longer maintained.** Version 1.3.0 is the last release. It works with
|
|
4
|
+
> pydicom 2.1 to 3.x on Python 3.9 to 3.14, and it will get no further fixes. Everything it did is now covered
|
|
5
|
+
> by maintained tools. The guide below maps each feature to its replacement.
|
|
6
|
+
|
|
7
|
+
*dicom_parser* wrapped [pydicom][] to return "pythonic" values from DICOM headers, and added Siemens-specific
|
|
8
|
+
parsing: CSA headers, mosaics and diffusion vectors. Since it was written, pydicom 3, [nibabel][], [csa_header][]
|
|
9
|
+
and [dcm2niix][] have come to cover all of it, with active maintainers and wider testing.
|
|
10
|
+
|
|
11
|
+
* [Replacing dicom_parser](#replacing-dicom_parser)
|
|
12
|
+
* [Known problems in dicom_parser's results](#known-problems-in-dicom_parsers-results)
|
|
13
|
+
* [Installing the last release](#installing-the-last-release)
|
|
14
|
+
* [Credits](#credits)
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Replacing dicom_parser
|
|
19
|
+
|
|
20
|
+
| dicom_parser | Use instead |
|
|
21
|
+
|---|---|
|
|
22
|
+
| `Image`, `Header`: reading a file, dict-like access by keyword or tag | `pydicom.dcmread` and pydicom's `Dataset` |
|
|
23
|
+
| Parsed values (DS, IS, DA, TM, DT, PN) | pydicom: numbers are already `float`/`int` subclasses; dates and times with one config switch |
|
|
24
|
+
| `Header.keyword_contains`, `to_dict`, `to_dataframe` | `Dataset.dir`, `Dataset.to_json_dict`, a short pandas snippet |
|
|
25
|
+
| Siemens private tags by keyword (`B_value`, `MosaicRefAcqTimes`, …) | pydicom's `Dataset.private_block` |
|
|
26
|
+
| `CsaHeader`, `parse_ascconv` | [csa_header][] (`CsaHeader`), or `nibabel.nicom.ascconv.parse_ascconv` |
|
|
27
|
+
| `Image.data` (rescaling, Siemens mosaics, enhanced multi-frame) | `pydicom.pixels.apply_rescale`; nibabel's DICOM wrappers |
|
|
28
|
+
| `affine`, `slice_normal`, `spatial_resolution`, `image_position` | nibabel's DICOM wrappers |
|
|
29
|
+
| `b_matrix`, `q_vector`, `b_vector`, `b_value` | nibabel's DICOM wrappers |
|
|
30
|
+
| `Series` | a few lines of pydicom, or [dcm2niix][] for whole volumes |
|
|
31
|
+
| `detected_sequence`, `bids_path` | dcm2niix's `BidsGuess`; [HeuDiConv][], [dcm2bids][] or [BIDScoin][] for whole studies |
|
|
32
|
+
| Verbose code strings (`"MR"` → `"Magnetic Resonance"`) | none: pydicom returns the codes |
|
|
33
|
+
|
|
34
|
+
Each replacement below was checked against dicom_parser's own test files.
|
|
35
|
+
|
|
36
|
+
### Reading files and header values
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
import pydicom
|
|
40
|
+
|
|
41
|
+
pydicom.config.datetime_conversion = True # DA, TM and DT values become date/time objects
|
|
42
|
+
|
|
43
|
+
ds = pydicom.dcmread("image.dcm")
|
|
44
|
+
ds.ImagingFrequency # DS: already a float subclass
|
|
45
|
+
ds.InstanceNumber # IS: already an int subclass
|
|
46
|
+
ds.StudyDate # a datetime.date subclass
|
|
47
|
+
ds.PatientName.family_name # PN components
|
|
48
|
+
ds.get("MissingKeyword", "default")
|
|
49
|
+
ds[0x0018, 0x0050].value # access by tag
|
|
50
|
+
ds.dir("echo") # keywords containing "echo"
|
|
51
|
+
ds.to_json_dict() # the whole header as a dict
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Age strings such as `"027Y"` stay strings in pydicom. To get years:
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
AGE_UNITS_PER_YEAR = {"Y": 1, "M": 12, "W": 52.1429, "D": 365.2422}
|
|
58
|
+
age_in_years = float(ds.PatientAge[:-1]) / AGE_UNITS_PER_YEAR[ds.PatientAge[-1]]
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
For a table of the header, like `Header.to_dataframe`:
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
import pandas as pd
|
|
65
|
+
|
|
66
|
+
header_table = pd.DataFrame(
|
|
67
|
+
[(str(element.tag), element.keyword, element.VR, element.VM, element.value) for element in ds],
|
|
68
|
+
columns=["Tag", "Keyword", "VR", "VM", "Value"],
|
|
69
|
+
).set_index("Tag")
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Siemens private tags
|
|
73
|
+
|
|
74
|
+
pydicom knows the Siemens private dictionary, so private elements come back typed:
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
block = ds.private_block(0x0019, "SIEMENS MR HEADER")
|
|
78
|
+
block[0x0A].value # NumberOfImagesInMosaic
|
|
79
|
+
block[0x0C].value # B_value
|
|
80
|
+
block[0x0E].value # DiffusionGradientDirection
|
|
81
|
+
block[0x28].value # BandwidthPerPixelPhaseEncode
|
|
82
|
+
block[0x29].value # MosaicRefAcqTimes (slice timing, ms)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The B matrix (`block[0x27]`) is stored as its 6 upper-triangle values. To get the 3×3 matrix:
|
|
86
|
+
|
|
87
|
+
```python
|
|
88
|
+
import numpy as np
|
|
89
|
+
|
|
90
|
+
upper_triangle = np.asarray(block[0x27].value, dtype=float)
|
|
91
|
+
b_matrix = upper_triangle[[0, 1, 2, 1, 3, 4, 2, 4, 5]].reshape(3, 3)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Siemens CSA headers
|
|
95
|
+
|
|
96
|
+
dicom_parser's CSA parser now lives on as [csa_header][], and gives the same result. The only change is that each
|
|
97
|
+
tag's `index` field is gone (csa_header 2.0 dropped it):
|
|
98
|
+
|
|
99
|
+
```python
|
|
100
|
+
from csa_header import CsaHeader # pip install "csa_header>=2.0.1"
|
|
101
|
+
|
|
102
|
+
image_csa = CsaHeader(ds[0x0029, 0x1010].value).read()
|
|
103
|
+
series_csa = CsaHeader(ds[0x0029, 0x1020].value).read()
|
|
104
|
+
image_csa["B_value"]["value"]
|
|
105
|
+
protocol = series_csa["MrPhoenixProtocol"]["value"] # the parsed ASCCONV protocol
|
|
106
|
+
protocol["sDiffusion"]["lDiffDirections"]
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
To parse ASCCONV text yourself, `parse_ascconv` has the same signature and output in csa_header
|
|
110
|
+
(`csa_header.ascii.ascconv`) and in nibabel (`nibabel.nicom.ascconv`).
|
|
111
|
+
|
|
112
|
+
### Pixel data, mosaics and multi-frame images
|
|
113
|
+
|
|
114
|
+
```python
|
|
115
|
+
from pydicom.pixels import apply_rescale
|
|
116
|
+
|
|
117
|
+
pixels = apply_rescale(ds.pixel_array, ds) # applies RescaleSlope and RescaleIntercept
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
For Siemens mosaics and enhanced multi-frame images, nibabel unpacks and scales the data, and returns geometry that
|
|
121
|
+
matches it:
|
|
122
|
+
|
|
123
|
+
```python
|
|
124
|
+
from nibabel.nicom import dicomwrappers
|
|
125
|
+
|
|
126
|
+
wrapper = dicomwrappers.wrapper_from_file("image.dcm")
|
|
127
|
+
volume = wrapper.get_data() # a mosaic unpacked to 3D; a multi-frame image sorted into N-D
|
|
128
|
+
wrapper.affine # voxel indices to patient coordinates (DICOM LPS, mm)
|
|
129
|
+
wrapper.voxel_sizes
|
|
130
|
+
wrapper.slice_normal
|
|
131
|
+
wrapper.image_position
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
nibabel orders the axes differently from dicom_parser, so the arrays are transposed and flipped relative to
|
|
135
|
+
`Image.data`. The voxels are the same, and nibabel's affine matches nibabel's axes.
|
|
136
|
+
|
|
137
|
+
### Diffusion
|
|
138
|
+
|
|
139
|
+
For Siemens DWI, nibabel's wrapper gives the same voxel-space values dicom_parser computed:
|
|
140
|
+
|
|
141
|
+
```python
|
|
142
|
+
dwi = dicomwrappers.wrapper_from_file("dwi.dcm")
|
|
143
|
+
dwi.b_matrix # voxel space, as Image.voxel_space_b_matrix
|
|
144
|
+
dwi.q_vector
|
|
145
|
+
dwi.b_vector
|
|
146
|
+
dwi.b_value # as Image.voxel_space_b_value
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Series
|
|
150
|
+
|
|
151
|
+
```python
|
|
152
|
+
from pathlib import Path
|
|
153
|
+
|
|
154
|
+
import numpy as np
|
|
155
|
+
import pydicom
|
|
156
|
+
from pydicom.misc import is_dicom
|
|
157
|
+
from pydicom.pixels import apply_rescale
|
|
158
|
+
|
|
159
|
+
paths = [path for path in Path("series_directory").rglob("*") if path.is_file() and is_dicom(path)]
|
|
160
|
+
datasets = sorted((pydicom.dcmread(path) for path in paths), key=lambda dataset: dataset.InstanceNumber)
|
|
161
|
+
volume = np.stack([apply_rescale(dataset.pixel_array, dataset) for dataset in datasets], axis=-1)
|
|
162
|
+
echo_times = {dataset.EchoTime for dataset in datasets}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
`is_dicom` finds DICOM files by content, as `Series(path, mime=True)` did, without libmagic. To turn a series into a
|
|
166
|
+
NIfTI volume with correct geometry, use [dcm2niix][].
|
|
167
|
+
|
|
168
|
+
### Sequence detection and BIDS names
|
|
169
|
+
|
|
170
|
+
dcm2niix writes a JSON sidecar next to each volume (`dcm2niix -b y …`). Its `BidsGuess` field gives the BIDS data
|
|
171
|
+
type and entities, e.g. `["func", "_acq-epfid2p2m2_dir-AP_run-11_bold"]`, or `["discard", …]` for a localizer. To
|
|
172
|
+
organise a whole study into BIDS, use [HeuDiConv][], [dcm2bids][] or [BIDScoin][]. All three let you write the
|
|
173
|
+
rules that dicom_parser hard-coded.
|
|
174
|
+
|
|
175
|
+
### Verbose code strings
|
|
176
|
+
|
|
177
|
+
dicom_parser expanded some code strings (`Modality`, `PatientPosition`, `PatientSex`, `ScanningSequence`,
|
|
178
|
+
`SequenceVariant`), e.g. `"HFS"` to `"Head First-Supine"`. pydicom returns the codes themselves. If you need the long
|
|
179
|
+
forms, the tables are in [`src/dicom_parser/utils/code_strings/`](src/dicom_parser/utils/code_strings/) (MIT
|
|
180
|
+
licensed).
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Known problems in dicom_parser's results
|
|
185
|
+
|
|
186
|
+
Comparing dicom_parser with the replacements on its own test files found these errors. If your results depend on
|
|
187
|
+
any of them, re-check them with the tools above.
|
|
188
|
+
|
|
189
|
+
* **`Image.affine` on Siemens mosaics** disagrees with dcm2niix's conversion by up to 283 mm for the same voxel. Its
|
|
190
|
+
slice normal points the opposite way, and the affine does not follow the axis flips that `Image.data` applies to
|
|
191
|
+
the mosaic. nibabel's affine for the same file agrees with dcm2niix.
|
|
192
|
+
* **`spatial_resolution`, and therefore `affine`,** take the slice size from `SliceThickness` rather than from the
|
|
193
|
+
spacing between slices, so they are wrong when slices have gaps
|
|
194
|
+
([#84](https://github.com/open-dicom/dicom_parser/issues/84)).
|
|
195
|
+
* **`Header.n_diffusion_directions`** always returns `None`.
|
|
196
|
+
* **`Header.phase_encoding_direction`** disagrees with dcm2niix for row (left–right) phase encoding: `i-` where
|
|
197
|
+
dcm2niix gives `i`.
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Installing the last release
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
pip install dicom_parser
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Version 1.3.0 supports pydicom 2.1 to 3.x and Python 3.9 to 3.14. It warns on import that the package is
|
|
208
|
+
deprecated. The [documentation site][] still describes the full API.
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## Credits
|
|
213
|
+
|
|
214
|
+
Written by Zvi Baratz during his PhD at Tel Aviv University, with contributions from
|
|
215
|
+
[@GalKepler](https://github.com/GalKepler), [@matthew-brett](https://github.com/matthew-brett),
|
|
216
|
+
[@taleinat](https://github.com/taleinat), [@Aharonyn](https://github.com/Aharonyn),
|
|
217
|
+
[@jstorrs](https://github.com/jstorrs), [@LilianYou](https://github.com/LilianYou) and
|
|
218
|
+
[@juliam98](https://github.com/juliam98). The CSA header parsing builds on nibabel's `nicom` module, and continues
|
|
219
|
+
in [csa_header][]. To cite dicom_parser, use its [Zenodo record](https://zenodo.org/badge/latestdoi/241392223).
|
|
220
|
+
|
|
221
|
+
[BIDScoin]: https://github.com/Donders-Institute/bidscoin
|
|
222
|
+
[csa_header]: https://github.com/open-dicom/csa_header
|
|
223
|
+
[dcm2bids]: https://github.com/UNFmontreal/Dcm2Bids
|
|
224
|
+
[dcm2niix]: https://github.com/rordenlab/dcm2niix
|
|
225
|
+
[HeuDiConv]: https://github.com/nipy/heudiconv
|
|
226
|
+
[nibabel]: https://github.com/nipy/nibabel
|
|
227
|
+
[pydicom]: https://github.com/pydicom/pydicom
|
|
228
|
+
[documentation site]: https://dicom-parser.readthedocs.io/
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
Welcome to dicom_parser's documentation!
|
|
2
2
|
========================================
|
|
3
3
|
|
|
4
|
+
.. warning::
|
|
5
|
+
|
|
6
|
+
*dicom_parser* is deprecated and no longer maintained, and 1.3.0 is its last
|
|
7
|
+
release. The `README <https://github.com/open-dicom/dicom_parser#readme>`_
|
|
8
|
+
maps each feature to a maintained replacement (pydicom, nibabel,
|
|
9
|
+
csa_header and dcm2niix), and lists known problems in its results.
|
|
10
|
+
|
|
4
11
|
.. include:: overview.rst
|
|
5
12
|
.. include:: installation.rst
|
|
6
13
|
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
Release Notes
|
|
2
2
|
=============
|
|
3
3
|
|
|
4
|
+
1.3.0
|
|
5
|
+
-----
|
|
6
|
+
* Deprecated the package: this is the last release. See the README for a
|
|
7
|
+
maintained replacement for each feature. Importing *dicom_parser* now
|
|
8
|
+
emits a :class:`DeprecationWarning`.
|
|
9
|
+
* Added support for pydicom 3 and Python 3.9 to 3.14, and dropped Python 3.6
|
|
10
|
+
to 3.8.
|
|
11
|
+
* Fixed ASCCONV parsing on Python 3.14 (#127, by @juliam98).
|
|
12
|
+
* Detect the acquisition label of fieldmap scans for BIDS paths (#121, by
|
|
13
|
+
@GalKepler).
|
|
14
|
+
|
|
4
15
|
1.2.1
|
|
5
16
|
-----
|
|
6
17
|
* Fixed Siemens CSA ASCCONV header parsing (#85).
|
|
@@ -202,4 +213,4 @@ First release!
|
|
|
202
213
|
.. _Siemens mosaic:
|
|
203
214
|
https://nipy.org/nibabel/dicom/dicom_mosaic.html
|
|
204
215
|
.. _value-representation (VR):
|
|
205
|
-
http://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_6.2.html
|
|
216
|
+
http://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_6.2.html
|
|
@@ -1,42 +1,41 @@
|
|
|
1
1
|
[metadata]
|
|
2
2
|
name = dicom_parser
|
|
3
|
-
version = 1.
|
|
3
|
+
version = 1.3.0
|
|
4
4
|
author = Zvi Baratz
|
|
5
5
|
author_email = z.baratz@gmail.com
|
|
6
|
-
description = DICOM files parser meant to facilitate data access.
|
|
6
|
+
description = Deprecated: DICOM files parser meant to facilitate data access. See the README for maintained replacements.
|
|
7
7
|
long_description = file: README.md
|
|
8
8
|
long_description_content_type = text/markdown
|
|
9
9
|
license = MIT
|
|
10
10
|
license_files = LICENSE
|
|
11
11
|
keywords = dicom, dcm, mri, ct, radiology
|
|
12
|
-
url = https://github.com/
|
|
12
|
+
url = https://github.com/open-dicom/dicom_parser
|
|
13
13
|
project_urls =
|
|
14
|
-
Source = https://github.com/
|
|
14
|
+
Source = https://github.com/open-dicom/dicom_parser/
|
|
15
15
|
Documentation = https://dicom-parser.readthedocs.io/en/latest/
|
|
16
|
-
Bug Reports = https://github.com/ZviBaratz/dicom_parser/issues/
|
|
17
16
|
classifiers =
|
|
18
|
-
Development Status ::
|
|
17
|
+
Development Status :: 7 - Inactive
|
|
19
18
|
Intended Audience :: Science/Research
|
|
20
19
|
Intended Audience :: Healthcare Industry
|
|
21
20
|
License :: OSI Approved :: MIT License
|
|
22
21
|
Operating System :: OS Independent
|
|
23
22
|
Programming Language :: Python :: 3
|
|
24
|
-
Programming Language :: Python :: 3.6
|
|
25
|
-
Programming Language :: Python :: 3.7
|
|
26
|
-
Programming Language :: Python :: 3.8
|
|
27
23
|
Programming Language :: Python :: 3.9
|
|
28
24
|
Programming Language :: Python :: 3.10
|
|
25
|
+
Programming Language :: Python :: 3.11
|
|
26
|
+
Programming Language :: Python :: 3.12
|
|
27
|
+
Programming Language :: Python :: 3.13
|
|
28
|
+
Programming Language :: Python :: 3.14
|
|
29
29
|
Programming Language :: Python :: 3 :: Only
|
|
30
30
|
|
|
31
31
|
[options]
|
|
32
32
|
package_dir =
|
|
33
33
|
= src
|
|
34
34
|
packages = find:
|
|
35
|
-
python_requires = >=3.
|
|
35
|
+
python_requires = >=3.9
|
|
36
36
|
install_requires =
|
|
37
|
-
numpy
|
|
38
|
-
|
|
39
|
-
pydicom>=2.1,<2.4
|
|
37
|
+
numpy>=1.21
|
|
38
|
+
pydicom>=2.1,<4
|
|
40
39
|
|
|
41
40
|
[options.extras_require]
|
|
42
41
|
magic =
|
|
@@ -45,16 +44,14 @@ dist =
|
|
|
45
44
|
build
|
|
46
45
|
twine
|
|
47
46
|
docs =
|
|
48
|
-
sphinx
|
|
49
|
-
sphinx-rtd-theme
|
|
47
|
+
sphinx>=7
|
|
48
|
+
sphinx-rtd-theme>=2
|
|
50
49
|
pandas =
|
|
51
50
|
jinja2
|
|
52
51
|
pandas
|
|
53
52
|
test =
|
|
54
53
|
coverage[toml]>=6.2
|
|
55
|
-
|
|
56
|
-
pytest~=7.0
|
|
57
|
-
tox~=3.24
|
|
54
|
+
pytest>=7
|
|
58
55
|
%(magic)s
|
|
59
56
|
dev =
|
|
60
57
|
black~=22.1
|