This gear reports on the Dicom files data elements and optionally fixes or enhances the problematic ones, generating a new archive.
Project description
Dicom Fixer
Description
This gear is responsible for reporting on the Dicom files data elements and optionally
fixing/enhancing the problematic ones and generating a new archive.
This gear utilizes the tracker
functionality of RawDataElements
in fw-file. Namely, it houses
a collection of default and custom callbacks that are applied to RawDataElements
on
read through pydicom
. More on callback below.
Usage
Inputs
- dicom: Input dicom
Configuration
- debug (boolean, default False): Include debug statements in output.
- tag (string, default:
dicom-fixer
): The tag to be added on input file upon run completion.
Callbacks
fw-file callbacks:
backslash_in_VM1_string_callback
: Fix value of RawDataElement with VM=1 and VR of type string that contains an invalid \ character (\ is the array delimiter in Dicom standard) and replaces with _. Use case is to handle non-compliant Dicom implementation that let e.g. SeriesDescription value containing .handle_none_VR
: A callback to handle VR = None.- Mirror the handling of pydicom pydicom.dataelement.DataElement_from_raw when VR is None but set VR to 'UN' for public tag that are not in the pydicom dictionary instead of raising a KeyError.
handle_un_VR
: A callback to handle VR=UN.- Mirror pydicom.dataelem.DataElement_from_raw when VR is UN but instead set VR to 'OB' when decoding value raises with the inferred VR.
converter_exception_callback
: A callback to catch NotImplementedError when raw_elem contains an invalid VR.
Custom callbacks:
handle_incorrect_unit
: Callback to fix known incorrect units- Currently only implemented to correct MagneticFieldStrength from milli-Tesla to Tesla.
Non-RawDataElement callbacks:
decode_dcm
: Mirrors pydicom.dataset.Dataset.decode, except it ignores decoding the OriginalAttributesSequence tag.
Contributing
For more information about how to get started contributing to that gear, checkout CONTRIBUTING.md.
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for fw_gear_dicom_fixer-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8df2e67b42463418e15d4960647bc04e80736302f1b59d08376c1565b1511b4 |
|
MD5 | b2c693a3d494bf78f585e183438b1bc1 |
|
BLAKE2b-256 | 76284da70d7884c4977dc9c854f089da38077286277787877beaf67e60ba99af |