ENH: Add StructuralSimilarity Beta module (SSIM image filter) — stacked on #6085#6034
Conversation
|
| Filename | Overview |
|---|---|
| Modules/Filtering/ImageCompare/include/itkStructuralSimilarityImageFilter.h | Public API and class declaration; well-structured with standard ITK macros. Documentation note: header comment still says "BeforeGenerate" though validation is in VerifyPreconditions (flagged in previous thread). |
| Modules/Filtering/ImageCompare/include/itkStructuralSimilarityImageFilter.hxx | Core implementation; simplified and general SSIM paths are correct. Two edge-case gaps: K1/K2=0 produces silent NaN for constant/zero-mean inputs, and the border-crop formula diverges from scikit-image for even MaximumKernelWidth values. |
| Modules/Filtering/ImageCompare/test/itkStructuralSimilarityImageFilterGTest.cxx | 30 GTest cases covering identities, analytic constant-image checks, input validation, qualitative properties, scikit-image cross-checks, code-path equivalence, and multi-dimensional/pixel-type coverage. Well-designed and comprehensive. |
| Modules/Filtering/ImageCompare/itk-module.cmake | Adds ITKSmoothing as COMPILE_DEPENDS (correct for template-only dependency) and ITKGoogleTest as TEST_DEPENDS. No issues. |
| Modules/Filtering/ImageCompare/test/CMakeLists.txt | Adds creategoogletestdriver for the new GTest file; GTest auto-discovery handles CTest registration, confirmed by author's ctest run showing 30 tests. |
| Modules/Filtering/ImageCompare/wrapping/itkStructuralSimilarityImageFilter.wrap | Wraps for WRAP_ITK_REAL (float/double) in 2D, consistent with SimilarityIndexImageFilter's wrapping pattern. Appropriate starting point. |
Reviews (3): Last reviewed commit: "ENH: Add StructuralSimilarityImageFilter..." | Re-trigger Greptile
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
The lone failing check (
The pattern (lone Azure pipeline failing, CDash green, all duplicate-coverage Linux builds green) almost always means the failure is in a post-CTest infrastructure step in the Azure pipeline (cache save, artifact upload, agent cleanup), not in the build itself. Re-triggering. |
|
/azp run ITK.Linux |
blowekamp
left a comment
There was a problem hiding this comment.
Some comment on pipeline management details.
The implementation this feeling is going to be rather memory intensive with the number of image converted and processed to real type.
Is this a 2D only implementation?
|
Updated diagnosis: the The root cause: The output iterator was a plain Fix (commit Local verification: No deprecation warnings, clean build. All 30 SSIM GTests still pass under the legacy-removed build with the new iterator. |
f431686 to
c4721ab
Compare
c4721ab to
80a2e9a
Compare
|
@greptileai review this draft before I make it official |
N-dimensional, multi-threaded ITK filter for the Structural Similarity Index Measure (Wang et al., IEEE TIP 2004). Two inputs in, a per-pixel SSIM map out, and a scalar mean SSIM available via GetMeanSSIM() after Update(). Restructured from ITK PR #6034 (in-tree ImageCompare addition) to standalone remote module format for ITKRemoteAnalysis category repo. Original PR: InsightSoftwareConsortium/ITK#6034
80a2e9a to
aa5fd89
Compare
Introduces Modules/Beta/ as the in-tree home for modules that were formerly configure-time remote fetches (Modules/Remote/*.remote.cmake). Modules/Beta/CMakeLists.txt defines a no-op itk_beta_module_manifest() function so that provenance files (Modules/Beta/<Name>.beta.cmake) are valid CMake and can be include()-d without build-time side effects. Actual modules grafted under Modules/Beta/<Name>/ are discovered via the existing itk-module.cmake DAG scan in ITKModuleEnablement.cmake. No modules are ingested by this commit; this only wires the container.
Introduces a new Modules/Beta/StructuralSimilarity/ module containing
StructuralSimilarityImageFilter, which computes the Structural
Similarity Index (SSIM) between two images using a sliding Gaussian
window over local luminance, contrast, and structure terms.
Reference: Wang et al., "Image quality assessment: From error
visibility to structural similarity," IEEE TIP 13(4), 2004.
Placed under Modules/Beta/ (stacked on the Modules/Beta/ container
introduced by the parent commit) so the API can stabilize before
promotion to a core ITK module. Original proposal placed the filter
in Modules/Filtering/ImageCompare; the Beta location lets it mature
without perturbing a core module's API surface.
Module contents:
itk-module.cmake - DEPENDS ITKImageIntensity;
COMPILE_DEPENDS ITKImageFilterBase,
ITKSmoothing; TEST_DEPENDS
ITKTestKernel, ITKGoogleTest
include/ - header + templated impl (.hxx)
test/ - GoogleTest-based test suite
wrapping/ - Python wrapping for WRAP_ITK_REAL 2D
../StructuralSimilarity.beta.cmake - provenance manifest
aa5fd89 to
c865deb
Compare
Adds
Modules/Beta/StructuralSimilarity/containingStructuralSimilarityImageFilter(SSIM, Wang et al. 2004). Stacked on #6085 — relocating out ofModules/Filtering/ImageCompare/into the newModules/Beta/container so the API can stabilize before promotion to a core module. Merge #6085 first; this PR's base is stillmainonly because GitHub won't accept a base branch from a fork.What changed vs. the previous revision of this PR
Previous revision placed the filter in
Modules/Filtering/ImageCompare/and touched that module'sitk-module.cmake(addingITKSmoothing/ITKGoogleTestdeps). That perturbed a core module's dependency surface for a brand-new filter whose API has not yet been exercised by downstream users.This revision:
Modules/Beta/StructuralSimilarity/moduleModules/Filtering/ImageCompare/completely untouchedModules/Beta/StructuralSimilarity.beta.cmakeprovenance manifest\ingroup ITKImageCompare→\ingroup StructuralSimilarityin the header.h/.hxx), GoogleTest suite, Python.wrapModule layout