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.4.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.4-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.4-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.4-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.4-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.4.tar.gz.

File metadata

  • Download URL: fw_file_rs-0.3.4.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.4.tar.gz
Algorithm Hash digest
SHA256 f8f6d4af647f27c83731fc08e9245d9de4bb2841bb5a674f7f8f030e9d66bd30
MD5 6fab01fd431f86be4ec76dc27608f346
BLAKE2b-256 dffef940ca3a7716875b4753e23b820466164b5da5f44e648e09afdfde921fa1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.4-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 4b261272d4c15e6ef69694d75eaf58fb09f5596fd2cad21007ed2808923849bf
MD5 2edc0cf8f15c7212168212e5a7c4c55a
BLAKE2b-256 c48ae350f71a9ae3b29381b22a96269cbd193a26aece100d4d88e2d2b33e9925

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.4-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 ff78a25d57e59aa761c3579156ecd5e7564e3c15062f2161fdd0f900bfbd5dd0
MD5 de028f83d11968b2177b835c631e220f
BLAKE2b-256 922fbfbb4d0289e6aea5057156e9bba2f95eb1b992e5708a120657da0d338a5a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.4-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3c442872e2a71cfc5fb57e9026742d5b1b81bb3b5e5b09134d66d088e9668197
MD5 7040a7aaa2060f003194f1bd8d4908fe
BLAKE2b-256 7a87efdd600eb137e6638fe9d27d8b7e6a329e713a0ed4aa7155523c084b76df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.4-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a62a1c1550a1137f2e65abac16ed4fa74b727d44739fd92e24a40610a26155c4
MD5 57e4c3dfa9d13876e079fe3aaf31d60c
BLAKE2b-256 449fb7a25478472eff65f2ab00fe11f54a228b3f898ded7a78b94be02ac6872e

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