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.dcm import Context, read_until_pixels

# Create a configured context using the builder pattern
ctx = (Context()
    .parse_include([
        "InstitutionAddress",
        "InstitutionName",
    ])
    .group_by(["StudyInstanceUID", "SeriesInstanceUID"])
    .split_localizer(True)
    .deid_profile("""
        version: 1
        name: profile
        dicom:
          fields:
            - name: PatientName
              replace-with: REDACTED
    """))
# Read DICOM header bytes from file
header_bytes = ctx.read_until_pixels("/path/to/dicom/file.dcm")
# Extract metadata using the configured context
meta = ctx.parse_header(header_bytes)
# Get Flywheel-specific metadata
fw_meta = ctx.get_fw_meta(meta)
# Group DICOM files by configured tags with localizer splitting
path_meta_pairs = [("1.dcm", meta)]
groups = ctx.group_series(path_meta_pairs)
# De-identify the DICOM header using the configured profile
deid_header = ctx.deid_header(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.3.8.tar.gz (57.6 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.3.8-cp311-abi3-musllinux_1_2_x86_64.whl (2.1 MB view details)

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

fw_file_rs-0.3.8-cp311-abi3-musllinux_1_2_aarch64.whl (2.0 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ ARM64

fw_file_rs-0.3.8-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.3.8-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.3.8.tar.gz.

File metadata

  • Download URL: fw_file_rs-0.3.8.tar.gz
  • Upload date:
  • Size: 57.6 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.3.8.tar.gz
Algorithm Hash digest
SHA256 9a619e69464cb0f161477f1e7cb737ad1ff99a1fa06f3b8ff5bb53b03a3211a2
MD5 31b5809ae22259a9dc012db855e1caef
BLAKE2b-256 442270337bb19656c1b7a3db54b87318761f4f3db11cc9f074d100f1a2050830

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.8-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a7fd402ebdc2bc59b533f0994ac06d0456b02c6887b2f155726c0ff78cff2a79
MD5 2490957634602de92852cc497994017f
BLAKE2b-256 368c0b58222bbba170115b9d6d20e82996a335aa3e597541f3d2d4e3462ac1c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.8-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 c5a8543ca417dd80f3ce4161d6ad17d38e736df3847f61f84bb756a16510fd7d
MD5 362deafd51bb7a740e09dfb66d76395f
BLAKE2b-256 0f667af57fc984f865336fe641611685cfd24a0af20c08cbf4b3f403ebd34423

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.8-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8c0b3469831f1e19b7168423e67dcaf30204ec3da6e10189953d67984ef02204
MD5 3c4e86aec3955a35c7c7071a5fdbce12
BLAKE2b-256 719d45bcd4fac6d043b9dae7a80cb07139b0183596fb1f628265196a82992f64

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.8-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fc4a0df45513e0e3783a6ed16f40297809236b03f7b3247b7d9f0527da0df16c
MD5 091c440dc05e7a0535f48a839966d076
BLAKE2b-256 5f37c8352b0d37c4f477fe5afeefd27c7ff10c90d6bd0d4e897187c140260199

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