Skip to content

ENH: Restore the evolving LevelSetsv4 examples without VTK rendering - #486

Draft
hjmjohnson wants to merge 4 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:enh-modernize-evolving-levelsetsv4
Draft

hjmjohnson wants to merge 4 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:enh-modernize-evolving-levelsetsv4

Conversation

@hjmjohnson

Copy link
Copy Markdown
Member

Restore the two evolving LevelSetsv4 examples by writing the evolved level set
instead of rendering each iteration through VTK, and remove the now-empty
if(ITK_VERSION_MAJOR LESS 5) block.

Stacked on #485 — review the last 2 commits.

What changes

Both examples evolve a dense level set with the Chan and Vese region terms. They
used to attach LevelSetIterationUpdateCommand to a VTK visualizer that ITK no
longer contains; each now writes the result after evolving:

example output
VisualizeEvolvingDense2DLevelSetAsElevationMap evolved level-set values
VisualizeEvolvingDense2DLevelSetZeroSet evolved zero set, via ZeroCrossingImageFilter

They move to Segmentation/LevelSetsv4 alongside the static examples from #485.
With them gone, the VtkGlue if(ITK_VERSION_MAJOR LESS 5) block is empty and is
removed. The screenshot and animation (levelsets.png, levelsets.gif) are
removed from each page, since they showed a renderer that no longer exists.

Verification

Built against ITK main: 0 build failures, and all 7 LevelSetsv4 tests pass
(the 5 from #485 plus these 2, each evolving 100 iterations). Outputs inspected:

example output
Evolving ElevationMap values −13.0 to 42.3, 2816 pixels inside
Evolving ZeroSet 1627-pixel contour

Commit 1 is a pure move (12 renames), so history follows the files.
pre-commit run --all-files passes. As in #485, the tests check that each
example runs rather than comparing against a baseline image.

These examples demonstrate the LevelSetsv4 framework, not the VTK
bridge. They have been excluded from the build since ITK 5 because their
VTK visualization classes left ITK, so they are unbuilt on both sides of
this move.
The examples rendered through VTK visualization classes that ITK no
longer contains. Each now writes what it demonstrates: the dense
level-set values, the zero set via ZeroCrossingImageFilter, or the
sparse layers sampled on the image grid. A run test covers each one.

The Otsu mask pipeline was never updated before the level set was
initialized, so the level set started from an empty mask; update it
first.
These were the last examples under the VtkGlue if(ITK_VERSION_MAJOR
LESS 5) block, which is now empty and removed. They are unbuilt on both
sides of this move.
…ring

The examples rendered each iteration through VTK visualization classes
that ITK no longer contains. Each now evolves the level set and writes
the result: the level-set values, or the zero set via
ZeroCrossingImageFilter.
@github-actions github-actions Bot added type:Enhancement Improvement of existing methods or implementation area:Documentation Issues affecting the Documentation module area:Segmentation Issues affecting the Segmentation module type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots area:Bridge Issues affecting the Bridge module type:Data Changes to example data (usually displayed images) language:C++ Changes to C++ examples labels Sep 14, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Bridge Issues affecting the Bridge module area:Documentation Issues affecting the Documentation module area:Segmentation Issues affecting the Segmentation module language:C++ Changes to C++ examples type:Data Changes to example data (usually displayed images) type:Enhancement Improvement of existing methods or implementation type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants