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.0.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.0.tar.gz.
File metadata
- Download URL: fw_file_rs-0.2.0.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 |
2c4e46d1fe1adf0dfc200c533ffc3bd280cdcf9253423217fd2b1536b2fa80ef
|
|
| MD5 |
9a3745fef30ee07c7aec6bf121f1a24a
|
|
| BLAKE2b-256 |
5b0c8cd1eeaa7321a77d4f8bb5e76ff2b329a6ee6216376882011f4cf8965468
|
File details
Details for the file fw_file_rs-0.2.0-cp313-cp313-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: fw_file_rs-0.2.0-cp313-cp313-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.13, 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 |
bd5155bea6619b9b20b2af6a5d6fb126c476ccb8aa46c50930a3f21c45fd2832
|
|
| MD5 |
5d6a0e342db11d38e4a79aa057e82aeb
|
|
| BLAKE2b-256 |
a9b41accc9f8a4666c3eaa27ed6d955e7024fe832296b711dff395ee75d84d35
|
File details
Details for the file fw_file_rs-0.2.0-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: fw_file_rs-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.12, 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 |
e4815f66bff58957df7d828c9651e5c3a6ca09afc77ee3407657da92989d5595
|
|
| MD5 |
e44e8b5891cf8281b156c6823a117deb
|
|
| BLAKE2b-256 |
3b0f4da6baeb1837447ac3b3825a63e98528c7b9ea12b2118f2d223dcc64726d
|
File details
Details for the file fw_file_rs-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: fw_file_rs-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.9, 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 |
f34ea332d545037da5aae9699c8f070ff0c31e10f6cff7ed95151fc591bf8c93
|
|
| MD5 |
36eae4fb178973a6153cd380a6f2630c
|
|
| BLAKE2b-256 |
9584b0965eb68c8f0251342e9383eec3c595bbc67d56b93e74ca898084d0b92c
|