ITK 5.4.8: Concurrent IO, Correct DICOM Geometry, and Sturdier Python Wrapping

November 20, 2026

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. 🥳

🔦 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.

🧵 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.

🧭 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.

🐍 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.

Leave a comment