Skip to content

Restore ITK4/ITK5 compatibility in Testing/itkTestMain.h threading setup - #94

Draft
alexbuiss with Copilot wants to merge 2 commits into
masterfrom
copilot/fix-code-review-comment
Draft

alexbuiss with Copilot wants to merge 2 commits into
masterfrom
copilot/fix-code-review-comment

Conversation

Copilot AI commented Jul 23, 2026 •

Copy link
Copy Markdown

A review comment flagged that itkTestMain.h had moved to an ITK5-only threading API while this repository still targets ITK4 in build configuration. This updates the test driver to compile against both ITK4 and ITK5 without changing project-wide ITK requirements.

  • Compatibility fix

    • Added ITK version-gated threading includes and type selection in Testing/itkTestMain.h:
      • ITK5+: itkMultiThreaderBase.h / itk::MultiThreaderBase
      • ITK4: itkMultiThreader.h / itk::MultiThreader
    • Replaced direct itk::MultiThreader calls with a single compatibility alias.
  • Behavioral scope

    • No functional change to CLI flags (--with-threads, --without-threads); only API selection at compile time was adjusted.
#include "itkVersion.h"
#if ITK_VERSION_MAJOR >= 5
#  include "itkMultiThreaderBase.h"
typedef itk::MultiThreaderBase MultiThreaderType;
#else
#  include "itkMultiThreader.h"
typedef itk::MultiThreader MultiThreaderType;
#endif

MultiThreaderType::SetGlobalDefaultNumberOfThreads(numThreads);
Copilot AI changed the title [WIP] Fix code according to review comment Jul 23, 2026
Copilot AI requested a review from alexbuiss July 23, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants