Skip to content

BUG: Rename the two StructureTensorImageFilter classes to distinct names - #7061

Merged
hjmjohnson merged 2 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:bug-7057-rename-structuretensor
Nov 1, 2026
Merged

hjmjohnson merged 2 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:bug-7057-rename-structuretensor

Conversation

@hjmjohnson

@hjmjohnson hjmjohnson commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Rename the two unrelated StructureTensorImageFilter classes to GradientStructureTensorImageFilter (AnisotropicDiffusionLBR) and RieszStructureTensorImageFilter (IsotropicWavelets). Fixes #7057; the Python build also needs #7060.

Why a rename and not a merge

The classes are different algorithms. LBR's takes one image, computes the gradient itself, smooths with recursive Gaussians, and outputs a SymmetricSecondRankTensor image. IsotropicWavelets' takes two or more component images, uses a Gaussian window, and outputs eigenvectors plus eigenvalues in a VariableSizeMatrix image. Two names state that divergence. No alias is provided, since one would reintroduce the clash.

Blast radius
  • LBR's class is not wrapped and is used only by AnisotropicDiffusionLBRImageFilter. IsotropicWavelets' class is wrapped, so Python users of that module see the new name. The migration guide documents it.
  • A search of the 310 forest source trees found no source-level use of either class name. Module-level references only (MITK, CaPTk, BRAINSTools, SimpleITK).
Verification
  • 60 of 62 module-labeled ctest tests pass; the 2 not run are style checks.
  • All 11 cEED/cCED image-comparison tests pass against existing baselines, so LBR numerics are unchanged.
  • Both modules with Python wrapping, built on this branch merged with BUG: Support std::complex in Matrix and VariableSizeMatrix GetInverse #7060: 0 errors, and generated wrappers use only the new name.
  • pre-commit run --all-files passes. The tests ran before a plain rebase onto current main.
AI assistance
  • Tool: Claude Code
  • Role: comparison of the two classes, rename, tests, forest-wide search for users
  • All changes were reviewed and tested locally before committing.

@github-actions github-actions Bot added type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots area:Python wrapping Python bindings for a class 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 area:Documentation Issues affecting the Documentation module labels Oct 31, 2026

@dzenanz dzenanz 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.

Looks good on a glance.

@dzenanz

dzenanz commented Oct 31, 2026

Copy link
Copy Markdown
Member

Commit messages should not have AI-assistance trailers.

AnisotropicDiffusionLBR and IsotropicWavelets both defined
itk::StructureTensorImageFilter with the same include guard, so a build
enabling both modules used whichever header came first in the include
path, and Python wrapping of IsotropicWavelets resolved to the other
class and failed to compile.

The two classes are different algorithms. The AnisotropicDiffusionLBR
class takes one scalar or vector image, computes the gradient itself,
and outputs the tensor. Rename it to GradientStructureTensorImageFilter,
with its header, GTest, and users. The class is not wrapped and is used
only by AnisotropicDiffusionLBRImageFilter. The old name is not kept as
an alias, because an alias would reintroduce the clash.

Update the ITK 6 migration guide section for the renamed class.

Issue: InsightSoftwareConsortium#7057
@hjmjohnson
hjmjohnson force-pushed the bug-7057-rename-structuretensor branch from 8d0f627 to 8745c03 Compare October 31, 2026 23:12
@hjmjohnson

Copy link
Copy Markdown
Member Author

Removed the Assisted-by trailers from both commit messages (reword only, tree unchanged; content-only force-push, base not moved: 8d0f627..8745c03).

The class takes two or more component images (for example Riesz
components) and outputs per-pixel eigenvectors and eigenvalues, so it
differs from the AnisotropicDiffusionLBR class that shared its name.

The header, test, wrapping file, and wrapping list entry move with the
class. Template parameters, setters, and output are unchanged. The class
is wrapped, so Python users switch from itk.StructureTensorImageFilter
to itk.RieszStructureTensorImageFilter. No alias is kept, because it
would reintroduce the clash.

Add the rename to the ITK 6 migration guide.

Issue: InsightSoftwareConsortium#7057
@hjmjohnson
hjmjohnson force-pushed the bug-7057-rename-structuretensor branch from 8745c03 to 3e46477 Compare October 31, 2026 23:26
@hjmjohnson
hjmjohnson marked this pull request as ready for review October 31, 2026 23:26
@greptile-apps

greptile-apps Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The rename appears safe to merge, with no new defects found.

Summary

Gives the two unrelated tensor filters distinct names:

  • The LBR tensor filter is now named GradientStructureTensorImageFilter.
  • IsotropicWavelets callers use RieszStructureTensorImageFilter.

Callers, tests, include guards, and migration instructions follow the new names. No actionable issues were found. Builds and tests were not rerun.

Acknowledgments:

Reviews (1) · Last reviewed commit: "BUG: Rename IsotropicWavelets structure ..." · Reviewed by Greptile

@hjmjohnson
hjmjohnson merged commit a2df008 into InsightSoftwareConsortium:main Nov 1, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Documentation Issues affecting the Documentation module area:Filtering Issues affecting the Filtering module area:Python wrapping Python bindings for a class type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances 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.

BUG: AnisotropicDiffusionLBR and IsotropicWavelets both define itk::StructureTensorImageFilter

2 participants