Draft
Fix volume asset dropdown not populated and crash when no volume selected in Match Template panel#41
Conversation
Co-authored-by: bHimes <3077528+bHimes@users.noreply.github.com>
…kflows [skip ci] Co-authored-by: bHimes <3077528+bHimes@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] volume asset not there
Fix volume asset dropdown not populated and crash when no volume selected in Match Template panel
Sep 4, 2025
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.
This PR fixes two related issues in the Match Template panel:
Root Cause
The primary issue was in the
DirtyVolumes()andDirtyImageGroups()methods inMainFrame.cpp, which only marked template matching panels as dirty when the current workflow was "Template Matching":This created a scenario where:
Stack Trace Analysis
The crash occurred because
ReferenceSelectPanel->GetSelection()returns-1when no item is selected, which gets passed tovolume_asset_panel->ReturnAssetPointer(-1), triggering a debug assert:Solution
1. Fixed workflow-dependent dirty flag setting:
DirtyVolumes()andDirtyImageGroups()to always mark template matching panels as dirty, regardless of current workflow2. Added validation to prevent crashes:
OnUpdateUI()to disable run button when no volume is selectedStartEstimationClick()with user-friendly error messageChanges Made
src/gui/MainFrame.cpp: Fixed workflow-dependent dirty flag settingsrc/gui/MatchTemplatePanel.cpp: Added volume selection validation and safety checksAll changes are minimal and surgical, addressing only the specific issues without affecting existing functionality.
Fixes #40.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.