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
fw_file_rs-0.2.1.tar.gz
(48.3 kB
view details)
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.1.tar.gz.
File metadata
- Download URL: fw_file_rs-0.2.1.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 |
30324bdb1e36f4b1693b42b904f65e05b834c357e4ae0bd9ba16c84aaa0c5cde
|
|
| MD5 |
b6be4cdfe9f9d2c9635199dcafea481c
|
|
| BLAKE2b-256 |
6b86fd2afb1dea53413f6a6577b4024f47030d4d2c96de95c8e78151e7e23df2
|
File details
Details for the file fw_file_rs-0.2.1-cp311-abi3-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: fw_file_rs-0.2.1-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 |
ac49b855591a45ec8dcd7dce3003322e5fac644d0fbb13f129c5021ae6b6e850
|
|
| MD5 |
5cc14228da6188b0434309ee295657f4
|
|
| BLAKE2b-256 |
71fc0ead1cd040f2c4e14e041e14c15c4991dc311b0c1f571d5067460c2767f7
|
File details
Details for the file fw_file_rs-0.2.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: fw_file_rs-0.2.1-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 |
dcb242abc8038990eb1d4e607adb9a30679f8db0311ebc7ebb98199f669fa2b0
|
|
| MD5 |
409d4a83e8a0ad304c99b1e757db66f0
|
|
| BLAKE2b-256 |
c37e79a63c77ff10f396536999db00b180508b19e86482d31af6b81bd89eb15b
|
File details
Details for the file fw_file_rs-0.2.1-cp311-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: fw_file_rs-0.2.1-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 |
17518ca5dea478cfcfa09c63132f47a23eb4eb7e599ceff2355c6fe60635f9dc
|
|
| MD5 |
702ad09756c869048136d7ec15da12dd
|
|
| BLAKE2b-256 |
1d193ba4afed115d6f0b53895baca8ec5ff14004646e967b7db1015ae4f2af3c
|