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 import PyDeidProfile, get_dcm_meta

dcm_bytes = read_until_pixel_data("/path/to/dicom/file.dcm")
# extract metadata from a DICOM file
tags = [
    "StudyInstanceUID",
    "SeriesInstanceUID",
    # tags below are needed for splitting localizer
    "InstanceNumber",
    "ImagePositionPatient",
    "ImageOrientationPatient",
    "Rows",
    "Columns",
]
meta = get_dcm_meta(dcm_bytes, tags)
# group DICOM files by StudyInstanceUID and SeriesInstanceUID and split localizer
metas = [meta]  # multiple meta
groups = group_dcm_meta(metas, ["StudyInstanceUID", "SeriesInstanceUID"], True)

# de-identify a DICOM file using a YAML profile
yaml = """
version: 1
name: profile
dicom:
fields:
- name: PatientName
  replace-with: REDACTED
"""
profile = PyDeidProfile.from_yaml(dcm_bytes)
result = profile.deid_dcm(dcm)

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.1.4.tar.gz (21.2 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.1.4-cp312-cp312-macosx_11_0_arm64.whl (973.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

fw_file_rs-0.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

File details

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

File metadata

  • Download URL: fw_file_rs-0.1.4.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fw_file_rs-0.1.4.tar.gz
Algorithm Hash digest
SHA256 a3f0837cd25f1aed022c83786f99d62a9e034343b78afa2b7ef0ad24e3c8b31d
MD5 776aa614fdb5210a967c41e735ca4ae5
BLAKE2b-256 fdd557e2577fc19b249358507e0bee0e950c94aced67aec04977e13becfdf35d

See more details on using hashes here.

File details

Details for the file fw_file_rs-0.1.4-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fw_file_rs-0.1.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6477cfa294d0d0d5abb3332b8bb859d61cb6b7a4e1a7e6b60ba75fa15fea72c4
MD5 d57fddbbf09699e5943c4425a8cd468c
BLAKE2b-256 ec49cc3a83ca0d487ddd419f381a5d0bb944ce465c6c67eb4b0549ce74d9d7e9

See more details on using hashes here.

File details

Details for the file fw_file_rs-0.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for fw_file_rs-0.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2ed837215be08981b536d3ba8d5535578f230d5c75fb85e4294e79f1782cdffe
MD5 38f7c66b9718b8eb241c239b88134ad3
BLAKE2b-256 ca82a772aa69ee906fc2751c88ef8790d4bcf6b3424773278c6b4771181cde8e

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