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 changeTransferSyntaxUIDto ExplicitVRLittleEndiantag(string, default:dicom-fixer): The tag to be added on input file upon run completion.
Output
File
DICOM-fixer will either output a fixed file to overwrite the input or will output nothing
QC
DICOM-fixer will add a QC result titled fixed to either the input file if no output is
written, or the output file if there is an output. The state will be either PASS or
FAIL:
PASSif either fixes were attempted and write was successful, or if no fixes were attempted.FAILif fixes were attempted but write was not successful.
For a PASS result, any fixing events will be under the events key.
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
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_gear_dicom_fixer-0.6.0-py3-none-any.whl.
File metadata
- Download URL: fw_gear_dicom_fixer-0.6.0-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.4.109+
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
586c9e3a12337f05eb19859a5908a4edd64d1a8409b9cae69b7662cff4441001
|
|
| MD5 |
3de66ff7e390cf4b2143ff4f2560f954
|
|
| BLAKE2b-256 |
56ad7d0ab711efd103d4db1b5f1fc458e5af1215eec3fdc8a90dc92f788f7e1d
|