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.0.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.0-cp313-cp313-musllinux_1_2_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

fw_file_rs-0.2.0-cp312-cp312-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

fw_file_rs-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

File details

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

File metadata

  • Download URL: fw_file_rs-0.2.0.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.0.tar.gz
Algorithm Hash digest
SHA256 2c4e46d1fe1adf0dfc200c533ffc3bd280cdcf9253423217fd2b1536b2fa80ef
MD5 9a3745fef30ee07c7aec6bf121f1a24a
BLAKE2b-256 5b0c8cd1eeaa7321a77d4f8bb5e76ff2b329a6ee6216376882011f4cf8965468

See more details on using hashes here.

File details

Details for the file fw_file_rs-0.2.0-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for fw_file_rs-0.2.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 bd5155bea6619b9b20b2af6a5d6fb126c476ccb8aa46c50930a3f21c45fd2832
MD5 5d6a0e342db11d38e4a79aa057e82aeb
BLAKE2b-256 a9b41accc9f8a4666c3eaa27ed6d955e7024fe832296b711dff395ee75d84d35

See more details on using hashes here.

File details

Details for the file fw_file_rs-0.2.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fw_file_rs-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e4815f66bff58957df7d828c9651e5c3a6ca09afc77ee3407657da92989d5595
MD5 e44e8b5891cf8281b156c6823a117deb
BLAKE2b-256 3b0f4da6baeb1837447ac3b3825a63e98528c7b9ea12b2118f2d223dcc64726d

See more details on using hashes here.

File details

Details for the file fw_file_rs-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fw_file_rs-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f34ea332d545037da5aae9699c8f070ff0c31e10f6cff7ed95151fc591bf8c93
MD5 36eae4fb178973a6153cd380a6f2630c
BLAKE2b-256 9584b0965eb68c8f0251342e9383eec3c595bbc67d56b93e74ca898084d0b92c

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