ITK 5.4.8 has been released! Concurrent IO, Correct DICOM Geometry, and Sturdier Python Wrapping

We are pleased to announce the release of ITK 5.4.8!

ITK 5.4.8 is a maintenance release for this cross-platform, open-source toolkit for N-dimensional scientific image analysis with spatially-aware algorithms. This release focuses on correctness, concurrency, and compatibility. It removes a MetaIO deadlock that could stall heavily multithreaded reads, fixes DICOM series geometry when slice spacing is negative, and corrects pixel-type, codec, and endianness handling across HDF5, TIFF, and MATLAB IO. On the Python side, BSplineTransform is now wrapped for 2D and 4D, a double-free at interpreter shutdown is fixed, and the Windows wrapping build works with std::unique_ptr arguments again. :partying_face:

:flashlight: Highlights

  • Concurrency and Image IO:
    • MetaImage (.mha/.mhd) reads no longer call a process-wide fflush(nullptr), which could deadlock or stall concurrent reads, especially on macOS.
    • DICOM series with negative inter-slice spacing, for example when using the series reader’s ReverseOrder flag, now get the correct direction-cosine sign and keep their physical location. A new GoogleTest suite with more than 800 lines covers series direction handling.
    • HDF5ImageIO now reports a VECTOR pixel type when it infers multiple components, which fixes SimpleITK “Unknown PixelType” errors when reading vector images back.
    • TIFF ReadImageInformation() now succeeds for files that use a compression codec ITK was not built with. The error is raised in Read() instead, where decoding actually happens.
    • VNL’s MATLAB header reader now recognizes native big-endian single-precision files, so MatlabTransformIO and TxtTransformIO read them correctly on big-endian hosts.
  • Transforms:
    • AzimuthElevationToCartesianTransform::IsLinear() now returns false, so code no longer reduces this nonlinear transform to an incorrect matrix and offset.
    • Python dict_from_transform now recurses into nested CompositeTransform children, so their transforms are no longer dropped.
    • A possible undefined-behavior case in Transform::ApplyToImageMetadata is fixed.
  • Python Wrapping:
    • BSplineTransform is now wrapped for the 2D→2D and 4D→4D cases.
    • GradientImageFilter::OverrideBoundaryCondition and OptimizerParameters::SetHelper now transfer ownership correctly, which removes a double-free at interpreter shutdown.
    • MSVC builds now pass /Zc:__cplusplus when compiling SWIG wrappers, which restores std::move support for wrapped methods that take std::unique_ptr arguments.
  • Build and Platform Support:
    • VtkGlue builds against VTK 9.7 and later with VTK_USE_FUTURE_CONST.
    • Mangled libpng ARM NEON filter-row symbols prevent symbol clashes on ARM.
    • Module Doxygen cross-references use @ref, which silences the CMake 4.4 CMP0219 policy warning.
    • The ObjectFactory autoload entry-point name is now configurable through ITK_LOAD_FUNCTION_NAME, which supports builds that rename ITK’s symbols.
    • Remote-module pins were updated toward convergence with main, and release-5.4 stays buildable for SimpleITK.
  • Reliability:
    • Non-const image iterators now call the non-const GetBufferPointer(), so image types such as CudaImage are notified of writes.
    • Six registration and overlap tests now return their helper’s status. Previously they always returned success and hid 13 failure returns and 31 ITK_TEST_* assertions.
    • Repository safety-net pre-commit hooks are now enabled on release-5.4, along with cleanup of whitespace, end-of-file newlines, and Python shebangs.

:thread: Faster, Deadlock-Free Concurrent MetaIO Reads

MetaObject::ReadStream() and MetaForm::ReadStream() called fflush(nullptr) before parsing. This was left over from the original MetaIO code and predates multithreading. fflush(NULL) flushes every open FILE* stream in the process, and on platforms such as macOS it locks each stream in turn. When many threads opened and read their own MetaImage files, these global flushes competed for every other thread’s file handles. Concurrent reads could then slow to a halt indefinitely.

Reading does not require flushing previously written data, so ITK 5.4.8 removes the call. Applications that load many MetaImage files in parallel, such as data loaders for deep-learning training, should see reliable concurrent throughput.

:compass: Correct DICOM Series Geometry with Negative Spacing

When the spacing between DICOM slices was negative, the direction-cosine matrix had the wrong sign along the slice axis. This was easy to trigger with the series reader’s ReverseOrder flag. ITK 5.4.8 corrects the sign, so a DICOM series keeps its correct physical location whatever the slice order. A new regression suite, itkGDCMSeriesDirectionGTest, exercises a wide range of series orientations and orderings to guard against future regressions.

:snake: More Robust Python Wrapping

  • itk.BSplineTransform now offers [double, 2, 3] and [double, 4, 3] alongside the existing 3D instantiation, which enables Python B-spline registration workflows for 2D and 4D images.
  • Two methods store their raw-pointer argument in a std::unique_ptr member, but Python kept ownership too, so both sides freed the object. These methods now use SWIG DISOWN semantics, and new Python regression tests cover them.
  • MSVC reports __cplusplus as 199711L unless /Zc:__cplusplus is set, which made SWIG quietly turn std::move(x) into a copy. With the flag set on wrapper sources only, the Windows Python wrapping build compiles again, and ITK’s own build flags are unchanged.

:floppy_disk: Download

Python Packages

Install ITK Python packages with:

pip install --upgrade itk

Guide and Textbook

Library Sources

Testing Data

Unpack optional testing data in the same directory where the Library Source is unpacked.

Checksums and Signatures

:folded_hands: Acknowledgments

Thank you to contributors Axel Garcia, Bradley Lowekamp, Dženan Zukić, Hans J. Johnson, Matt McCormick, Sean McBride, Simon Rit, Valentin Boussot, and the broader ITK community for their code, testing, review, and documentation efforts.


:speaking_head: What’s Next

ITK 6 Release Candidate

Following the ITK 6 alpha and beta releases, the ITK 6 release candidate is coming. ITK 6 advances the toolkit with:

  • Architectural upgrades for contemporary C++ development
  • Enhanced template metaprogramming capabilities
  • Code modernization for improved readability and maintainability
  • A modernized Python platform and wrapping foundation

Many of the fixes in this release were first developed on main for ITK 6 and then backported. We encourage you to test the upcoming release candidate with your applications and report issues on the ITK issue tracker.

5.4 Maintenance Commitment

We remain dedicated to supporting current users through:

  • Regular security and regression patches
  • Critical bug resolution
  • Platform compatibility updates

Enjoy ITK!


ITK Changes Since v5.4.7

Bradley Lowekamp (6):

Enhancements

  • Add an empty .pre-commit-config.yaml for release-5.4 (f42c5d9951)

Bug Fixes

  • Fix case where DICOM series order has negative spacing (4925e7e209)
  • Set VECTOR pixel type in HDF5ImageIO when inferring components (f087aeb9b6)
  • Let ReadImageInformation succeed for unconfigured TIFF codecs (1e95ccb8e4)
  • Remove unnecessary global fflush(nullptr) causing MetaIO read deadlocks (183f3942e3)

Platform Fixes

  • Restore the SimpleITKFilters remote-module pin on release-5.4 (bc26367adb)

Dženan Zukić (3):

Enhancements

  • Wrap BSplineTransform for the 2D-2D and 4D-4D cases (6784ad458a)

Bug Fixes

  • Fix possible undefined behavior in Transform::ApplyToImageMetadata (1f6d811db5)
  • Fix SetData invoked with wrong parameter types in itkArrayTest (efe9aad60a)

Hans J. Johnson (22):

Enhancements

  • Add an extensive regression suite for the DICOM series direction-cosine fix (447711c824)
  • Cover the double-precision MATLAB header codes (247335a8e0)
  • Configure the ObjectFactory autoload symbol name (423c834b8c)

Bug Fixes

  • Recognize native big-endian single-precision MATLAB headers (65e1960182)
  • Disown Python objects adopted by unique_ptr members (0c0db75098)
  • Adapt VtkGlue extent callback to the VTK future-const signature (ecbc0bcad7)
  • Correct the superclass asserted for LabelOverlapMeasuresImageFilter (bcbac10fc9)
  • Propagate helper status in six registration and overlap tests (f5d420e739)

Platform Fixes

  • Pass /Zc:__cplusplus when compiling SWIG wrappers with MSVC (5777f01403)
  • Mangle libpng ARM NEON filter-row symbols (219bc36b89)
  • Use @ref for module Doxygen cross-references to silence CMP0219 (abb288f750)
  • Update remote-module pins toward buildable convergence with main (34853cf1ca)
  • Enable the pre-commit-hooks safety nets on release-5.4 (8e423c5c99)

Style

  • Remove trailing whitespace (512a30dfe0)
  • Add missing end-of-file newlines (6a98444503)
  • Replace hardcoded /usr/bin/python shebangs with env python3 (a962191781)
  • Use python3 in env shebangs (a4938eb6e2)
  • Correct the VNL_ModernizeNaming.py env path (8487393757)
  • Give VCL_ModernizeNaming.py a resolvable shebang (7c2f712e74)
  • Mark VCL_ModernizeNaming.py executable to match its shebang (37bf0fbedf)
  • Pin a GitHub link to a commit so it survives branch movement (27c1809028)
  • Remove the unused StripIncludes header-stripping scripts (ca38b5bb21)

Matt McCormick (3):

Enhancements

Documentation Updates

Sean McBride (1):

Platform Fixes

  • Fix build compatibility with VTK < 9.7 and VTK_FUTURE_CONST (11fb8e8416)

Simon Rit (1):

Bug Fixes

  • Call non-const GetBufferPointer() in non-const image iterators (626e9a3437)

Valentin Boussot (2):

Bug Fixes

  • Return false from AzimuthElevationToCartesianTransform::IsLinear() (074ec1e099)
  • Recurse into nested CompositeTransform children in dict_from_transform (e2f9a82c93)

ITK Python Package Changes

Axel Garcia (1):

Bug Fixes

  • Avoid re-extracting the ITK build cache for module dependencies (84c6c7fbdc)
4 Likes