High-performance DICOM reader for ML pipelines
Project description
fastdicom
fastdicom is a Rust-backed Python extension module for high-throughput DICOM reads in ML and data processing pipelines.
It is built with PyO3 + maturin and uses dicom-rs for metadata parsing and pixel decoding.
Quickstart
python3 -m maturin develop
import fastdicom
ds = fastdicom.dcmread("study.dcm")
rows = ds.Rows
cols = ds[(0x0028, 0x0011)]
spacing = ds.get("PixelSpacing", None)
ts_uid = ds.file_meta.TransferSyntaxUID
pixels = ds.pixel_array
Implemented API surface
fastdicom.dcmread(path, *, stop_before_pixels=False) -> DatasetDatasetaccess patterns:ds.Rowsds[(0x0028, 0x0010)]ds["Rows"]
- Dict-like operations:
get,in, iteration,keys,values,items
- Properties:
pixel_arrayfile_metafile_path
- Exception classes:
DicomErrorDicomReadErrorTagNotFoundErrorPixelDataErrorUnsupportedTransferSyntaxError
Compatibility notes
- Tag access returns direct values, not pydicom
DataElementwrappers. - Date/time VR values remain strings (no automatic datetime conversion).
PixelDatais not directly exposed through tag lookup; use.pixel_array.
Explicit non-goals (v1)
- No write/mutation APIs (
save_as, Dataset mutation) - No DICOMDIR support
- No file-like object input (path-only read)
- No DIMSE/DICOMweb networking APIs
- No deferred reads / lazy file handles
- No overlay/curve/waveform features
Development checks
cargo check
python3 -m maturin develop
pytest -q
Project details
Release history Release notifications | RSS feed
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 fastdicom-0.1.0.tar.gz.
File metadata
- Download URL: fastdicom-0.1.0.tar.gz
- Upload date:
- Size: 1.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0788f2370108a949b013a1ddd288dbdb6c1ce424fd23ced028d26cdd00676607
|
|
| MD5 |
fd6f70b99e6023780244867f6bf91216
|
|
| BLAKE2b-256 |
07ad4289bf55240e5e5e4cec7c31e8e69fb7b1a0bc256b97dae7871e5bde4c21
|
Provenance
The following attestation bundles were made for fastdicom-0.1.0.tar.gz:
Publisher:
pypi-release.yml on beatrice-b-m/fastdicom
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fastdicom-0.1.0.tar.gz -
Subject digest:
0788f2370108a949b013a1ddd288dbdb6c1ce424fd23ced028d26cdd00676607 - Sigstore transparency entry: 1265636688
- Sigstore integration time:
-
Permalink:
beatrice-b-m/fastdicom@f0b421ffb940283a94905961a3b4a22d4db9e859 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/beatrice-b-m
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-release.yml@f0b421ffb940283a94905961a3b4a22d4db9e859 -
Trigger Event:
release
-
Statement type:
File details
Details for the file fastdicom-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: fastdicom-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7b35a2a5da8d5f0a599ff03840878b6bd4839c22794db22c07963a0dbcb8143
|
|
| MD5 |
f4eee5ed4c9c93dcef01e05e92529a8c
|
|
| BLAKE2b-256 |
44e15580fbb43c93007cc8e5855652055728801fdd846f089837b0df5b15c409
|
Provenance
The following attestation bundles were made for fastdicom-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
pypi-release.yml on beatrice-b-m/fastdicom
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fastdicom-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
b7b35a2a5da8d5f0a599ff03840878b6bd4839c22794db22c07963a0dbcb8143 - Sigstore transparency entry: 1265636775
- Sigstore integration time:
-
Permalink:
beatrice-b-m/fastdicom@f0b421ffb940283a94905961a3b4a22d4db9e859 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/beatrice-b-m
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-release.yml@f0b421ffb940283a94905961a3b4a22d4db9e859 -
Trigger Event:
release
-
Statement type: