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

File metadata

  • Download URL: fw_file_rs-0.3.2.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.2.tar.gz
Algorithm Hash digest
SHA256 539b7544528de41b41e1d0b594fe009d696f2cc168d07efdb03ddbc26352cbdb
MD5 88657caa50ea963c47b6e15d38fb336b
BLAKE2b-256 f92ea463b44eb530856b0a9c4ce405912cafaf6d98b60d9b59a26d9035e06e45

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.2-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6436414924a39d01110148e1ded08b432a18db1939f73b240c81c19bfa3ab061
MD5 265459ffe458dab032ed274d726cca5e
BLAKE2b-256 f487335e06466f7cf6b3f64a2350af1f04a8ca8eb394b61e3c461d0daa5c7c22

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.2-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 497c9a0ddf6fafebfcbcb5b859bb9fd19a4a2ca9142ee3b7055167911077938f
MD5 d5f55d547659bb6524f845bb7320695a
BLAKE2b-256 31729882d5b97c56c188daf4c44e71befc7ca45984419e51d0a96fd43f70fd92

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 74e377e178dba44fb53abbc608179c1e35bd5fdbcd62200a9f8fac9f2f325d0c
MD5 626ca81a6ff0bde9c02a8ec7134215f4
BLAKE2b-256 dab9e197da0de40c7e59d10bde6d6c13c32e43f99fd8a04961458fecfdc87f39

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.2-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0e8e3ed4fec8e07425d400e315d439de6cbe431ad53c58bf3829fb356addfaa8
MD5 4be7112e5d669daed67002f726e2aa91
BLAKE2b-256 5bcba3d59aa2a628c994bd3fa8d59c69b45a19d895cb616e9c254b8ce788494d

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