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.9.tar.gz (58.9 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.9-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.9-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.9-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.9-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.9.tar.gz.

File metadata

  • Download URL: fw_file_rs-0.3.9.tar.gz
  • Upload date:
  • Size: 58.9 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.9.tar.gz
Algorithm Hash digest
SHA256 7c902768825dfce3b7334ddb0d0cb49fe9b8ba9e19a195174794c9e4ad2faa3e
MD5 de2a0417115cfcc68278863c690fd80b
BLAKE2b-256 9e98955a8932e379b8b212378d444878edeed55f8307e6090de5c89ecf734ced

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.9-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 75ee8e0e5647c970e182432e8f10dd620dbaaeb0c6e384e1bd6b70bc310975f5
MD5 67706c165767fbb0a2ba854c4db77065
BLAKE2b-256 3b420a5d0c0720bd087f706c940a241b49c28e28550e44c70ba2b2a0ac493219

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.9-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 ccfbbab58f79237559cb389c7e50c5c39dfe6c11c8777a519fff0f9ba5b12ee8
MD5 8cab8cb71ae5084aad64224057302ea1
BLAKE2b-256 70f444468244d1fb50aafd072694c41826a1c5bcad0d6df5c6f6e353919ea101

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.9-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 31c14fb3a54661db635b4b46581e6100fa9e1e84c2bdfca59097299caa08a137
MD5 b3abe956851a91819063f1e7275cddf2
BLAKE2b-256 eb745e32446d099ce7d1dfe8ba0de8d133dacf6ca7869d43a3e8c2f7fb008790

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.9-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b4f110d8ffb22ba35c713f6a4c9af0ba62d8ee25e9976630f7924441283ae3cc
MD5 744bf24c2926a4c68024d96157f79348
BLAKE2b-256 e24032509bee4213e4e388dd33fcd23b1ec5351f81c61b2410332a1dfa71b17b

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