Skip to content

CameraBase: ROI buttons with a status LED, and the image size follows the ROI - #14

Merged
seb5g merged 6 commits into
5.0.xfrom
feat/roi-apply-led
Oct 27, 2026
Merged

seb5g merged 6 commits into
5.0.xfrom
feat/roi-apply-led

Conversation

@seb5g

@seb5g seb5g commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Before: the Update ROI from Viewer and Apply ROI led_push of CameraBase only reacted to a change of the ROI in the viewer: clicking Update did not take the ROI already drawn, and the Image width / Image height were not recomputed when a ROI was applied. The LEDs only said on / off.

After: both are action_led parameters (a button and a LED with the PyMoDAQ status colors): grey when not activated, blue while the ROI is applied, green when activated, orange on error (no ROI in the viewer, ROI outside the sensor, the camera refuses it).

  • Update ROI from Viewer takes the ROI now in the viewer, and the ROI of the viewer is followed (green) until Clear ROI+Bin.
  • Apply ROI applies it; once green, the ROI is applied again each time it changes in the viewer.
  • Image width / Image height are updated with each ROI and binning.
  • Also: color_conversion has a default value ('None'): with OpenCV installed and no default, the conversion looked for cv2.COLOR_None. This made 7 tests of test_camera_base.py fail where cv2 is installed (they failed on 5.0.x too).

How: CameraBase connects sigActivated of the two parameters, which needs PyMoDAQ/PyMoDAQ#1431 (the activation of a button reaches the plugin thread); until it is released the buttons do nothing in the application, and the pymodaq floor of this package has to be raised to the release that contains it. Tests (test_camera_base.py, activation done with Parameter.activate() on the plugin parameter): LED states in each case, the ROI taken from the viewer on click, the image size, the ROI outside the sensor, a camera that refuses the ROI, following the viewer until cleared. 53 passed with PyMoDAQ #1431 from source; test_plugin_package_structure fails locally because the package is not installed. Not tested with a real camera or a GUI click.


Generated by Claude Code

…age size updated

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tdiso1u1ZhikSutj2Qs5Cg

seb5g commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

All jobs pass except compatibility / windows-latest / Python 3.12 / pyqt6, which stopped printing after test_clear_roi_goes_back_to_the_full_sensor and was cancelled after about 30 minutes, with test_roi_change_during_live_restarts_it_with_the_new_roi as the last test running. That test existed before this PR and it passes here on Linux (6 runs in a row), so this looks like a hang of the live thread on the Windows runner rather than an assertion failure. I did not find a cause in this PR's diff, which only touches the ROI buttons and compute_axes. I re-run the cancelled job once. If it hangs again I will look at whether the live test needs a guard on Windows.


Generated by Claude Code

…nd released undoes it

Pressed: blue LED while the change is done, green when it is, orange on error (the button is
released). Released: grey LED; 'Update' stops following the ROI of the viewer, 'Apply' goes
back to the full sensor. The LED states are the Status workflow.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tdiso1u1ZhikSutj2Qs5Cg
…kable button, limits of the LEDs)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tdiso1u1ZhikSutj2Qs5Cg
…rted to pixels

The ROI of the viewer is given in the values of its axes. Truncating them to integers before
dividing by the pixel size was wrong for calibrated axes (um).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tdiso1u1ZhikSutj2Qs5Cg
@seb5g
seb5g merged commit 746dda6 into 5.0.x Oct 27, 2026
6 of 8 checks passed
@seb5g
seb5g deleted the feat/roi-apply-led branch October 27, 2026 14:35
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