Skip to content

Conversation

@lassoan
Copy link
Collaborator

@lassoan lassoan commented Dec 17, 2025

This PR contains a fix a Qt6 incompatibility and several usability improvements.

QApplication.flush() is no longer available in Qt6.
If user does not select output volume then a new one is created automatically.
If the user does not want to show the output volume automatically (thereby resetting field of view, etc.) then auto-show can be turned off in the new "Advanced" section.
Many filters require float images. If the input image is integer then the filter fails and the user has to convert the image manually to float.

This commit detects if the filter failed due to unsupported pixel type and retries execution with all input images converted to float type.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses Qt6 compatibility and adds several usability improvements to the SimpleFilters module. The main Qt6 fix replaces the deprecated QApplication.flush() with slicer.app.processEvents() in the test code. The usability enhancements include an automatic output volume creation feature, a user-configurable "Auto-show output" option, improved output selector display text, and intelligent error recovery that automatically retries filters with float-casted inputs when pixel type incompatibility is detected.

Key Changes:

  • Qt6 compatibility fix by replacing deprecated QApplication.flush() call with slicer.app.processEvents()
  • Added Advanced section with checkbox to control automatic output display behavior
  • Implemented automatic output volume creation when none is selected
  • Added error recovery that retries filters with float32-casted inputs on pixel type errors

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
SimpleFilters/Testing/Python/SimpleFiltersModuleTest.py Fixes Qt6 incompatibility by replacing qt.QApplication.flush() with slicer.app.processEvents()
SimpleFilters/SimpleFilters.py Adds Advanced UI section with auto-show checkbox, implements automatic output volume creation, adds pixel type error recovery with automatic float casting, makes output display behavior configurable, and improves output selector display text

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jamesobutler
Copy link
Contributor

cc: @jcfr to help with integration as I don't have the elevated approval rights to be able to integrate in this repository.

@lassoan lassoan merged commit a4f1ae9 into SimpleITK:master Dec 31, 2025
6 checks passed
@lassoan lassoan deleted the qt6-fixes branch December 31, 2025 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants