COMP: Build and wrap against an installed ITK 6 - #58
Merged
hjmjohnson merged 3 commits intoSep 24, 2026
Merged
Conversation
The src/ executables include the module's own headers, which only reach the compiler when the module is built inside an ITK source tree. Name the include directory so they also build against an installed ITK. The example programs enable ITK's IO factory register manager, which references every IO module the ITK build enables, so they must link ITK_LIBRARIES rather than only the module's own dependencies. The wrapping instantiated VesselEnhancingDiffusion3DImageFilter as an image filter with two image types; the template takes a pixel type and a dimension. Wrap it over the scalar pixel types in three dimensions. SWIG runs with -Werror, so a filter whose superclass is not wrapped fails with warning 401. DescoteauxSheetness and FrangiTubularness derive from UnaryFunctorImageFilter; wrap them POINTER_WITH_SUPERCLASS like LocalStructureImageFilter and ITK's own UnaryFunctor subclasses. itkSatoVesselnessFeatureGenerator.wrap wrapped the derived Sigmoid class instead of SatoVesselnessFeatureGenerator, so no interface existed for the base. Wrap the right class, and list base classes first in WRAPPER_SUBMODULE_ORDER so each derived interface imports a wrapped base. The sheetness, tubularness, and local-structure functors index their input pixel, so wrap them over covariant-vector images (the eigenvalue image type ITK wraps) instead of scalar images. RegionCompetitionImageFilter indexes an array with its output pixel, so wrap integer outputs only. The Sato vesselness generators and LesionSegmentationImageFilter8 embed VesselEnhancingDiffusion3DImageFilter, so wrap them in three dimensions only; the segmentation modules produce float images, so the lesion filter's output is real.
FeatureGenerator and thirteen subclasses declared GetInput() const, but only SegmentationModule defined it. C++ callers never used it, so the missing definitions went unnoticed; SWIG wraps every declared method, so the Python module failed to load with undefined symbols. Define it in FeatureGenerator and IsotropicResampler, and let the feature generators inherit it.
hjmjohnson
marked this pull request as ready for review
September 22, 2026 16:05
@v5.4.6 no longer resolves to a tag; every job failed identically after a ~9-minute build, in a second, flag-less CMake reconfigure of the same binary directory that could not find ITK::LesionSizingToolkitModule, which is not present at v5.4.4 or on the workflow's current main branch. Most likely v5.4.6 was itself a since-reverted release. Pin to v5.4.4, the latest tag confirmed to exist.
hjmjohnson
merged commit Sep 24, 2026
94a3834
into
InsightSoftwareConsortium:main
3 of 22 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make LesionSizingToolkit build and wrap against an installed ITK 6 tree. Two commits: build and wrapping fixes, and a missing
GetInput()definition that kept the Python module from loading.Build and wrapping fixes (COMP)
src/examples include the module's own headers, which only reach the compiler inside an ITK source tree; name the include directory.ITK_LIBRARIES.itkSatoVesselnessFeatureGenerator.wrapwrapped the derived Sigmoid class, so the base was never instantiated; base classes now come first inWRAPPER_SUBMODULE_ORDER.DescoteauxSheetness,FrangiTubularness, andLocalStructureindex their input pixel, so they wrap over covariant-vector images with a real output, asVectorMagnitudeImageFilterdoes in ITK.LesionSegmentationImageFilter8embedVesselEnhancingDiffusion3DImageFilter, so they wrap in three dimensions only; the lesion filter's output is real, matching the segmentation modules.RegionCompetitionImageFilterindexes an array with its output pixel, so it wraps integer outputs only.GetInput definitions (BUG)
FeatureGeneratorand thirteen subclasses declaredGetInput() const; onlySegmentationModuledefined it. C++ never called it, but SWIG wraps every declared method, so the Python module failed to load with undefined symbols. It is now defined once inFeatureGenerator(and inIsotropicResampler) and inherited.Verification
Configured with
ITK_DIRpointing at an installed ITK 6 tree (upstreammainas of 2026-09-22,ITK_WRAP_PYTHON=ON), built the module and its Python wrapping, and imported the wrapped module from Python. The module still builds against ITK 5.4.