Skip to content

Commit 043aab7

Browse files
hjmjohnsonclaude
andcommitted
BUG: Fix Python wrapping for itk::bio namespace classes
Three issues prevented the Python wrapping from building: 1. WRAPPER_AUTO_INCLUDE_HEADERS was ON, causing itk_wrap_class to auto-derive wrong header filenames (itkCellularAggregateBase.h instead of itkBioCellularAggregateBase.h). Disable auto-include and rely on the explicit itk_wrap_include() directives, matching the pattern used by Ultrasound (BlockMatching) and ITK Statistics. 2. CellularAggregateBase is a non-template class but was wrapped with itk_wrap_class/itk_end_wrap_class (no itk_wrap_template calls), producing an empty SWIG interface. Use itk_wrap_simple_class instead so the class is properly registered. 3. itk_auto_load_submodules() processes .wrap files alphabetically, causing CellularAggregate to load before its base class. Add WRAPPER_SUBMODULE_ORDER to enforce correct dependency ordering. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1d54a9e commit 043aab7

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

wrapping/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
itk_wrap_module(BioCell)
2+
set(WRAPPER_SUBMODULE_ORDER
3+
itkBioCellularAggregateBase
4+
itkBioCellularAggregate
5+
)
26
itk_auto_load_submodules()
37
itk_end_wrap_module()
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
set(WRAPPER_AUTO_INCLUDE_HEADERS OFF)
12
itk_wrap_include("itkBioCellularAggregate.h")
23
itk_wrap_class("itk::bio::CellularAggregate" POINTER)
34
itk_wrap_template("2" "2")
45
itk_wrap_template("3" "3")
56
itk_end_wrap_class()
7+
set(WRAPPER_AUTO_INCLUDE_HEADERS ON)
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
set(WRAPPER_AUTO_INCLUDE_HEADERS OFF)
12
itk_wrap_include("itkBioCellularAggregateBase.h")
2-
itk_wrap_class("itk::bio::CellularAggregateBase" POINTER)
3-
itk_end_wrap_class()
3+
itk_wrap_simple_class("itk::bio::CellularAggregateBase" POINTER)
4+
set(WRAPPER_AUTO_INCLUDE_HEADERS ON)

0 commit comments

Comments
 (0)