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

File metadata

  • Download URL: fw_file_rs-0.3.1.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.1.tar.gz
Algorithm Hash digest
SHA256 69e4d8b6f1770eddd90c4e19a5e699818e38a799ecb3e5107201fa8dcaaf5dc3
MD5 b5b220b07d922d40821430c7a4045de7
BLAKE2b-256 63e3c22d40bb358449b0343b6297365195be5baa11ebffea82385314ab29ddb9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.1-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 8df3fb170bd0e5c17af1453452acb4842e5fa232683e1ae89b977df6080980a9
MD5 cc247fefd03e54d3452fe0ef91d52beb
BLAKE2b-256 ff499f2c1eb160f4689437c0b3dac64ca82cffa56b5247c56305ee22779b149b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.1-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 3c9798f920284e3320efd3f842fcefcb043a6e89d894a2df7700da680c4b13fe
MD5 e695a8e429255b09cde01f5ab30d2e72
BLAKE2b-256 5962c23585409263c6021ab8177941813b18ed961103a291feba9e3472584cdc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3760b89ef2e0de0ae1fc50d46bf21add6cf5c4c7d47b0d3f3d93a80ef13da734
MD5 af99282b475aa20aac3d68d892fa997f
BLAKE2b-256 89734da18fc325965c263ce69e6228f017663013912ac216c881881d6e56d9dd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.1-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 54e5a320c3e50e5963adce95f4bca3bd1585496e8d36c0accea5baf204af0c43
MD5 e3e511508e161f2140ee60b38686924d
BLAKE2b-256 9bd17e57c766913de15cb37dbd55ecfb67c4afb90f00c2259f041c5225427c67

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