Skip to main content

Toolkit for extracting, parsing, and processing DICOM specifications.

Project description

tests PyPI version Python versions DOI

dcmspec

Overview

dcmspec is a versatile Python toolkit designed to provide processing of DICOM® specifications such as the DICOM standard or IHE profiles.

Designed as a general-purpose, extensible framework, dcmspec enables flexible extraction, parsing, and processing of DICOM specifications.

Features

  • An API to programmatically access, parse, and process DICOM and IHE specifications.
  • Command-Line Interface (CLI) sample scripts which extract, parse, and process specific DICOM and IHE specifications.
  • User Interface (UI) sample application for interactive exploration of DICOM IODs.

Note: CLI and UI sample applications are provided as developer examples and are not intended to be full-featured or production-grade applications.

Installation

To install the core package:

pip install dcmspec

For information on installing optional features (UI sample, PDF parsing), see the Installation Guide.

Quick Start

This example downloads and prints the DICOM Patient Module table as a tree:

from dcmspec.spec_factory import SpecFactory
from dcmspec.spec_printer import SpecPrinter

patient_module = SpecFactory().create_model(
    url="https://dicom.nema.org/medical/dicom/current/output/html/part03.html",
    table_id="table_C.7-1",
    cache_file_name="Part3.xhtml",
    json_file_name="patient_module.json",
)

SpecPrinter(patient_module).print_tree(
    attr_names=["elem_tag", "elem_type", "elem_name"], attr_widths=[11, 2, 64]
)

Note:
The first time you run this, the full DICOM Part 3 HTML file (~30MB) will be downloaded and parsed. Subsequent runs will use the cached file and be much faster.

Documentation

Documentation

Release Notes

See the Release Notes for a summary of changes, improvements, and breaking updates in each version.

Configuration

See Configuration & Caching for details on configuring cache and other settings.

Contributing

See CONTRIBUTING.md for guidelines and instructions on how to contribute to the project.

Similar Projects

There are a few great related open source projects worth checking out:

How dcmspec differs:

  • The above projects focus on parsing specific sections of the DICOM standard to support targeted use cases, such as browsing or validation.
  • dcmspec is designed with a broader scope. It provides a flexible framework for parsing any DICOM specification document, including the DICOM Standard itself, DICOM Conformance Statements, and IHE Integration Profiles.
  • The object-oriented architecture of dcmspec is extensible, making it possible to support additional sources, and to define custom structured data models as output.

DICOM® is the registered trademark of the National Electrical Manufacturers Association for its Standards publications relating to digital communications of medical information.

National Electrical Manufacturers Association (NEMA), Rosslyn, VA USA.
PS3 / ISO 12052 Digital Imaging and Communications in Medicine (DICOM) Standard.
http://www.dicomstandard.org

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dcmspec-0.2.2.tar.gz (82.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dcmspec-0.2.2-py3-none-any.whl (104.4 kB view details)

Uploaded Python 3

File details

Details for the file dcmspec-0.2.2.tar.gz.

File metadata

  • Download URL: dcmspec-0.2.2.tar.gz
  • Upload date:
  • Size: 82.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.0 CPython/3.13.7 Darwin/24.6.0

File hashes

Hashes for dcmspec-0.2.2.tar.gz
Algorithm Hash digest
SHA256 b726d5a0037af14a51fd22e1328f31734deff05abfb4bd1c97fc8541fd994536
MD5 69f34b390882d724a294084b94d0a28b
BLAKE2b-256 9d3fa6548fc4fe13feed2f67e0757c4bc713413cb8c396d65ddbb51f76a4920a

See more details on using hashes here.

File details

Details for the file dcmspec-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: dcmspec-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 104.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.0 CPython/3.13.7 Darwin/24.6.0

File hashes

Hashes for dcmspec-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b5f8ef0f8fd474ee322418a55c70c2d7e764a5c1c3724b6f7f29f990bbf6e585
MD5 2669b692cbaaf6f8a94408a28c39c733
BLAKE2b-256 e268df249454a67dd8994a6f4599c286871db826d01d4779ee388b7484ce6f3b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page