Skip to content

ENH: Improve AnisotropicDiffusionLBR tests#6282

Merged
hjmjohnson merged 1 commit into
InsightSoftwareConsortium:mainfrom
hjmjohnson:improve-anisotropicdiffusionlbr-tests
May 22, 2026
Merged

ENH: Improve AnisotropicDiffusionLBR tests#6282
hjmjohnson merged 1 commit into
InsightSoftwareConsortium:mainfrom
hjmjohnson:improve-anisotropicdiffusionlbr-tests

Conversation

@hjmjohnson

@hjmjohnson hjmjohnson commented May 16, 2026

Copy link
Copy Markdown
Member

Closes #6283 (originally InsightSoftwareConsortium/ITKAnisotropicDiffusionLBR#26, @jhlegarreta).

Test-quality improvements for the ingested Modules/Filtering/AnisotropicDiffusionLBR: relocates the two test-only CLI headers out of include/, modernizes to ITK test macros, adds a LinearAnisotropicDiffusionLBRImageFilter GoogleTest, clarifies the usage message, removes noisy prints, and conforms to ITK style. All 16 image-regression baselines unchanged. Single squashed commit on current upstream/main.

Issue #6283 ask → change
Ask Change
1 Headers out of include/ CoherenceEnhancingDiffusionCommandLine.h folded into test/CoherenceEnhancingDiffusionTest.cxx (anon namespace); dead LinearAnisotropicDiffusionCommandLine.h removed, replaced by a GoogleTest
2 ITK test macros ITK_TRY_EXPECT_NO_EXCEPTION, ITK_GTEST_EXERCISE_BASIC_OBJECT_METHODS
3 Run-as-long-as-possible New GoogleTest uses non-fatal EXPECT_* (aggregated status); the 16 image-regression tests intentionally keep per-invocation CTest --compare status
4 Arg-check message Clear multi-line usage via itkGenericExceptionMacro (also fixes a latent silent-EXIT_SUCCESS on too-few-args)
5 Remove prints Progress-to-cout observer + parameter/timing noise + dead commented debug block removed
6 ITK style pre-commit run --all-files clean
Validation

Built with Module_AnisotropicDiffusionLBR only; all 16 functional --compare tests + Doxygen pass (baselines byte-identical), new LinearAnisotropicDiffusionLBRImageFilter.SmokeTest GoogleTest passes. KWStyle exercised by CI.

@github-actions github-actions Bot added type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots type:Enhancement Improvement of existing methods or implementation type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct area:Filtering Issues affecting the Filtering module labels May 16, 2026
@hjmjohnson
hjmjohnson marked this pull request as ready for review May 16, 2026 23:41
@greptile-apps

This comment was marked as resolved.

@hjmjohnson
hjmjohnson force-pushed the improve-anisotropicdiffusionlbr-tests branch from 0b29331 to b8c20fa Compare May 16, 2026 23:51
@hjmjohnson
hjmjohnson marked this pull request as draft May 16, 2026 23:52
@hjmjohnson
hjmjohnson force-pushed the improve-anisotropicdiffusionlbr-tests branch 2 times, most recently from fb69ed5 to 7af3d51 Compare May 17, 2026 17:41
Address the test-quality items tracked in InsightSoftwareConsortium#6283 (originally
ITKAnisotropicDiffusionLBR#26) for the ingested module:

- Relocate the two test-only command-line headers out of include/:
  CoherenceEnhancingDiffusionCommandLine.h is folded into
  test/CoherenceEnhancingDiffusionTest.cxx (anonymous namespace);
  the dead LinearAnisotropicDiffusionCommandLine.h is removed and
  replaced by a LinearAnisotropicDiffusionLBRImageFilter GoogleTest.
- Use ITK testing macros (ITK_TRY_EXPECT_NO_EXCEPTION,
  ITK_GTEST_EXERCISE_BASIC_OBJECT_METHODS).
- The new GoogleTest uses fault-tolerant non-fatal EXPECT_*
  assertions so all checks run and the status is aggregated; the
  16 image-regression tests intentionally keep per-invocation
  CTest --compare status.
- Replace the terse argument check with a clear itkGenericExceptionMacro
  usage message (also fixes a latent silent success on too-few args).
- Remove progress/parameter/timing prints and dead commented-out
  debug code.
- Conform to enforced ITK style.

All 16 image-regression baselines are unchanged.

Original test-improvement report by jhlegarreta:
ITKAnisotropicDiffusionLBR#26.

Closes InsightSoftwareConsortium#6283
@hjmjohnson
hjmjohnson force-pushed the improve-anisotropicdiffusionlbr-tests branch from 7af3d51 to 8f07f47 Compare May 17, 2026 17:47
@hjmjohnson
hjmjohnson marked this pull request as ready for review May 17, 2026 17:57
@hjmjohnson
hjmjohnson requested review from dzenanz and jhlegarreta May 18, 2026 12:26

@jhlegarreta jhlegarreta left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this Hans.

@hjmjohnson
hjmjohnson merged commit 12c0cb7 into InsightSoftwareConsortium:main May 22, 2026
20 checks passed
@dzenanz

dzenanz commented May 26, 2026

Copy link
Copy Markdown
Member

This is the most likely cause of:

CMake Error at CMake/ITKModuleTest.cmake:281 (target_link_libraries):
  Target "AnisotropicDiffusionLBRGTestDriver" links to:

    GTest::gtest

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  Modules/Filtering/AnisotropicDiffusionLBR/test/CMakeLists.txt:12 (creategoogletestdriver)

reported here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Filtering Issues affecting the Filtering module type:Enhancement Improvement of existing methods or implementation type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve AnisotropicDiffusionLBR tests

3 participants