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.3.tar.gz (83.3 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.3-py3-none-any.whl (104.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dcmspec-0.2.3.tar.gz
  • Upload date:
  • Size: 83.3 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.3.tar.gz
Algorithm Hash digest
SHA256 d1972c58175ec4d2da71b2962de7970cb94d0755e63821b91f18597e6251f5b1
MD5 bd3064e0d6115407886cae0131bdda46
BLAKE2b-256 f94605d3261ce5031749502fddd9e8b32e2aa153b11c439fe98b8030985f7606

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dcmspec-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 104.8 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4aeccccd3fd30449acf911b13650532447efe0a74a0a473f5affb013ca37ee0e
MD5 49e951a42112c9d21435778445c8e168
BLAKE2b-256 47ff90426e2b4872a1f9f4136a420b4794b27816b6a6ae387715bab87eb72983

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