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.5.tar.gz (55.4 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.5-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.5-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.5-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.5-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.5.tar.gz.

File metadata

  • Download URL: fw_file_rs-0.3.5.tar.gz
  • Upload date:
  • Size: 55.4 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.5.tar.gz
Algorithm Hash digest
SHA256 eef8fab2245d0f5479b49a5ea2e97baa22c29a9f3fc6972064a13263a9376787
MD5 f674306af26395e07d7a8cd5c6450a1b
BLAKE2b-256 4e1b0ae8b5963893f0e2ce25a8c0ddac3d50945e2696a8a38d521515dd0f8a37

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.5-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 afca7edcf92d7b0b4cba99091f0f4dc850449a23abb80c8db4e7cdaf5286a1b9
MD5 814cd653a1b1b3234a6c51bbe1b1ecb7
BLAKE2b-256 0b36527860f030c941c8683037bae6a6fe79a67cec7be5d773413554c3cf3187

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.5-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 2755020b708d93b986478ea332221e0ad0f5d323faaede4071a17bec88bfe68d
MD5 94170f70fd1a8a93244878b201701874
BLAKE2b-256 5d1bcf08a89969a759d24632167e8cfc4a6b63da95f3b6f5a767710c41f78dca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.5-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cfde4d7294df0a74418f40b738c59330fde2b221c28ec7d9a6f0e8683901f73b
MD5 72bc2429d8c13607655074d5478ce38e
BLAKE2b-256 499cd7109107992ad9c7c348f4fe98cd37a877610f2a6f8da53e375da2db915f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.5-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 625173e0d45dc8a5bceedea487bfb5abaa22bf725fd54fa8e85cf6b70366ed54
MD5 d50c857563917dc9fcc181f7ecde9c0f
BLAKE2b-256 d222e6afe435faabfd5b98686e0162f97158b0681d484ad7b524d9caea305b99

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