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.11.tar.gz (60.1 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.11-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.11-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.11-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.11-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.11.tar.gz.

File metadata

  • Download URL: fw_file_rs-0.3.11.tar.gz
  • Upload date:
  • Size: 60.1 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.11.tar.gz
Algorithm Hash digest
SHA256 4239d40555deff8c37833a2f38fb78f769ffdb2c7b610007ee6d3515dcb5bed0
MD5 4506923be0188e0a8e0ce061a7b5a23b
BLAKE2b-256 8430c0436853ce4a5462b00ffea25cb878f97b6e690fd8466ced15deb08a18db

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.11-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a89a8f1fd90bbee7cd9b00ce9ab3cbd3aaa3e9dbf6e1161c877a745d3835d584
MD5 0ba409c52c5a522e95c9f5d2c4ac7d6b
BLAKE2b-256 e6d88d6b1c99352ac4fbbdd7e409ca2104b4d15450683357e2dfda627c0d1dda

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.11-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 ee31b6871885f8d5912604fc99390d79c68f7fb6a54e6df5cac162d23110c77d
MD5 766d8e135b59f09e3de925a4be7b8e25
BLAKE2b-256 dacea152e7871f95982b30e084f0da2e7dd4196edf72fa0c4ef43cd6fba39ccc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.11-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 46fb8d3aca1fc9044f8b4b0e6b5dc5173ff75295a4e541b4020542f7fc5194fd
MD5 ef553ebc9bc124f8a9ee988d3ab8e1be
BLAKE2b-256 b4f12db85e11762ebfe8efd54fd9ac5531df31af172521f2fced11ba65d417b9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.11-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0062e0cdd4f096646436e879fcadd8ab8ad4cec14089cce8e4daec74fea02965
MD5 16ea1f9d369407a0714ce5292de8d0b1
BLAKE2b-256 a58a6a063c478d327d04477ac740f8a9e30e19e92707cdb3c3887f8140036c77

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