Repository navigation
BUG: Destroy binary dilate and erode progress reporter before final update - #7274
Merged
hjmjohnson merged 1 commit intoNov 30, 2026
Conversation
…pdate ~TotalProgressReporter() reports the pixels counted since its last update. Running after UpdateProgress(1.0f), it sent observers a second ProgressEvent at 1.0. BinaryErode's border tracking stage can also report more pixels than it was allotted, so progress there can reach 1.0 before the final update. The tests check that progress ends at 1.0, and that BinaryDilate sends one event at 1.0.
dzenanz
marked this pull request as ready for review
November 30, 2026 17:09
Contributor
[Low impact] The PR appears safe to merge.
|
hjmjohnson
approved these changes
Nov 30, 2026
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.
Destroy the BinaryDilate and BinaryErode progress reporter before the final
UpdateProgress(1.0f), so its destructor no longer sends observers a secondProgressEventat 1.0. Addresses hjmjohnson's post-approval review of #7258.Details
ProgressReportertoTotalProgressReporterfor every loop. UnlikeProgressReporter, it does not set progress to 1 when destroyed, which is why PERF: Use scanline iterators in per-pixel filter loops #7258 addedUpdateProgress(1.0f). Its destructor still reports the pixels counted since its last update, andProcessObject::IncrementProgresssends aProgressEventeven when progress is already at its maximum.std::optionaland reset just before the final update. An inner block ending before that line would also work, but would re-indent about 375 lines in each filter.GetProgress()is 1.0 afterUpdate(), and the BinaryDilate test checks that exactly oneProgressEventarrives at 1.0. That check fails on main (2 events) and passes with this change. All 28 ITKBinaryMathematicalMorphology tests pass with MSVC.AI assistance
🤖 Generated with Claude Code