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.16.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.16-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.16-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.16-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.16-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.1 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARM64

fw_file_rs-0.3.16-cp311-abi3-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

fw_file_rs-0.3.16-cp311-abi3-macosx_10_12_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: fw_file_rs-0.3.16.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.16.tar.gz
Algorithm Hash digest
SHA256 33b52510dd1b846f88c654ab1be58c174402f9d4ff033a454749ea60d01d5aff
MD5 8162f35fb160467de40b9c796afed09a
BLAKE2b-256 27952ed914a5a77168d09ba006c589a92d986965f79525e92239939111b8715b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.16-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e0b6c03892e0507d3849a6d54e89d9548bbb29ecdc2fdc9fe8e37abbbd9c2275
MD5 5ca1dc6b2176e0713b20fef116cd6ca3
BLAKE2b-256 1d0ac9a3bcf159d30d709e8f5e12f2a0934885d3af35c60018f48d55c0c6ce24

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.16-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 37740b8f9e7cf0ea81106ac5429129517e2dabff91431e05f97a1878ebc3c08c
MD5 5a4e82939e61c49eedb20b131a91d960
BLAKE2b-256 390d86aa2544437393901c5e821924c2976680479077c290b91ec2277ebe0f6e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.16-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c050680c530da593eebd009e2655b37277b2d24aacdfcc5b2e118a5ca9f74b95
MD5 e544004e1f29d71534ce91cc13742eed
BLAKE2b-256 dcd27ceb3f45b7d2b43db6cf69cbb01aec1383cd9a16bdc4b345ecf71c206c67

See more details on using hashes here.

File details

Details for the file fw_file_rs-0.3.16-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for fw_file_rs-0.3.16-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 338e427bc3783a0131319f4db3ef9ea62daea08a869c2962e7cb19f57e6d08a1
MD5 2c41efe0a590fe58963870f20d2b6f34
BLAKE2b-256 650d44f30d3196a5c27aaaa641651b42517765a8c6f4cadd6bffe9a5c6086fcb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fw_file_rs-0.3.16-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2ddcc5db08a2acd5d4a153e3b23da2eb51bbeb04aaa900df56883f6a0cf5bdf0
MD5 8db6c351a8c98242052933f866996ded
BLAKE2b-256 997113610591b74a0deaae803830bee2178fac104962f6291473f384c33347c7

See more details on using hashes here.

File details

Details for the file fw_file_rs-0.3.16-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for fw_file_rs-0.3.16-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 cd0c1023e2fa0877ad5843d864c4e5ccc8fe7de288928d5ad0f183e28f3ead64
MD5 eaa1790d42c6228bc3bdab0d12423a2b
BLAKE2b-256 5811fb25bfc701c2fd6dde29ee838d5500e765cd4609f2798cb01126320b4264

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