Skip to main content

DicomMeta

dicommeta is a Python library for efficiently storing large amounts of Dicom Metadata

Installation

Use the package manager pip to install dicommeta.

pip install dicommeta

Usage

from pprint import pprint

from dicommeta.Utils import Mode
from dicommeta.Struct import Study, Series, Instance

new_dicom_study = Study(
                        StudyInstanceUID='1.3.6.1.4.1.14519.5.2.1.4334.1501.757929841898426427124434115918',
                        SpecificCharacterSet='ISO_IR 100',
                        StudyDate="20190701",
                        StudyTime='023750',
                        AccessionNumber='sdfk324234',
                        ReferringPhysicianName='Dr Strange',
                        PatientName='John Doe',
                        PatientID='A123',
                        StudyUID='study001',
                        PatientBirthDate='20000101',
                        mode=Mode.CT)

new_series01 = Series(seriesUID='series001')
new_series01.add_instance(Instance(SOPinstanceUID='Instance001'))
new_series01.add_instance(Instance(SOPinstanceUID='Instance002'))
new_series01.add_instance(Instance(SOPinstanceUID='Instance002'))
new_dicom_study.add_series(new_series01)
new_series11 = Series(seriesUID='series001')
new_series11.add_instance(Instance(SOPinstanceUID='Instance002'))
new_dicom_study.add_series(new_series11)
new_series11.add_instance(Instance(SOPinstanceUID='Instance003'))
new_dicom_study.add_series(new_series11)

new_series02 = Series(seriesUID='series002')
new_series02.add_instance(Instance(SOPinstanceUID='Instance002'))
new_series02.add_instance(Instance(SOPinstanceUID='Instance003'))
new_dicom_study.add_series(new_series02)

pprint(new_dicom_study.get_dict())
pprint(new_dicom_study.get_series(seriesUID='series002'))

new_study01 = Study(StudyUID='study002', StudyDate=['20200101'])
new_series03 = Series(seriesUID='series003')
new_series03.add_instance(Instance(SOPinstanceUID='Instance01'))
new_study01.add_series(new_series03)

study_list = [new_dicom_study, new_study01]

for study in study_list:
    for instance in study.series_dict:
        pprint(study.get_series(instance))
        print("")

print(new_dicom_study.get_series_ids())

print(new_dicom_study.study_datetime)
print(new_dicom_study.patient_age)

print(new_study01.study_datetime)
print(new_study01.patient_age)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Metadata

Release files for dicommeta 0.6.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dicommeta 0.6.7
File Size Uploaded Provenance
dicommeta-0.6.7.tar.gz 7.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for dicommeta 0.6.7
File Interpreter ABI Platform
dicommeta-0.6.7-py3-none-any.whl Python 3 none any Details

Total release size: 16.0 kB

Release files / dicommeta-0.6.7.tar.gz

Download URL dicommeta-0.6.7.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
bce14a8c4bee51a75de96d74796ab1856c1b5f72636f76ac061a416572663eff
BLAKE2b-256 checksum
How to use checksums
05a863aefd31c56fe434efa096fa55b0627108f81da0116a310ce05b2bfd4d79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.0 CPython/3.11.3 Darwin/22.4.0

Release files / dicommeta-0.6.7-py3-none-any.whl

Download URL dicommeta-0.6.7-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dba5f5304fd94340f48493e976dffc6f713278c6b16db910bf74046dd51ca009
BLAKE2b-256 checksum
How to use checksums
8a0aea47b560dc7a89f35af28e94b9b26a4b1913c9f6dd213d30c9ee6026175e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.0 CPython/3.11.3 Darwin/22.4.0

Security for dicommeta 0.6.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page