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.15.tar.gz (151.1 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.15-cp311-abi3-musllinux_1_2_x86_64.whl (2.2 MB view details)

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

fw_file_rs-0.3.15-cp311-abi3-musllinux_1_2_aarch64.whl (2.1 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ ARM64

fw_file_rs-0.3.15-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB view details)

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

fw_file_rs-0.3.15-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.1 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARM64

fw_file_rs-0.3.15-cp311-abi3-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for fw_file_rs-0.3.15.tar.gz
Algorithm Hash digest
SHA256 4826192c54da6d1ddecfba6143b894f193b1374d8ad781ddf1374fdd9f3bab20
MD5 d5410e51471c2ab17c8e78fe034acaaf
BLAKE2b-256 670c3c7797f01dbf885fbc749047d50277a6747b84fc79963be2fbadbe15e66e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.15-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 1438cbd904d55c48061081d52671db4c4ea50bb9b752b75bc925867f0efacf7e
MD5 8265dc0bd7a5eafba3e1d1eff903e2df
BLAKE2b-256 4198dd4d589d177a6d6e607e716048fee33ceeb13d5438a5dc74e9c2e239ce32

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.15-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 2f48b84e232ead1453f1b030878813f27355abb62f664c8be69fccd912a501db
MD5 ca4eaa7222ccf15ff0866d1d4b1e4620
BLAKE2b-256 588311e46c7fc775f0b40a3662506736d56da147be4f4acdb9fb355046f31061

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.15-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4dcbbcc45cff9f1deb6dc055b82ea21095f1b48cedf1b49665f26eb8e41529ed
MD5 ff18382e35064e46f1043aafe223389f
BLAKE2b-256 13f69922e14676faa95bd2aa373808e1503355ce90431342891942a3b490ab77

See more details on using hashes here.

File details

Details for the file fw_file_rs-0.3.15-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for fw_file_rs-0.3.15-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4cdb46d5538b3b383c570c85d098d2a20f82a50ab332cd7d84bad4c9acda9b1b
MD5 cb2294b4dfa068fb4c649e475583072f
BLAKE2b-256 de2974feea6939c3fe6454fdcebf72f856eab255d42fc7c4c3beeb784b4a0ce2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.15-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 200d87bd657c9a47190adc9c8f837f9206a68c187308c35c12b3f5b2c107b2cd
MD5 cf86aae6835909b6d87b14b4c2c58017
BLAKE2b-256 524214d149e79126e34479ee45e5328bf4fcf5ee9f5a11891c32b07143efd982

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