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.7.tar.gz (56.8 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.7-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.7-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.7-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB view details)

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

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

File metadata

  • Download URL: fw_file_rs-0.3.7.tar.gz
  • Upload date:
  • Size: 56.8 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.7.tar.gz
Algorithm Hash digest
SHA256 66b3a0d8cfeae6dfb94cd6f65d825aad02675948a54bab815acba13b3f764c10
MD5 336a65b27c62fed401b86c5a45f2a84c
BLAKE2b-256 bb1e89b7a0ab63ad55189ebf6ae54e8b1cca5d965ea5f96bc4bfc86ef20d2ded

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.7-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e3a3892b7e40e684a252ce001073d0c1b79d8241adada07af5be576205a42dd5
MD5 f1f0f99f66c17b9d68c8c72996c044d4
BLAKE2b-256 1a53369691ac5951164646341ef0478cfa5d84af1a77f237817199817e1394ad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.7-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 c178cd6c162cb3c1297a264bb789fdcd1299f48a3f81deb103330d50b4445897
MD5 cea23893d59ca00cf2d35f1a0db3a0a5
BLAKE2b-256 45b40c040754cb577e960248d06259bba095c73b52d8c231455fb8eb3d21eee4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.7-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0a7577f53ac6bcc654515e183d06332e2de6015431413bdd0bee65009a24a8a8
MD5 d4a0712913361d3c0917e22e8e93a935
BLAKE2b-256 0b17966df0727c9607aa92f2074d9bf6dc02d055897466b8d66433a8e17710b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.7-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b54bf16a1060de512206cb2ce0ce7fcf4fa8437d83049e2a09315b68fcf1b834
MD5 957bc6423af5ab1824a6f7c05260efb4
BLAKE2b-256 956b761ac69c985c7da7adc31e389a2f76da0aff241e7a88f3d6cbf852daee12

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