Toolkit for extracting, parsing, and processing DICOM specifications.
Project description
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:
- innolitics/dicom-standard: Tools and data for parsing and working with the DICOM standard in a structured format.
- pydicom/dicom-validator: A DICOM file validator based on the DICOM standard.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dcmspec-0.2.1.tar.gz.
File metadata
- Download URL: dcmspec-0.2.1.tar.gz
- Upload date:
- Size: 82.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1dec29cd4233a89bd05c56654c79083fe000d1b455afff34b3e7cbcf2c18368
|
|
| MD5 |
8231eabd2257a91c35cd424d940e654e
|
|
| BLAKE2b-256 |
99b7da8336eb9be366fc84d1bfd6939676433909913eabcfa6485ea2e5895188
|
File details
Details for the file dcmspec-0.2.1-py3-none-any.whl.
File metadata
- Download URL: dcmspec-0.2.1-py3-none-any.whl
- Upload date:
- Size: 104.2 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8400912ab9d3f535226b0d8734f1e417119303a1f84c268a656f950700cc9724
|
|
| MD5 |
41778d569ffc86897d622082e60439d7
|
|
| BLAKE2b-256 |
3ab7e314b8703bbfe0bd96b86e7916ab1ff4bfcea89d5f0cc19e093b47474daa
|