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 fixers 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.
Fixers
The following fixes are applied:
General fixes from fw-file
- Fix VR for SpecificCharacterSet and surplus SequenceDelimitationItem tags.
- Replace VR=None with VR found in the public or private dictionaries.
- Replace VR='UN' with VR found in the public or private dictionaries.
- Replace invalid \ characters with _ in string VR values of VM=1.
- Crop text VRs which are too long.
- Fix an invalid UID. Determine if UID is semi-valid (e.g. composed of a minimum 5 nodes including invalid node starting with 0), if semi-valid, generates a new UID with the semi-valid UID as entropy source (deterministic), else, generates a new UID.
- Fix date times tags. Attempt to parse an invalid date and format correctly.
- Fix AS strings. Ensure one of D,W,M,Y is at end of the string, and pad to 4 characters. If no time quantifier is present, assume Years.
- Fix number strings. Fix DS (Decimal String) and IS (Integer String) number strings by removing invalid characters and truncate floats in IS VR.
- Fix invalid character. Attempt to remove non-printable characters from byte decoding.
- Fix invalid VR value. Try to fix an invalid value for the given VR.
- Fix LUT Descriptor tags.
Custom fixes
- Fix incorrect units. Correct MagneticFieldStrength from milli-Tesla to Tesla.
- Remove file in archive that are not likely DICOM (defined as having at least 2 public dicom tags outside the file_meta (0000, 0002) group).
- Optionally, 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.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2c344c1ba5ef80ea0de82abedc914db6736bead18288270bab701dd5648f78d |
|
MD5 | bad18cef82156452f3fad5e60aa6b5e9 |
|
BLAKE2b-256 | c5ad418f49101857ffb0cc26be60841be8489d6790dbe2e589e9e217a12b88bf |