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.14.tar.gz (151.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.14-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.14-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.14-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.14-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.14.tar.gz.

File metadata

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

File hashes

Hashes for fw_file_rs-0.3.14.tar.gz
Algorithm Hash digest
SHA256 dfabece6b4359274a4fc5ad3efad23eb88c490b521685e7b9a073709dd85d49b
MD5 22f95c5272bf2602e9ba10443f2113de
BLAKE2b-256 6daff53d4a69d15e2c46e65117f6e66ee705da0b103a68372fdd3e746674cfff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.14-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 3a24b6c5f27d36ac4de983a19550c790866cdf3aab7979d4c6cbf18eccff1199
MD5 5cb111c547a01df7cbbd156b8a4848ec
BLAKE2b-256 e8951c0f65928edb93fd69688847d3901dad8340fa28d7c84751d6fd220b9cc3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.14-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 179314bbec4f0d035b578e8472775ac193dc19127754b32f602c5f1f987052de
MD5 396e066cc54e653a9287f24a7aeb7619
BLAKE2b-256 89238527d029d0b8bb7c4dc1b59d7d347d0d7bbdb195e69bc305ba25dba545f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.14-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a980773e2b509eeeb17ab3199f1ac415ae45c3ec6e315500b5eb15806a70b8db
MD5 bca300b1671ae21a505ffaf9a45a69d9
BLAKE2b-256 228efec789e7c931659dbcf4a772a662e690c16a6ceaa30d110628ef7a4dede0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.14-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 056afa33d19fa999b3ee0a773cd96bde42725046831feeeaf0e7ea8ccf80724c
MD5 434c50865a9634d3ae977a333316a126
BLAKE2b-256 238e8cf533f0ef1a8c7a15595ddeb7bd8988d868ee8eda38a3844143563c7b90

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