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.10.tar.gz (59.5 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.10-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.10-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.10-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.10-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.10.tar.gz.

File metadata

  • Download URL: fw_file_rs-0.3.10.tar.gz
  • Upload date:
  • Size: 59.5 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.10.tar.gz
Algorithm Hash digest
SHA256 1039f2c96abd9b8c6923246a92b5ddaee3c2472e3dfe7076fda63fbf2be85a19
MD5 9fa1b44cba9ad591f984a9b61b391536
BLAKE2b-256 128e0b506cf5b27e06f6ccf550a5d8096ae5665781f04ed58c46a002f7cbd71c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.10-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 80fd02ec4f94239402668daa8d007db4a8302179637aadd143a7f6abf0e55939
MD5 ae8fe059d1be677fa7cb24f022de0947
BLAKE2b-256 e5f3c9b5634417059f36207a1416c9d7643e0b184578b981c9d390d7aa79bc1f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.10-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 1771051d340abcb8d6692dcfe863763a83925654b05c917e714085308499ae85
MD5 3ce295cb814a79aa30e6097f071f9116
BLAKE2b-256 f763f851e3edfe938f82ab889417ac5a662701549cbe22bb69bbc4abc28c4763

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.10-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f410c58ca2ec053bd1e081f46320e6b3083f462f8ccca1559896f7623caff16d
MD5 f5a512fa22b390dc9468717cb00583dd
BLAKE2b-256 d82178b4dc940017f661f86c6a7b18d5894fd9337ccb1ff026e8db0118df89fa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.10-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 852627f372698590f44bff953d1590e88d6e3d085471e7c26ebba5aa4dd290ed
MD5 ae98b7352b85add3e2552f07502affd5
BLAKE2b-256 19f1edc18fb7f81422159e72d7b6e0829a61c4937a3ccc18751233b06dc5582b

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