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.
Dicom fixer will also decompress compressed TransferSyntaxes so that no issues are met on the platform downstream.
Usage
Inputs
- dicom: Input dicom
Configuration
debug
(boolean, default False): Include debug statements in output.standardize_transfer_syntax
(boolean, default True): Whether or not to changeTransferSyntaxUID
to ExplicitVRLittleEndiantag
(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.is_dcm
: This is a callback that works on the collection itself, filtering out and removing any files that don't look like a DICOM.- "Looks like a dicom" is defined as: Having at least 2 public dicom tags outside the file_meta (0x0000, and 0x0002) group.
standardize_transfer_syntax
: Sets the TransferSyntaxUID to ExplicitVRLittleEndian
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
Built Distribution
Hashes for fw_gear_dicom_fixer-0.5.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8650128761b995444008e36ea4bb3af6e9ffcbe2d80bd3eb86841c99f0ee6a1 |
|
MD5 | e2ce88a243cd2a93334b10944b35b061 |
|
BLAKE2b-256 | 6a4128fca9dad96061e11df2ac2b63a5f57b1f0dc2cbd214f34cd94845176373 |