Skip to main content

Read, parse and de-identify DICOM files

Project description

fw-file-rs

Python bindings for the fw-file-rs Rust library.

Usage

from fw_file_rs import PyDeidProfile, get_dcm_meta

header_bytes = read_until_pixel_data("/path/to/dicom/file.dcm")
# extract metadata from a DICOM file
tags = [
    "StudyInstanceUID",
    "SeriesInstanceUID",
    # tags below are needed for splitting localizer
    "InstanceNumber",
    "ImagePositionPatient",
    "ImageOrientationPatient",
    "Rows",
    "Columns",
]
meta = get_dcm_meta(header_bytes, tags)
# group DICOM files by StudyInstanceUID and SeriesInstanceUID and split localizer
metas = [("1.dcm", meta)];  # list of (filename, meta data) tuples
groups = group_dcm_meta(metas, ["StudyInstanceUID", "SeriesInstanceUID"], True)

# de-identify a DICOM file using a YAML profile
yaml_profile = """
version: 1
name: profile
dicom:
fields:
- name: PatientName
  replace-with: REDACTED
"""
profile = PyDeidProfile.from_yaml(yaml_profile)
deid_header = profile.deid_dcm(header_bytes)

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

fw_file_rs-0.2.2.tar.gz (48.3 kB view details)

Uploaded Source

Built Distributions

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

fw_file_rs-0.2.2-cp311-abi3-musllinux_1_2_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ x86-64

fw_file_rs-0.2.2-cp311-abi3-musllinux_1_2_aarch64.whl (1.9 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ ARM64

fw_file_rs-0.2.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB view details)

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

fw_file_rs-0.2.2-cp311-abi3-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

File details

Details for the file fw_file_rs-0.2.2.tar.gz.

File metadata

  • Download URL: fw_file_rs-0.2.2.tar.gz
  • Upload date:
  • Size: 48.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for fw_file_rs-0.2.2.tar.gz
Algorithm Hash digest
SHA256 895f37e5b0680c891cc3506c4515504dfc2362da11636323c596f8d8049099d2
MD5 8d1ce76c69b1ff2db9fd42ad8ed14239
BLAKE2b-256 431353e617e6f4cc6b20e1890f16dd08e2afad0648f898562678a18d43ea9615

See more details on using hashes here.

File details

Details for the file fw_file_rs-0.2.2-cp311-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for fw_file_rs-0.2.2-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 406c08bc4f213a48ccfbd9b13a82d58a373d27a7a984f09281e1b98451dfe423
MD5 ec24164b689d465545dc7a601f72770b
BLAKE2b-256 f87ed319d9e4259d86bb8e1a6634bb710dcf37e45b066f4e31a52de408d860ba

See more details on using hashes here.

File details

Details for the file fw_file_rs-0.2.2-cp311-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for fw_file_rs-0.2.2-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 cca71fcd86191f74e70a5b50647578b2c656641b8ae0304ecd68e58881334664
MD5 ca9401b7fa11781b2e74a99e19b20b23
BLAKE2b-256 c9debf1ab6951243d0e64673b98c517746d2e9e350c5ce1a33134d0cf792a353

See more details on using hashes here.

File details

Details for the file fw_file_rs-0.2.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fw_file_rs-0.2.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d8a1b3eedec69514281062685c27bf352a9fff54ef641d6ccb06f868a8291c1b
MD5 7c32a925cc00f11d6b7eab33257cefaa
BLAKE2b-256 1c4714f5dc14053e06a9371a5c909623c2d20dd5ff4af7b410f4aba9afc65791

See more details on using hashes here.

File details

Details for the file fw_file_rs-0.2.2-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fw_file_rs-0.2.2-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9d522e01889dafadde01da978827f12b234b02e10a72daac7d56cb99ad17178e
MD5 93588db0ecc75d716732f6d220ff949f
BLAKE2b-256 9f5c810af1ac625118b0887a2c6e222815a0e7c030ee19e9fcd47465564a9e6c

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