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.13.tar.gz (151.7 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.13-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.3.13-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.3.13-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.3.13-cp311-abi3-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: fw_file_rs-0.3.13.tar.gz
  • Upload date:
  • Size: 151.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.8

File hashes

Hashes for fw_file_rs-0.3.13.tar.gz
Algorithm Hash digest
SHA256 e59a923ac902a62481b511032d52b592631b5683a7628b3c2cdb3f5b6016b252
MD5 89390aff555c45cfa9960782e15dcbb0
BLAKE2b-256 3069e590f56cb6ea6b5ca542a60ba6564d9c0015af24acf00a1669ef395a006b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.13-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ff6bcd42f02b52e40a7f2ddfc8d4d75ce05d5a47ee6458be9bc53eef6d65c177
MD5 a777d5c9df599b61d3ae85b6e1f7b0c8
BLAKE2b-256 f1a3834dc3ce84f0d37b525e8b4b87f11c3af7b92349f2a9df3741bd3c5c8d56

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.13-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 cf495af0980f45f84e65dafed73811ed00d94fe68f38e9fc0c96e428610c8ec4
MD5 97c360092ae765d1f769474791462359
BLAKE2b-256 bc58d67ff12b9bf1abf5443c975a61f805d5e6c27857857f9d8bdefd282b03da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.13-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7bdc5308623c8562a5e5b03ca6c9336aa78ea8806e92719dafa013a3810d3009
MD5 173c174353268c9036eaed052bdce882
BLAKE2b-256 f9d6c5d7ab721142f949089b8eca084f77963ce8e7d9327cbab4937d357c5105

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.13-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 43e77e9618fade6391b8cae29b41a6626a738610e84422ac57e63753aabb778a
MD5 10ce6b7d94cc2c139a95218275a89905
BLAKE2b-256 aaa95e676f0059c8fef2041d96076ffaa029a6a75bb48b1ed9f53163779e86dd

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