Skip to content

4 quantus ceus mp4 analysis gui cannot proceed after roi drawing#63

Open
OmidChaghaneh wants to merge 19 commits into
mainfrom
4-quantus-ceus-mp4-analysis-gui-cannot-proceed-after-roi-drawing
Open

4 quantus ceus mp4 analysis gui cannot proceed after roi drawing#63
OmidChaghaneh wants to merge 19 commits into
mainfrom
4-quantus-ceus-mp4-analysis-gui-cannot-proceed-after-roi-drawing

Conversation

@OmidChaghaneh
Copy link
Copy Markdown
Contributor

#4

@OmidChaghaneh OmidChaghaneh self-assigned this Mar 27, 2026
Copilot AI review requested due to automatic review settings March 27, 2026 08:59
@OmidChaghaneh OmidChaghaneh linked an issue Mar 27, 2026 that may be closed by this pull request
6 tasks
@OmidChaghaneh OmidChaghaneh added the PR Pull request label Mar 27, 2026
Copy link
Copy Markdown

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

Fixes QuantUS CEUS GUI workflow getting stuck after manual ROI/VOI drawing by wiring the “segmentation saved/loaded” flow through the model/controller and introducing the CEUS analysis-loading screens to allow navigation to continue.

Changes:

  • Connect manual ROI/VOI save → segmentation load → segmentation confirmed, so the workflow can proceed past ROI drawing (Issue #4).
  • Add CEUS analysis-loading MVC components and generated PyQt UI modules to support selecting/running analyses.
  • Add ROI preview enhancements (CLAHE/gamma/width scaling + optional pseudocolor) and improve folder-vs-file validation in CEUS file selection.

Reviewed changes

Copilot reviewed 43 out of 44 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/qus/visualization_loading/ui/visualization_preview_2d_ui.py Adds generated UI for 2D visualization preview screen.
src/qus/seg_loading/ui/seg_type_selection_ui.py Adds generated UI for segmentation type selection.
src/qus/seg_loading/ui/roi_preview_ui.py Adds generated UI for ROI preview/confirmation.
src/qus/seg_loading/ui/frame_selection_ui.py Adds generated UI for frame selection.
src/qus/image_loading/ui/scan_type_ui.py Adds generated UI for scan/data type selection.
src/qus/export_loading/ui/export_loading_ui.py Adds generated UI for export configuration/loading.
src/qus/config_loading/ui/config_type_selection_ui.py Adds generated UI for analysis config type selection.
src/qus/application_model.py Adds debug prints for NIfTI load details (image/seg).
src/qus/analysis_loading/ui/analysis_params_ui.py Adds generated UI for analysis params screen.
src/qus/analysis_loading/ui/analysis_function_selection_ui.py Adds generated UI for analysis function selection.
src/ceus/seg_loading/views/draw_roi_widget.py Adds enhancement controls + pseudocolor and enhanced-frame caching during ROI drawing.
src/ceus/seg_loading/ui/seg_type_selection_ui.py Adds generated UI for CEUS segmentation type selection.
src/ceus/seg_loading/seg_loading_view_coordinator.py Wires manual segmentation save to trigger loading; auto-confirms seg to unblock workflow.
src/ceus/seg_loading/seg_loading_controller.py Re-enables model signal wiring to update views when segmentation loads.
src/ceus/image_loading/views/file_selection_widget.py Improves “folder vs file” extension handling/validation.
src/ceus/image_loading/ui/scan_type_ui.py Adds generated UI for CEUS scan type selection.
src/ceus/image_loading/ui/file_selection_ui.py Adds generated UI for CEUS scan file selection.
src/ceus/application_model.py Adds analysis support (worker + signals), preprocessing helpers, loader error-code handling, and NIfTI debug prints.
src/ceus/application_controller.py Adds navigation into CEUS analysis-loading flow after segmentation confirmed.
src/ceus/analysis_loading/views/analysis_params_widget.py Introduces CEUS analysis params widget scaffold (currently placeholder).
src/ceus/analysis_loading/views/analysis_function_selection_widget.py Ports analysis function selection widget to CEUS types/imports.
src/ceus/analysis_loading/views/analysis_execution_widget.py Ports analysis execution widget to CEUS types/imports.
src/ceus/analysis_loading/ui/analysis_params_ui.py Adds generated UI for CEUS analysis params screen.
src/ceus/analysis_loading/ui/analysis_function_selection_ui.py Adds generated UI for CEUS analysis function selection screen.
src/ceus/analysis_loading/ui/analysis_execution_ui.py Adds generated UI for CEUS analysis execution screen.
src/ceus/analysis_loading/analysis_loading_view_coordinator.py Ports/adjusts coordinator wiring for CEUS analysis flow and safer error handling.
src/ceus/analysis_loading/analysis_loading_controller.py Selects an available CEUS analysis type and drives function/params/execution workflow.
.gitignore Stops ignoring *_ui.py so generated UI modules can be committed.

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

Comment on lines +78 to +83

# Enhancement parameters
self._clahe_clip_limit = 1.2
self._gamma = 1.5
self._use_philips_ceus = False
self._enhanced_cache = None # Cache for enhanced current frame
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

Duplicate initialization of enhancement fields (_clahe_clip_limit/_gamma) appears twice. This makes it unclear which defaults are intended and increases maintenance risk; remove the redundant block and keep a single source of truth for the default values.

Suggested change
# Enhancement parameters
self._clahe_clip_limit = 1.2
self._gamma = 1.5
self._use_philips_ceus = False
self._enhanced_cache = None # Cache for enhanced current frame
self._use_philips_ceus = False
self._enhanced_cache = None # Cache for enhanced current frame

Copilot uses AI. Check for mistakes.
Comment on lines +78 to +81

# Enhancement parameters
self._clahe_clip_limit = 1.2
self._gamma = 1.5
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

This second block redefines enhancement defaults that were already set a few lines above, which can easily lead to accidental divergence. Keep only one initialization block (and include _use_philips_ceus/cache fields there).

Suggested change
# Enhancement parameters
self._clahe_clip_limit = 1.2
self._gamma = 1.5

Copilot uses AI. Check for mistakes.
Comment on lines +78 to +82
def _create_parameter_inputs(self) -> None:
"""Create input fields for each required parameter."""
# This implementation is simplified compared to QUS for now
# Ideally would dynamically create inputs based on CEUS requirements
pass
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

_create_parameter_inputs() is currently a no-op (pass), so the UI will not render any required parameter inputs even when required_params are provided, and the widget will always emit an empty params dict. Implement this method (or remove required_params plumbing) so analysis functions that require parameters can be configured from the GUI.

Copilot uses AI. Check for mistakes.
@davidspector67
Copy link
Copy Markdown
Contributor

Hey Omid,

Is the goal for this PR to complete an end-to-end GUI analysis pipeline for CEUS MP4? After merging this branch with main and making some tweaks, it still appears not able to support this. Let me know what you're thinking for this PR and I can push the changes I've made so far if you think they would be helpful.

Thanks,
David

@OmidChaghaneh
Copy link
Copy Markdown
Contributor Author

Hey David, Yes, the goal is indeed to finalize the end-to-end GUI analysis pipeline for CEUS MP4. Currently, the core pipeline is almost there and largely functional, but there are still a few refinements needed. The primary missing piece is the transition after the analysis menu. Right now, it has been tested until reaching to there. Best

@@ -0,0 +1,339 @@
# Form implementation generated from reading ui file 'src\ceus\image_loading\ui\file_selection.ui'
Copy link
Copy Markdown
Contributor

@davidspector67 davidspector67 May 3, 2026

Choose a reason for hiding this comment

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

Hey Omid, in the future, try not to add auto-generated *_ui.py files to your commits as it bloats things, the files are constantly being overwritten, and they don't contain any additional information than the source *.ui files. I'll add back to the .gitignore file to enforce this

…ckend from frontend for enhancement, put back .gitignore, updated ceus engines submodule commit ref
@davidspector67
Copy link
Copy Markdown
Contributor

Hi Omid,

I just made the view draw_roi_widget.py respect the MVC architecture for image enhancements, just as it's respected for the 3D VOI view. Pseudocoloring also doesn't do anything on RGB images, so I removed that from the GUI in the case where the pixel data is RGB.

It looks like the analysis itself still has an error (specifically, I cannot generate a TIC after hitting run on the GUI without it crashing). Can you address this so that the pipeline works through analysis execution? Also, at the end of the newly implemented capabilities, if you can have a message saying that the rest of the pipeline still needs to be finished, that would be great.

Thank you,
David

@OmidChaghaneh
Copy link
Copy Markdown
Contributor Author

Hi David,

I’ve resolved the analysis execution error and refined the CEUS pipeline. The TIC crash has been fixed, and I’ve also added UI feedback to support continuation of the analysis and development.

Best regards,
Omid

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

Labels

PR Pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quantus CEUS .mp4 analysis GUI cannot proceed after ROI drawing

3 participants