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.4.0.tar.gz (151.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.4.0-cp311-abi3-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.11+Windows x86-64

fw_file_rs-0.4.0-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.4.0-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.4.0-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.4.0-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.4.0-cp311-abi3-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

fw_file_rs-0.4.0-cp311-abi3-macosx_10_12_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: fw_file_rs-0.4.0.tar.gz
  • Upload date:
  • Size: 151.4 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.4.0.tar.gz
Algorithm Hash digest
SHA256 54ab6c506c953111782a9eb40393f303b01ca6d51a7e3466f315220ff54d068f
MD5 43dbbd28c15c04fb4eda42ca72addd18
BLAKE2b-256 2d58540420848697aab639cd9d16d7c8f5361a744facc61bd224f48183a5bf94

See more details on using hashes here.

File details

Details for the file fw_file_rs-0.4.0-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: fw_file_rs-0.4.0-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for fw_file_rs-0.4.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3755cfffb01ce9f1e93a4d085846e9a3f05362cbee061df8904858dad6b3b63f
MD5 c45f1b5d9c174e695846be4d88b04f75
BLAKE2b-256 69bb834349150415ed4275535a493553d9b0733de04ee6230ef47c74b6941db8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.4.0-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 eb69365295b85af1babb39a0326abadc0592ce199eed4848d1bec101c8650e67
MD5 73da82b4c3e02b9a81ad828b636ee97b
BLAKE2b-256 d43eea27cc995af00368beaa0ed2b5ae12b98dc1278a8011307236936006d73c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.4.0-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 d62601d4197b9d3291b705f99a8701803312f9e57f05b7be748c754f18c36b37
MD5 6bc77c840c73fe9da295c7bbcdc0fe2a
BLAKE2b-256 06b44ef73f1cc9b6c15a3f77add21a5904bacb285b3f21273d162ce4ccb799e3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.4.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e57deef96d479ac3e1f86764b96ca2e58275759d0b1e8061fbf4dfb96833e1d4
MD5 7e12d09250dc0dc9ccd79285abdf5445
BLAKE2b-256 cbf02518fe49724dc2a4ff84e2bb1cd447139bda0e1248a8567d29bd6057bd02

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.4.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1d1e3074d888f1e9a9808c98cd4c8ae9e57d2bce31b530185b58e0f537c72e6a
MD5 30860c2f5de1e52d97196095166c429e
BLAKE2b-256 fe135001462d8124a9b4ddccdbb5ba3da6d2d1407ab6470aa73196b35e302420

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.4.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 35564924471f32841f4aef67aad7c45812a8f65b970f37d34210324809492880
MD5 995ad1196cfe47c474b43669bc9b8475
BLAKE2b-256 de00b1af015965d649d8b38c6a6b9fa766856eb939474ad45cc650dd2aa0a373

See more details on using hashes here.

File details

Details for the file fw_file_rs-0.4.0-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for fw_file_rs-0.4.0-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e32bb5b0be37ca43d5cc4e1ebb20270529b2501a57ee8ee4fb3b1911b416618f
MD5 5e4374298817da99fa848c2faba4c4bb
BLAKE2b-256 50f380d4b29057bcbcc8e683d1b227df10202be4e605e2f62c70b2161da10337

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