Skip to main content

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) -> Dataset
  • Dataset access patterns:
    • ds.Rows
    • ds[(0x0028, 0x0010)]
    • ds["Rows"]
  • Dict-like operations:
    • get, in, iteration, keys, values, items
  • Properties:
    • pixel_array
    • file_meta
    • file_path
  • Exception classes:
    • DicomError
    • DicomReadError
    • TagNotFoundError
    • PixelDataError
    • UnsupportedTransferSyntaxError

Compatibility notes

  • Tag access returns direct values, not pydicom DataElement wrappers.
  • Date/time VR values remain strings (no automatic datetime conversion).
  • PixelData is 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


Download files

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

Source Distribution

fastdicom-0.1.0.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

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

fastdicom-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

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

Hashes for fastdicom-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0788f2370108a949b013a1ddd288dbdb6c1ce424fd23ced028d26cdd00676607
MD5 fd6f70b99e6023780244867f6bf91216
BLAKE2b-256 07ad4289bf55240e5e5e4cec7c31e8e69fb7b1a0bc256b97dae7871e5bde4c21

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastdicom-0.1.0.tar.gz:

Publisher: pypi-release.yml on beatrice-b-m/fastdicom

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastdicom-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fastdicom-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b7b35a2a5da8d5f0a599ff03840878b6bd4839c22794db22c07963a0dbcb8143
MD5 f4eee5ed4c9c93dcef01e05e92529a8c
BLAKE2b-256 44e15580fbb43c93007cc8e5855652055728801fdd846f089837b0df5b15c409

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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