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.12.tar.gz (150.6 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.12-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.12-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.12-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.12-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.12.tar.gz.

File metadata

  • Download URL: fw_file_rs-0.3.12.tar.gz
  • Upload date:
  • Size: 150.6 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.12.tar.gz
Algorithm Hash digest
SHA256 3fedf0a55a73534b6cf6de06f80e7ab9ff649dc1e195160524ada1af21f01969
MD5 2d95d9945c2da58647931997941a4925
BLAKE2b-256 96e25336eb4f481136a1f01536f1065755e4171da776beb1179b124f6bd8df71

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.12-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 359a3c0c2144cc0276b2f0db6d029250bea6f18213906d10e0efbb3d755213dd
MD5 4d62425f9f1b3e2a9b117a186abd8037
BLAKE2b-256 1148fc554d5bcd7dfbff36f55be6e0b669eb69e21e22fa9011dd0a939a551002

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.12-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 b9d3c5c3693b6786a0fd6c41a5f3ea230930c3564232e03d512cc9c95eb88b2b
MD5 6f54262d3de405ef52a876ea10be10ef
BLAKE2b-256 6788d5df81d30662a14936c52b88fb404f3a8eabec97691fe1233c8966f5d510

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.12-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 18b83cad329459907892447e09c92c016288bfdb26e2d2ee6d2a1585568979be
MD5 17d935d032cc9adae7a68940cdfa8a1e
BLAKE2b-256 44252547cc1fde65bf7d3a34bfa00d36c16d42f9a7c59e2dc375b64447685323

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.12-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 aa8c4100f6d99a75c87343cf9e42e06804fbe3e46715c6ddadae34d273165fd5
MD5 19bcec7e533331ec23c77348400e0316
BLAKE2b-256 302d0a85b72b2b4ea64d9918f0f7f558befec0ae94e7130973909e076f2445f7

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