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.3.0.tar.gz (90.1 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.3.0-py3-none-any.whl (111.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dcmspec-0.3.0.tar.gz
  • Upload date:
  • Size: 90.1 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.3.0.tar.gz
Algorithm Hash digest
SHA256 7579f34a99a992a825dad2633eb9584e16c381ec80344999d2f337df5d3198e3
MD5 7a7fe887554e7d17eb6a08359b552675
BLAKE2b-256 ea3f1d11c1b6d825a5a95a7cad6a0d116c1c173a8a4b0d8eea15edf62bac4d86

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dcmspec-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 111.7 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c1936f6e36cf0d0fdd3cbf7e4e2b05ffe29ff9cf75cddeea1b336495a17447e
MD5 f94b22cf133a1ad35d3954326ad7855e
BLAKE2b-256 178f69bb1f496362536361f04a08ffb731f1f6e6acc2e3cb846ef7e50bf015db

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