You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BUG: AnisotropicDiffusionLBR and IsotropicWavelets both define itk::StructureTensorImageFilter #7057
Two modules define itk::StructureTensorImageFilter in headers with the same name and the same include guard, so a build that enables both cannot use both classes, and Python wrapping fails to compile.
Both modules are EXCLUDE_FROM_DEFAULT, so only builds that enable both are affected. With both enabled and ITK_WRAP_PYTHON=ON, the IsotropicWavelets wrapper resolves to the other class:
Wrapping/Modules/IsotropicWavelets/itkStructureTensorImageFilterPython.cpp: error: no member named 'SetNoiseScale' in
'itk::StructureTensorImageFilter<itk::Image<float>, itk::Image<itk::VariableSizeMatrix<double>>>'
(also SetFeatureScale and SetRescaleForUnitMaximumTrace, which are AnisotropicDiffusionLBR's setters). Both headers use the include guard itkStructureTensorImageFilter_h, so any translation unit that includes both silently gets whichever comes first in the include path, and the two classes violate the one-definition rule.
Possible fixes
Both are public API, so each option renames something users may refer to:
Rename the AnisotropicDiffusionLBR class (for example LBRStructureTensorImageFilter), which is not wrapped and is mainly an implementation piece of AnisotropicDiffusionLBRImageFilter.
Rename the IsotropicWavelets class, which is wrapped, so Python users would see the change.
Merge them into one filter, if one can provide both behaviors.
Whichever is renamed cannot keep the old name as an alias without reintroducing the clash; a deprecation note in the migration guide would be the notice. Its header guard must change with it.
How it was found
The downstream build forest (every ITK consumer built against one ITK, with ITK_BUILD_DEFAULT_MODULES=ON, both modules enabled, and Python wrapping) stopped in the ITK build on this error while testing #7041 and #7056 on 2026-10-31. Neither PR touches these modules. The forest run disabled Module_IsotropicWavelets to proceed.
AI assistance (Claude Code) was used to diagnose the failure and draft this report.
The two classes are different algorithms that share a name, so they cannot be merged into one copy. Plan: rename both, each staying in its own module (GradientStructureTensorImageFilter in AnisotropicDiffusionLBR, RieszStructureTensorImageFilter in IsotropicWavelets). Neither class is used outside its own module in ITK or in the downstream forest sources.
How the two classes differ
AnisotropicDiffusionLBR
IsotropicWavelets
Input
one scalar or vector image; gradient computed inside
VariableSizeMatrix image holding eigenvectors and eigenvalues
Extras
RescaleForUnitMaximumTrace
projection, coherency, and rotation-matrix helpers
Wrapped
no
yes
A single class would need mode-dependent setters, two smoothing implementations, and different numerical results, so one copy in a common module is not proposed.
Usage inside ITK
LBR class: its own header and .hxx, AnisotropicDiffusionLBRImageFilter.h/.hxx, and itkStructureTensorImageFilterGTest.cxx.
IsotropicWavelets class: its own header and .hxx, itkStructureTensorImageFilterTest.cxx, itkStructureTensorWithGeneralizedRieszTest.cxx, and wrapping/itkStructureTensorImageFilter.wrap.
Documentation: the ITK 6 migration guide section on StructureTensorImageFilter describes the LBR class and says its API is unchanged, so it needs updating.
Downstream forest check
Source search over the forest's 310 source trees, plus the forest build tree for ITK main:
StructureTensorImageFilter appears in no source file outside ITK.
MITK (BasicImageProcessing depends on IsotropicWavelets) and CaPTk enable Module_IsotropicWavelets; BRAINSTools enables Module_AnisotropicDiffusionLBR; SimpleITK wraps CoherenceEnhancingDiffusionImageFilter from the LBR module. None of them name either class, so the renames should not affect them. This is a source search, not a build of those consumers.
Not checked: Python users of the wrapped IsotropicWavelets class outside the forest (for example the itk-isotropicwavelets PyPI package). They would see the rename.
Draft PR #7061 renames both classes (GradientStructureTensorImageFilter in AnisotropicDiffusionLBR, RieszStructureTensorImageFilter in IsotropicWavelets). Building both modules with Python wrapping then also hit a separate failure, tracked in #7058 and fixed in draft PR #7060; both are needed for that configuration.
Results
Module-labeled ctest: 60 of 62 pass. All 11 cEED/cCED image-comparison tests pass against existing baselines, so LBR numerics are unchanged.
Downstream: no source-level use of either class name in the 310 forest source trees. Module-level references only (MITK, CaPTk, BRAINSTools, SimpleITK). Only Python users of the IsotropicWavelets class see the new name; the migration guide documents it.
Activity
hjmjohnson commentedon Oct 31, 2026
The two classes are different algorithms that share a name, so they cannot be merged into one copy. Plan: rename both, each staying in its own module (
GradientStructureTensorImageFilterin AnisotropicDiffusionLBR,RieszStructureTensorImageFilterin IsotropicWavelets). Neither class is used outside its own module in ITK or in the downstream forest sources.How the two classes differ
SetInputs)NoiseScale,FeatureScale)GaussianWindowRadius,GaussianWindowSigma)SymmetricSecondRankTensorimageVariableSizeMatriximage holding eigenvectors and eigenvaluesRescaleForUnitMaximumTraceA single class would need mode-dependent setters, two smoothing implementations, and different numerical results, so one copy in a common module is not proposed.
Usage inside ITK
.hxx,AnisotropicDiffusionLBRImageFilter.h/.hxx, anditkStructureTensorImageFilterGTest.cxx..hxx,itkStructureTensorImageFilterTest.cxx,itkStructureTensorWithGeneralizedRieszTest.cxx, andwrapping/itkStructureTensorImageFilter.wrap.StructureTensorImageFilterdescribes the LBR class and says its API is unchanged, so it needs updating.Downstream forest check
Source search over the forest's 310 source trees, plus the forest build tree for ITK main:
StructureTensorImageFilterappears in no source file outside ITK.BasicImageProcessingdepends onIsotropicWavelets) and CaPTk enableModule_IsotropicWavelets; BRAINSTools enablesModule_AnisotropicDiffusionLBR; SimpleITK wrapsCoherenceEnhancingDiffusionImageFilterfrom the LBR module. None of them name either class, so the renames should not affect them. This is a source search, not a build of those consumers.itk-isotropicwaveletsPyPI package). They would see the rename.hjmjohnson commentedon Oct 31, 2026
Draft PR #7061 renames both classes (
GradientStructureTensorImageFilterin AnisotropicDiffusionLBR,RieszStructureTensorImageFilterin IsotropicWavelets). Building both modules with Python wrapping then also hit a separate failure, tracked in #7058 and fixed in draft PR #7060; both are needed for that configuration.Results
ITK_WRAP_PYTHON=ON, with BUG: Rename the two StructureTensorImageFilter classes to distinct names #7061 and BUG: Support std::complex in Matrix and VariableSizeMatrix GetInverse #7060 combined:IsotropicWaveletsPythonandAnisotropicDiffusionLBRPythonbuild with 0 errors. TheSetNoiseScaleclash is gone and no old-name wrapper files are generated.BUG: Rename AnisotropicDiffusionLBR structure tensor filter class
BUG: Rename IsotropicWavelets structure tensor filter class
BUG: Rename IsotropicWavelets structure tensor filter class