feat(gui): host-computed phase-contrast annulus with per-configuration rings - #624
Open
hongquanli wants to merge 2 commits into
Open
feat(gui): host-computed phase-contrast annulus with per-configuration rings#624hongquanli wants to merge 2 commits into
hongquanli wants to merge 2 commits into
Conversation
Mirror the firmware protocol for the host-programmable LED matrix: - CMD_SET.SET_ILLUMINATION_LED_MATRIX_PIXEL (45), CMD_SET.CLEAR_ILLUMINATION_LED_MATRIX (46), ILLUMINATION_CODE.ILLUMINATION_SOURCE_LED_ARRAY_PROGRAMMABLE (10). - set_illumination_led_matrix_pixel / clear_illumination_led_matrix, and set_illumination_led_matrix_frame(frame) to push a full 128-LED frame (clear + non-black pixels), using the same R/G order and scaling as set_illumination_led_matrix. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… rings Add a "Phase Contrast" tab that computes an annular LED-matrix illumination pattern in Python and drives it through the programmable source, so the ring can be tuned (and new patterns added) without a firmware reflash. - The ring is specified by inner/outer DIAMETER in pixels (LED pitches), with inner constrained <= outer. Ring type (full / 180-deg half), direction, and color are selectable; intensity comes from the channel's own live slider. - Settings are per imaging configuration: a selector lists the configurations that use the programmable source, each keeps its own ring, persisted to cache/phase_contrast_annulus_settings.json. get_frame(intensity, channel) reads the stored settings by name, so live view AND wellplate multipoint acquisition use the correct ring for whichever configuration is imaging (thread-safe: reads plain data, not Qt widgets). - live_controller routes the programmable source through the widget frame and includes source 10 in _is_led_matrix; gui_hcs adds the tab and auto-follows the active live configuration. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Host side of the host-programmable LED matrix: a Phase Contrast tab that computes an annular illumination pattern in Python and drives it through the programmable LED-matrix source. Because the pattern is computed on the host, the ring can be tuned — and new patterns added — with no firmware reflash.
Changes
Protocol (
_def.py,microcontroller.py)SET_ILLUMINATION_LED_MATRIX_PIXEL(45),CLEAR_ILLUMINATION_LED_MATRIX(46),ILLUMINATION_SOURCE_LED_ARRAY_PROGRAMMABLE(10).set_illumination_led_matrix_pixel/clear_illumination_led_matrix, andset_illumination_led_matrix_frame(frame)to push a full 128-LED frame (clear + non-black pixels), using the same R/G order and scaling asset_illumination_led_matrix.GUI (
widgets.py,gui_hcs.py,live_controller.py)LedMatrixRingWidget) computes a 128-LED annulus frame and hands it to the live controller, which sends it per-pixel and selects the programmable source.cache/phase_contrast_annulus_settings.json.get_frame(intensity, channel_name)reads stored settings by name (plain data, not Qt widgets), so live view and wellplate multipoint acquisition both use the correct ring for whichever configuration is imaging — thread-safe from the acquisition worker.live_controllerroutes the programmable source through the widget frame and includes source 10 in_is_led_matrix;gui_hcsadds the tab and auto-follows the active live configuration.Required machine config (not in this PR)
The annulus imaging channel and its port mapping live in
machine_configs/+user_profiles/, which are gitignored (per-machine). To enable the feature on a device, add:machine_configs/illumination_channel_config.yaml— map a free controller port to source 10, and add the channel:user_profiles/<profile>/channel_configs/general.yaml— add the imaging channel (merges into every objective):Any imaging configuration whose
illumination_channelresolves to source 10 appears in the tab's selector and gets its own ring.Testing