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
header_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(header_bytes, tags)
# group DICOM files by StudyInstanceUID and SeriesInstanceUID and split localizer
metas = [("1.dcm", meta)]; # list of (filename, meta data) tuples
groups = group_dcm_meta(metas, ["StudyInstanceUID", "SeriesInstanceUID"], True)
# de-identify a DICOM file using a YAML profile
yaml_profile = """
version: 1
name: profile
dicom:
fields:
- name: PatientName
replace-with: REDACTED
"""
profile = PyDeidProfile.from_yaml(yaml_profile)
deid_header = profile.deid_dcm(header_bytes)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fw_file_rs-0.2.2.tar.gz.
File metadata
- Download URL: fw_file_rs-0.2.2.tar.gz
- Upload date:
- Size: 48.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
895f37e5b0680c891cc3506c4515504dfc2362da11636323c596f8d8049099d2
|
|
| MD5 |
8d1ce76c69b1ff2db9fd42ad8ed14239
|
|
| BLAKE2b-256 |
431353e617e6f4cc6b20e1890f16dd08e2afad0648f898562678a18d43ea9615
|
File details
Details for the file fw_file_rs-0.2.2-cp311-abi3-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: fw_file_rs-0.2.2-cp311-abi3-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.11+, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
406c08bc4f213a48ccfbd9b13a82d58a373d27a7a984f09281e1b98451dfe423
|
|
| MD5 |
ec24164b689d465545dc7a601f72770b
|
|
| BLAKE2b-256 |
f87ed319d9e4259d86bb8e1a6634bb710dcf37e45b066f4e31a52de408d860ba
|
File details
Details for the file fw_file_rs-0.2.2-cp311-abi3-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: fw_file_rs-0.2.2-cp311-abi3-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.11+, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cca71fcd86191f74e70a5b50647578b2c656641b8ae0304ecd68e58881334664
|
|
| MD5 |
ca9401b7fa11781b2e74a99e19b20b23
|
|
| BLAKE2b-256 |
c9debf1ab6951243d0e64673b98c517746d2e9e350c5ce1a33134d0cf792a353
|
File details
Details for the file fw_file_rs-0.2.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: fw_file_rs-0.2.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.11+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8a1b3eedec69514281062685c27bf352a9fff54ef641d6ccb06f868a8291c1b
|
|
| MD5 |
7c32a925cc00f11d6b7eab33257cefaa
|
|
| BLAKE2b-256 |
1c4714f5dc14053e06a9371a5c909623c2d20dd5ff4af7b410f4aba9afc65791
|
File details
Details for the file fw_file_rs-0.2.2-cp311-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: fw_file_rs-0.2.2-cp311-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.11+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d522e01889dafadde01da978827f12b234b02e10a72daac7d56cb99ad17178e
|
|
| MD5 |
93588db0ecc75d716732f6d220ff949f
|
|
| BLAKE2b-256 |
9f5c810af1ac625118b0887a2c6e222815a0e7c030ee19e9fcd47465564a9e6c
|