Skip to content

Release Notes

1.0.0 [2025-10-07]

Enhancements:

  • Added fix-uids configuration option to control whether the gear attempts to fix invalid UI VR tags; replaces the previous allow-list-based approach with a boolean toggle.
  • Introduced GearArgs dataclass in parser.py to consolidate gear run arguments into a single structured object.
  • Added separate QC fail tracking (qc_fail) distinct from gear fail, allowing jobs to complete successfully while still reporting a FAIL QC state when required tags have invalid values that cannot be removed.
  • Improved pixel-data-check to skip files that lack pixel data entirely, logging a message rather than attempting to parse absent data.

Fixes:

  • Fixed QC result to correctly reflect FAIL when required DICOM tag values are invalid and cannot be removed, without causing the gear job itself to fail.
  • Fixed pixel-data-check to only attempt pixel array parsing when pixel data is actually present in the DICOM file.
  • Fixed events logging when required tag value cannot be removed.

Maintenance:

  • Renamed config keys standardize_transfer_syntax and force_decompress to standardize-transfer-syntax and force-decompress for consistency with kebab-case naming conventions.
  • Updated fw-file dependency from >=4.1.3,<5 to >=4.2.0,<5.
  • Updated PYTHON_VERSION from 3.13.1 to 3.13.7 in the build environment.
  • Unpinned git package version in Dockerfile to use the latest available.
  • Refactored parse_config return type from a tuple of individual values to a (GearArgs, bool) tuple.
  • Updated run.py and all tests to use the GearArgs dataclass interface.

Documentation:

  • Updated CONTRIBUTING.md to replace poetry instructions with uv equivalents, including updated commands for dependency management and environment setup.
  • Updated README.md to document the new fix-uids config option and the renamed force-decompress and standardize-transfer-syntax config keys.

Breaking Changes:

  • Renamed config key standardize_transfer_syntax to standardize-transfer-syntax; existing gear configurations using the old key name will not be recognized.
  • Renamed config key force_decompress to force-decompress; existing gear configurations using the old key name will not be recognized.
  • Changed UID fixing behavior: the previous allow-list approach for fix_uids has been replaced by the fix-uids boolean config; tags not on the former allow list that had invalid values will now be handled differently depending on the new setting.

0.11.3 [2025-07-17]

Fixes:

  • Updated fw-file to 4.1.3 to prevent the gear from attempting to set an OB VR with a non-bytes value

Maintenance:

  • Migrated from poetry to uv/hatchling for dependency management
  • Updated fw-file dependency from >=4.1.0 to >=4.1.3
  • Applied security patches in Dockerfile by upgrading base image packages and adding jq 1.8.0-r0 and git 2.50.1-r0

0.11.2 [2025-06-13]

Maintenance:

  • Added eolfix pre-commit hook to enforce end-of-line consistency, excluding fw_gear_dicom_fixer/standard/
  • Fixed missing end-of-file newlines in Dockerfile, .gitignore, README.md, and CONTRIBUTING.md

0.11.1 [2025-05-28]

Enhancements:

  • Added uid and gid (31337) configuration to manifest.json and switched to running the container as the flywheel user for improved security isolation

Fixes:

  • Upgraded setuptools to >=78.1.1 in Dockerfile to address security vulnerabilities

Maintenance:

  • Updated pytest from ^6.1.2 to ^7.2.0
  • Removed pinned PYTHON_SETUPTOOLS_VERSION (65.5.1) from manifest.json environment variables

0.11.0 [2025-04-04]

Enhancements:

  • Added rename-zip-members configuration option to rename zip archive members with the pattern {SOPInstanceUID}.{Modality}.dcm (default: True)
  • Added automatic disabling of pixel-data-check for RTSTRUCT modality inputs
  • Improved pixel data error logging to include the filename for easier debugging

Fixes:

  • Fixed PlanarConfiguration to 0 before JPEG decompression to prevent decompression errors
  • Fixed color space conversion to skip already-RGB images and raise a ValueError for unsupported bit depths greater than 8
  • Fixed no_dataelem_fixes context manager to correctly save and restore raw_VR_fixers and raw_value_fixers instead of the removed raw_elem_fixers
  • Fixed decompress call to use as_rgb=True and catch ValueError in addition to RuntimeError

Maintenance:

  • Upgraded fw-file from ^3.5.0 to ^4.1.0
  • Updated pydicom import of apply_color_lut and convert_color_space from pydicom.pixel_data_handlers to pydicom.pixels
  • Removed deprecated is_implicit_VR and is_little_endian assignments after decompression
  • Updated python environment from 3.13.0 to 3.13.1
  • Added end-to-end JPEG decompression test suite using matplotlib and scikit-image with SSIM image similarity validation
  • Added matplotlib and scikit-image as dev dependencies
  • Suppressed pydicom logger output introduced in 3.0.0

0.10.6 [2024-12-05]

Fixes:

  • Updated manifest.json env var

0.10.5 [2024-12-05]

Enhancements:

  • Added pixel-data-check configuration option to verify that DICOM pixel data is parsable; when enabled and the check fails, the job is marked unsuccessful and file tagging is skipped to prevent downstream gear rules from triggering.
  • Updated run() to return an exit code and call sys.exit() with the result, ensuring the gear process exits with a non-zero status on failure.
  • Updated events to be stored as list of dictionaries with tag and event keys

Fixes:

  • Fixed convert_color_space_fixer to use np.ptp() instead of the deprecated ndarray.ptp() method for pixel array normalization.
  • Fixed removed_duplicates condition to use explicit boolean comparison (len(to_del) > 0) and bool(uid_modifications) for accurate write criteria evaluation.

Maintenance:

  • Updated Dockerfile to use multi-stage build with flywheel/python-gdcm:sse base image, uv for package installation, and a separate dev stage.
  • Updated .dockerignore to include requirements*.txt pattern to support multiple requirements files.
  • Updated python from ^3.8 to ^3.10 and PYTHON_VERSION to 3.13.0 in the runtime environment.
  • Updated numpy from ^1.22.2 to ^2.1.
  • Updated fw-file from ^3.3.4 to ^3.5.0.
  • Updated pylibjpeg from ^1.4.0 to ^2.0.
  • Updated psutil from ^5.9.6 to ^6.0.0.
  • Removed python-gdcm git dependency from pyproject.toml.
  • Migrated CI configuration from sse-qa-ci to qa-ci pipeline reference.
  • Updated pre-commit hooks to add hadolint, jsonlint, and linkcheck, and expanded ruff lint selectors to include D, F, and PL rules.
  • Replaced pylint disable comments with noqa directives throughout the codebase.
  • Normalized Unicode zero-width space characters (\u200b) to their literal equivalents in DICOM standard JSON data files.
  • Added newline at end of DICOM standard JSON files.
  • Reformatted editions.json from a single-line array to a multi-line format.
  • Updated tests to use keyword arguments for run() calls and adapted assertions to the new list-of-dictionaries event format.

Documentation:

  • Added documentation for the new pixel-data-check configuration option to README.md, including supported transfer syntaxes and behavior on failure.
  • Added clarifying note to standardize_transfer_syntax documentation that the job will be marked as failed if the transfer syntax change fails.
  • Removed FAQ section reference from README.md.

0.10.4 [2024-07-26]

Enhancements:

  • Added detection and automatic repair of DICOM files missing sequence delimiters (FFFE, E0DD), with a corresponding QC event logged as output.
  • Improved DICOM loading to use strict validation mode on first read attempt, falling back gracefully on EOFError to capture and fix quietly-applied pydicom corrections.

Fixes:

  • Fixed standardize_transfer_syntax to return a consistent tuple ("", "") in the no-op code path, preventing unpacking errors in callers.
  • Removed false-positive decompression failure check that raised RuntimeError when max pixel value was 0.
  • Fixed misleading "Writing output because" log message that was previously constructed incorrectly due to operator precedence issues.
  • Fixed calculate_decompressed_size to handle read errors gracefully, returning 0 instead of raising an unhandled exception.

Maintenance:

  • Added libssl-dev, swig, and patchelf system packages to Dockerfile.
  • Switched python-gdcm dependency from PyPI to a custom flywheel-io git repository source.
  • Updated tests to pass config fixture and set reading_validation_mode = 2 for accurate validation behavior.
  • Added test coverage for EOFError and other exceptions during DICOMCollection initialization in main.py.

0.10.3 [2024-07-02]

Fixes:

  • Fixed UID generation to include subject label as an entropy source, improving uniqueness of generated SeriesInstanceUID and StudyInstanceUID values
  • Fixed handling of None return value from standardize_transfer_syntax to prevent unpacking errors

Maintenance:

  • Disabled DEBUG mode in CI by setting DEBUG to an empty string

0.10.2 [2024-06-25]

Enhancements:

  • Added rescaling of PALETTE COLOR to RGB conversion from 16-bit to 8-bit for ultrasound (US) and intravascular ultrasound (IVUS) modalities to ensure valid DICOM output.
  • convert_color_space_fixer() now returns the color space conversion description, enabling PhotometricInterpretation change events to be tracked and reported in gear output.

Documentation:

  • Updated README.md to document the 8-bit rescaling behavior for US and IVUS modalities with PALETTE COLOR photometric interpretation.

0.10.1 [2024-06-20]

Enhancements:

  • Added convert-palette gear config option to control whether palette color images are converted to RGB (defaults to true).

Fixes:

  • Made palette color conversion in convert_color_space_fixer opt-in via convert_palette parameter, with a warning logged when BitsAllocated must be changed from 8-bit to 16-bit during conversion.

Maintenance:

  • Updated fw-file from ^3.3.3 to ^3.3.4.

0.10.0 [2024-06-10]

Enhancements:

  • Added new-uids-needed config option to generate new SeriesInstanceUID and StudyInstanceUID based on acquisition and session labels, producing deterministic UIDs unique across sessions.

Maintenance:

  • Updated manifest.json source URL to point to the new repository location.
  • Added get_unique_UID helper to consolidate UID retrieval logic in metadata.py.
  • Expanded test coverage for new UID generation and config parsing.

0.9.7 [2024-04-15]

Enhancements:

  • Added output_configuration with enforce_file_version_match to manifest.json

Fixes:

  • Updated fw-file from ^3.3.2 to ^3.3.3

Maintenance:

  • Added gearcheck pre-commit hook with always_run: true
  • Added ruff_format and ruff_tests pre-commit hooks
  • Removed ruff --fix flag from linter configuration
  • Removed unused imports from test files and source modules
  • Applied minor whitespace and code style cleanup across source files

0.9.6 [2024-04-02]

Enhancements:

  • Updated run() to return the output filename alongside the events dictionary, enabling callers to reference the output file directly.
  • Added automatic file type classification: output DICOM files are now tagged with type="dicom" via context.metadata.update_file().
  • Updated manifest.json classification metadata to include function, modality, organ, species, and therapeutic_area fields.
  • Changed api-key input permission from read-only to writable.
  • Updated manifest source and url fields to reflect the new repository location.

Maintenance:

  • Updated tests to unpack the new (out_name, events) return value from run().
  • Added output filename assertions to test cases for zip_single behavior.

0.9.5 [2024-02-09]

Fixes:

  • Fixed frame count calculation in calculate_decompressed_size to correctly handle single-DICOM files missing NumberOfFrames by catching TypeError instead of AttributeError when accessing PerFrameFunctionalGroupsSequence

Maintenance:

  • Added test coverage for calculate_decompressed_size with single-DICOM input

0.9.4 [2024-01-12]

Fixes:

  • Fixed calculate_decompressed_size() to correctly handle DICOM collections with varying or missing tag values by using per-tag maximums instead of single values, preventing TypeError on mixed None values in Rows, Columns, SamplesPerPixel, and BitsAllocated tags

Maintenance:

  • Updated fw-file from ^3.3.0 to ^3.3.2
  • Added tests for calculate_decompressed_size() with mixed and missing tag values

0.9.3 [2023-11-29]

Fixes:

  • Fixed DICOM decoding for sequences of undefined length by explicitly setting parent_dataset and parent_seq attributes, resolving a pydicom 2.4.1 compatibility issue

Maintenance:

  • Replaced black and isort pre-commit hooks with ruff for linting and formatting

0.9.2 [2023-11-21]

Breaking Changes:

  • Changed the default value of strict-validation from False to True, enabling strict DICOM validation by default

0.9.1 [2023-11-08]

Enhancements:

  • Added force_decompress config option to allow forcing standardize_transfer_syntax decompression even when the file may be too large for available memory.
  • Added memory availability check before decompression, automatically disabling standardize_transfer_syntax if the estimated decompressed size exceeds available memory.
  • Added calculate_decompressed_size() utility to estimate DICOM decompressed size before processing.

Fixes:

  • Added AttributeError handling in standardize_transfer_syntax to catch decompression failures caused by large file sizes.
  • Fixed gear result to return FAIL state when decompression fails or file is too large for decompression.
  • Fixed docstring typo in run() (trailing l in parameter description) and clarified return value documentation.

Maintenance:

  • Updated fw-file dependency from ^3.0.0 to ^3.3.0.
  • Added psutil ^5.9.6 and humanize ^4.8.0 dependencies.
  • Added tests for AttributeError handling in standardize_transfer_syntax and run().
  • Added tests for force_decompress and memory-based standardize_transfer_syntax switching in parse_config.
  • Added test_utils.py with tests for calculate_decompressed_size.

0.9.0 [2023-09-11]

Enhancements:

  • Added color space conversion support after decompression, converting YBR_FULL_422, YBR_FULL, and PALETTE COLOR photometric interpretations to RGB for improved downstream compatibility.

Fixes:

  • Improved DICOM decompression to use GDCM as the default handler instead of pylibjpeg, with added validation to detect silent decompression failures where pixel data is empty after conversion.

Maintenance:

  • Added python-gdcm ^3.0.22 dependency for DICOM decompression support.
  • Added dicom-validator ^0.3.0 dependency.

Documentation:

  • Updated README.md to document color space conversion support, including supported PhotometricInterpretation values.

0.8.3 [2023-08-03]

Fixes:

  • Fixed fix_patient_sex to correctly handle empty PatientSex values by treating them as valid rather than attempting a replacement

Maintenance:

  • Updated fw-file from ^2.4.1 to ^3.0.0
  • Added test cases for empty PatientSex values in test_patient_sex_fixer

Documentation:

  • Expanded README.md with detailed gear classification, workflow diagrams, use case examples, config descriptions, prerequisites, and FAQ reference

0.8.1 [2023-07-28]

Maintenance:

  • Updated python from 3.9.7 to 3.11.2
  • Updated fw-file from ^2.4.0 to ^2.4.1
  • Updated PYTHON_PIP_VERSION from 21.2.4 to 22.3.1
  • Fixed test assertion for NonconformingDataElementValue to expect b"male" instead of "male"

0.8.0 [2023-07-25]

Enhancements:

  • Added dicom-standard configuration option to select between local and current DICOM standard edition.
  • Added strict-validation configuration option to enforce strict DICOM validation or allow Python-parsable values that may not meet the DICOM standard.
  • Added unique configuration option to enforce DICOM uniqueness by SOPInstanceUID or file hash, removing duplicate DICOMs.
  • Added zip-single-dicom configuration option to control whether a single DICOM is output as a .dcm.zip or .dcm file.
  • Added debug configuration option to manifest.json.
  • Added api-key input to manifest.json.

Fixes:

  • Improved DICOM decompression in standardize_transfer_syntax to use pylibjpeg handler explicitly with structured error logging on failure.

Maintenance:

  • Updated base Docker image from flywheel/python-gdcm:master.3a9476be to flywheel/python:main.fa0da4dd.
  • Added build-essential and rustup installation to Dockerfile.
  • Updated fw-file from ^2.3.0 to ^2.4.0.
  • Added pylibjpeg ^1.4.0 dependency with all extras.
  • Removed isort, pylint, and mypy dev dependencies.
  • Moved DICOM config initialization from main.py to parser.py to respect gear configuration at runtime.
  • Updated tests to support strict-validation and dicom-standard config options, including parameterized validation mode coverage.

0.7.5 [2023-06-29]

Fixes:

  • Fixed fix_patient_sex to properly match "other" as a valid PatientSex value and map it to "O", rather than falling through to the default case
  • Fixed fix_patient_sex to set PatientSex to an empty string instead of "O" when no close match is found for unrecognized values

Maintenance:

  • Updated fw-file from ^2.1 to ^2.3.0
  • Updated config.standard attribute to config.standard_path and added config.standard_rev set to "2023a"
  • Marked test_update_from_tracker_conforming and test_update_from_event_conforming tests as xfail pending fix in GEAR-4304

Documentation:

  • Added supported transfer syntax table to README.md for the standardize_transfer_syntax option

0.7.4 [2023-03-01]

Enhancements:

  • Improved is_dcm() to validate DICOM files by checking for required file-meta tags (FILE_META_TAGS) instead of counting public tags, with fallback to SOPClassUID presence.
  • Added population of missing SOPClassUID from MediaStorageSOPClassUID when not present in DICOM files.
  • add_missing_uid() now returns a detailed dict of modifications made (UIDs added and counts) instead of a boolean, and those modifications are included in output events.
  • TransferSyntaxUID changes are now included in output events, improving traceability of transfer syntax conversions.
  • Added early exit with informational log when no valid DICOMs are found in a collection.
  • Updated standardize_transfer_syntax() to use is_compressed check and dcm.dataset.raw.decompress() without a handler name, improving compatibility with available decompression handlers.

Fixes:

  • Fixed standardize_transfer_syntax() to guard against None localpath when constructing log messages.
  • Fixed is_dcm() to safely handle None localpath in log messages.

Maintenance:

  • Updated python version constraint from ^3.8,<3.11 to ^3.8,<4.
  • Updated pytest pre-commit hook and added PYTEST_COV_FAIL_UNDER: "90" CI coverage threshold.
  • Simplified test_standardize_transfer_syntax to require gdcm and assert correct results directly, removing the CSV failure-reporting fixture and deleting tests/test_file_failures.csv.

0.7.3 [2023-02-28]

Fixes:

  • Fixed standardize_transfer_syntax config key not being read correctly in parser.py (was incorrectly reading transfer_syntax)
  • Improved transfer syntax conversion logging to include filename and human-readable transfer syntax names instead of raw UIDs

Maintenance:

  • Added DICOM standard 2023a part03.xml reference document

0.7.2 [2023-02-17]

Maintenance:

  • Updated fw-file from ^1.4.0 to ^2.1

0.7.1 [2022-12-07]

Fixes:

  • Fixed update_modified_dicom_info to gracefully skip events where the DICOM tag or VR cannot be resolved, logging a debug message instead of raising an error
  • Updated add_modified_elem calls to include the VR parameter, aligning with the updated fw_file API

Maintenance:

  • Updated imports of ReplaceEvent and TrackedRawDataElement from fw_file.dicom.fixer to fw_file.dicom.reader
  • Refactored tests to use dcm.read_context.dataelem_dict instead of mocked tracker objects
  • Added test test_update_from_event_nonexisting_tag to cover graceful handling of unknown DICOM tags in event processing

0.7.0 [2022-11-21]

Enhancements:

  • Added DICOM signature detection priority over ZIP file detection to reduce false positives when processing files (GEAR-2841).
  • Added DICOM standard 2022d data bundled with the gear for offline validation support.
  • Added decoding support for file meta dataset in addition to the main dataset when walking DICOM elements.
  • Added vim to the Docker image for in-container editing.

Fixes:

  • Fixed update_modified_dicom_info to accept and propagate fix events, ensuring modified element tracking is correctly recorded via dcm.read_context.
  • Replaced manual OriginalAttributesSequence population with dcm.update_orig_attrs() to use the canonical fw_file API.
  • Fixed DICOM collection loading to raise a clear RuntimeError for files that are neither a DICOM nor a ZIP archive.

Maintenance:

  • Migrated Docker build from poetry to pip with a requirements.txt file, removing poetry run from the entrypoint.
  • Added .dockerignore to minimize build context.
  • Updated ReplaceEvent import from fw_file.dicom.fixer to fw_file.dicom.reader.
  • Updated CI configuration to use flywheel-io/scientific-solutions/etc/ sse-qa-ci.
  • Replaced internal tracker API (dcm.tracker, raw_elem_tracker) with dcm.read_context to align with updated fw_file internals.
  • Removed manual DICOM metadata helper functions (handle_tracker_event, handle_replace_event, add_non_conforming_element) in favor of fw_file library methods.

0.6.0 [2022-07-21]

Enhancements:

  • Added QC result with PASS/FAIL state to reflect whether fixes were successfully written; FAIL is now reported when fixes were attempted but writing failed.

Fixes:

  • Fixed no_dataelem_fixes context manager (renamed from empty_pydicom_callback) to also disable replace_un_with_known_vr and convert_wrong_length_to_UN during write validation, preventing unintended VR inference.
  • Added error handling in run() so that a write failure logs the exception, removes any partial output, and returns None instead of raising.

Maintenance:

  • Removed unused dev dependencies black, coverage, pycodestyle, and pydocstyle from pyproject.toml.
  • Added [tool.coverage.run] and [tool.pytest.ini_options] configuration to pyproject.toml.
  • Added tests for write-error handling and expanded no_dataelem_fixes context manager test coverage.

Documentation:

  • Added Output section to README.md describing file output behavior and QC result states (PASS/FAIL).

0.5.4 [2022-07-15]

Enhancements:

  • Updated file metadata reporting to use add_qc_result() with a structured PASS/FAIL state instead of add_gear_info(), improving QC result tracking for processed DICOM files.

0.5.3 [2022-06-27]

Enhancements:

  • Added zip-single-dicom config option (match, yes, no) to control whether a single DICOM output is saved as a .zip archive or a bare .dcm file.
  • Changed event aggregation to collect unique fix events per DICOM tag across the entire collection rather than per file, reducing noise in reported results.
  • Added processing progress logging showing file count and percentage completion.
  • Added trim_events to cap per-tag event lists at 10 entries, summarizing overflow with a count of remaining items.

Fixes:

  • Fixed duplicate-removal log message to correctly report when no duplicates are found instead of silently skipping.
  • Fixed output write criteria to correctly detect filename changes as a reason to write output.

Maintenance:

  • Updated flywheel-gear-toolkit dependency from ^0.5.9 to ^0.6.
  • Replaced add_qc_info / update_file_metadata calls in run.py with context.metadata.add_gear_info and context.metadata.add_file_tags.
  • Added get_output_filename helper to centralize output path logic.
  • Expanded and refactored test suite for run, get_output_filename, and parse_config.

Documentation:

  • Rewrote README.md Fixers section to document all applied fixes from fw-file and custom fixers, replacing the old Callbacks section.

0.5.1 [2022-06-06]

Enhancements:

  • Added unique configuration option to detect and remove duplicate DICOM files based on SOPInstanceUID or file hash.

Fixes:

  • Fixed output file naming to strip .zip suffix before determining the correct output format when writing processed files.

0.5.0 [2022-04-01]

Enhancements:

  • Added fix_patient_sex fixer to correct invalid PatientSex values using fuzzy matching, defaulting to O (other) when no match is found
  • Added fix_invalid_modality fixer to correct invalid Modality values using fuzzy matching against known DICOM modalities, defaulting to OT
  • Added apply_fixers function to apply all post-decoding fixers to a DICOM file
  • Added handle_warnings to aggregate and log repeated warnings across an archive with occurrence counts
  • Added support for NonconformingModifiedAttributesSequence in OriginalAttributesSequence to track non-conforming original values
  • Added api-key input to gear manifest for read-only API access
  • Changed run() return type from list to dict, keyed by filename for per-file event tracking

Fixes:

  • Fixed fix_incorrect_units (formerly handle_incorrect_unit) to operate as a post-decoding fixer rather than a pydicom callback, improving reliability
  • Fixed update_modified_dicom_info to correctly handle both tracker events and ReplaceEvent objects, including non-conforming values
  • Fixed empty_pydicom_callback to use fw_file config raw_elem_fixers instead of deprecated pydicom_config callback mechanism
  • Fixed OriginalAttributesSequence population to include SourceOfPreviousValues and NonconformingModifiedAttributesSequence
  • Fixed DICOM loading to set pydicom_config.settings.reading_validation_mode to IGNORE to avoid spurious read errors

Maintenance:

  • Replaced callbacks.py module with fixers.py, refactoring callback-based fixes into standalone fixer functions using fw_file ReplaceEvent
  • Updated fw-file from ^0.7 to ^1.3
  • Updated numpy from ^1.21.3 to ^1.22.2
  • Updated flywheel-gear-toolkit from ^0.2.1 to ^0.5.9 with flywheel extras
  • Added flywheel-sdk ^16.0.0 dependency
  • Removed tzlocal, pydicom direct dependencies (now provided transitively)
  • Replaced fw-gear-testing dev dependency with flywheel-sdk ^16.0.0
  • Updated Dockerfile to cache dependency installation layer separately from source copy for faster rebuilds
  • Enabled pylint pre-commit hook
  • Updated test fixtures to use flywheel_gear_toolkit.testing instead of fw_gear_testing
  • Replaced test_callbacks.py with test_fixers.py to cover new fixer module

0.4.1 [2022-03-16]

Enhancements:

  • Improved standardize_transfer_syntax to decompress compressed DICOM pixel data using gdcm before converting transfer syntax, ensuring correct handling of compressed files.
  • Output is now written when only the transfer syntax was updated, even if no other DICOM elements were modified.

Maintenance:

  • Added GPG_KEY environment variable to manifest.json.

0.4.0 [2021-10-29]

Enhancements:

  • Added standardize_transfer_syntax configuration option (boolean, default True) to decompress DICOM files and set TransferSyntaxUID to ExplicitVRLittleEndian.
  • Added automatic decompression of compressed DICOM PixelData using gdcm when compressed TransferSyntaxUID is detected.
  • Added standardize_transfer_syntax callback to set TransferSyntaxUID to ExplicitVRLittleEndian.
  • Added numpy ^1.21.3 dependency.

Fixes:

  • Fixed encoding handling in handle_incorrect_unit to correctly use default_encoding when no encodings are provided or when a string is passed instead of a list.
  • Fixed parse_config to return a resolved Path object via get_input_path instead of a raw input dict.
  • Fixed redundant context.get_input("dicom") call in run.py by reusing the already-fetched file_ variable when updating tags.

Maintenance:

  • Updated Dockerfile base image to flywheel/python-gdcm:master.3a9476be.
  • Updated CI configuration to use flywheel-io/tools/etc/qa-ci pipeline templates.
  • Updated python version constraint to ^3.8,<3.11.
  • Updated run function signature to accept dicom_path as a Path and transfer_syntax as a boolean directly.
  • Removed tests/Dockerfile in favor of updated CI tooling.
  • Improved test reliability for test_setup_callbacks and test_empty_pydicom_callback using try/finally blocks.

Documentation:

  • Updated README.md to document the new standardize_transfer_syntax config option and standardize_transfer_syntax callback.
  • Updated README.md to note that the gear decompresses compressed TransferSyntaxUIDs.

0.3.7 [2021-09-27]

Fixes:

  • Fixed is_dcm to handle AttributeError and TypeError exceptions when processing DICOM tags with unknown keywords

Maintenance:

  • Added test coverage for is_dcm with unknown/repeater DICOM tags

0.3.6 [2021-06-02]

Fixes:

  • Improved is_dcm callback to require at least 2 public DICOM tags outside the file meta group (0x0000 and 0x0002) for more reliable DICOM file detection.

Documentation:

  • Updated README.md to reflect the revised is_dcm definition for what constitutes a valid DICOM file.

0.3.5 [2021-06-01]

Enhancements:

  • Added is_dcm callback that filters non-DICOM files (e.g., Mac OSX .DS_Store files) from collections before processing.

Fixes:

  • Improved error reporting for multiple SeriesInstanceUID values by logging a count of each detected UID before exiting.
  • Changed multiple SeriesInstanceUID error handling to call sys.exit(1) instead of raising ValueError.

Maintenance:

  • Updated fw-file dependency from ^0.5 to ^0.7.

0.3.4 [2021-06-01]

Fixes:

  • Added force=True parameter to DICOMCollection.from_zip and DICOMCollection calls to improve handling of non-conformant DICOM files

0.3.3 [2021-05-28]

Fixes:

  • Fixed callback state not being properly restored when errors occur during DICOM processing by wrapping callback setup/teardown in context managers
  • Fixed potential interference between pydicom callbacks when writing original DICOM attributes by using empty_pydicom_callback context manager in update_modified_dicom_info

Maintenance:

  • Moved setup_callbacks from main.py to callbacks.py for better modularity
  • Added empty_pydicom_callback context manager to callbacks.py
  • Improved test coverage for setup_callbacks and empty_pydicom_callback in test_callbacks.py

0.3.2 [2021-05-27]

Fixes:

  • Fixed update_modified_dicom_info to skip writing DICOM data elements with invalid or unsupported VRs instead of raising a NotImplementedError

Maintenance:

  • Updated test fixtures to support passing additional keyword arguments to raw_data_elem generator
  • Added test coverage for invalid VR handling in update_modified_dicom_info

0.3.1 [2021-05-26]

Fixes:

  • Removed redundant modality argument from context.update_file_metadata() call

Maintenance:

  • Updated protected branch reference from master to main in pre-commit configuration

0.3.0 [2021-05-26]

Enhancements:

  • Added tag configuration option to apply a custom tag to the input file upon run completion (default: dicom-fixer).

Documentation:

  • Reorganized README.md to improve structure, moving Usage and Configuration sections to the top and correcting a typo in handle_incorrect_unit description.

0.2.1 [2021-05-05]

Documentation:

  • Updated README.md with full gear description, callback documentation, and corrected usage instructions for dicom-fixer
  • Added docstrings to handle_incorrect_unit and decode_dcm in callbacks.py
  • Updated manifest.json URL to point to README.md

0.2.0 [2021-05-05]

Enhancements:

  • Added decode_dcm callback to handle DICOM decoding while skipping OriginalAttributesSequence, preventing corruption of original attributes.

Fixes:

  • Fixed update_modified_dicom_info to only populate OriginalAttributesSequence when attributes were actually modified.
  • Fixed add_implementation to only update ImplementationClassUID and ImplementationVersionName when values differ from expected.
  • Fixed empty events list edge case in output condition that caused incorrect write behavior when no DICOM files had events.
  • Fixed exc_info logging call in handle_incorrect_unit to use keyword argument exc_info=True.

Maintenance:

  • Updated tests for add_implementation and update_modified_dicom_info to use proper fixture and FileDataset setup.

0.1.1 [2021-05-03]

Maintenance:

  • Enabled PYPI and DOCKER_HUB publishing in CI configuration.

0.1.0 [2021-05-03]

Enhancements:

  • Added fw_gear_dicom_fixer module with DICOM file fixing capabilities, including VR mismatch correction and MagneticFieldStrength unit normalization via handle_incorrect_unit callback.
  • Added add_missing_uid to detect and populate missing SeriesInstanceUID and SOPInstanceUID fields in DICOM collections.
  • Added update_modified_dicom_info to record OriginalAttributesSequence and implementation metadata on modified DICOM files.
  • Added support for processing both ZIP archives and single DICOM files in run().
  • Added QC info reporting via add_qc_info and file metadata updates using context.update_file_metadata in run.py.
  • Updated gear manifest to accept dicom file input instead of text-input, with DICOM type enforcement.

Fixes:

  • Fixed typo in CONTRIBUTING.md: "udpate" corrected to "update".

Maintenance:

  • Updated flywheel-gear-toolkit from ^0.1.3 to ^0.2.1.
  • Added pydicom ^2.1.2, fw-file ^0.5, and tzlocal ^2.1 as dependencies.
  • Added fw-gear-testing ^0.2 as a dev dependency.
  • Optimized Dockerfile layer caching by separating dependency installation from project source copy.
  • Added .idea/ to .gitignore.
  • Added tests/conftest.py with shared fixtures for DICOM collection and raw data element generation.
  • Added tests/test_callbacks.py, tests/test_metadata.py, and expanded tests/test_main.py with comprehensive DICOM fixer test coverage.
  • Updated tests/test_parser.py to reflect new parse_config return value.

Documentation:

  • Rewrote README.md to describe the DICOM fixer gear and added a Contributing section linking to CONTRIBUTING.md.

0.0.1 [2021-03-01]

Maintenance:

  • Set up project structure with poetry for dependency management using python ^3.8.
  • Added flywheel-gear-toolkit ^0.1.3 as core dependency.
  • Configured CI pipeline with .gitlab-ci.yml and pre-commit hooks including isort, black, pytest, and JSON validators.
  • Added Dockerfile based on python:3.8-slim for gear containerization.
  • Added test suite with pytest, pytest-cov, and pytest-mock.

Documentation:

  • Added README.md describing gear usage, inputs, and configuration options.
  • Added CONTRIBUTING.md with setup instructions for poetry and pre-commit.