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

File metadata

  • Download URL: fw_file_rs-0.3.3.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.3.tar.gz
Algorithm Hash digest
SHA256 3e4d4e28659346772f8aec7576f102e315d7fcedddf21f4d282395ca7d3aacda
MD5 83864a2fce778f7ef3ea35941f84f987
BLAKE2b-256 14bc708eb5a250a9e2938c89de7fa5621151544a239bba8419270fdf8a00b2c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.3-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 3ce1ca5358d6de0e29d446350bd278d33845a739485444ff1aec8d925c8d83ed
MD5 53648d39c52d9cdd37ae5730cd9e6422
BLAKE2b-256 72e5c87f12fc225b394e83d5ebed1b024881a2dc5ab7ba5368c8884311790674

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.3-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 092f014a8b843089821e92baa354cbc62f952a7a1c2ac974f1721174f78a5441
MD5 c14dbbea726d614f9cb7bbaef057cfae
BLAKE2b-256 a63d240321b8ae72f0795765be6a40a7aa92e9d495d06ca9f9ea2e18ef858f55

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5a927a64d48a6401e155f93f46bab8af9baa698b093661e5a3b1b0fb62d60cab
MD5 90d84b17d0cf01764c74935850884947
BLAKE2b-256 c8a58690abe3101447949ddab07efe812b1a663d7c15e6cdc76decb3827cac10

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.3-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bc64d63a84dbfe218cab08117f3afa7693a4991d6d3a453e07b77c21d3fa8de2
MD5 13b60a3fcbeade3834e4db947f19875b
BLAKE2b-256 a487499b6a686d397dc1aa003355317d7f629976ea72e1cb0f0e953ab4b811c2

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