Conversation
A JOBS Python task that, while running, serves /status, /move (relative, capped at 1 mm), /objective (4x/10x only), /capture (save as ND2), /nd/run (load a saved ND experiment and run it), /nd/finish and /shutdown on 127.0.0.1:8766. Motion and acquisition answer only POST; nothing moves or starts while the e-stop file exists; Z is never moved. NIS calls stay on the job thread, HTTP threads only queue them. Macro signatures are from the NIS 6.20 reference on the microscope PC. Checked off the scope over real HTTP with a stand-in DLL; not yet run inside NIS.
NISBridge wraps the bridge job's HTTP API: status, move_relative, change_objective, capture, nd_run, nd_finish, shutdown. The e-stop is checked here before any motion or acquisition request is sent, so a stopped microscope does not rely on the NIS side alone; ending an ND run and shutting the bridge down are always allowed. An unreachable bridge raises BridgeUnavailable with a pointer to the setup notes.
Tools that go through the NIS bridge: nis_status, nis_move_relative, nis_change_objective, nis_capture, nis_run_experiment and nis_finish_experiment, plus the shared estop. Everything that moves or acquires needs confirm=True, like backend='sdk' in loop_tools; captures go only to the data folder by plain file name; finishing an ND run and the e-stop never need confirm. A server of its own because server_loop's tool set is fixed by team direction and deliberately free of NIS-Elements; loop_tools.py and server_loop.py are unchanged.
Runs the real bridge HTTP server and queue, the real client and the real MCP tools against a stand-in for g5_regprocs.dll that records every macro call. Covers status, relative moves and the 1 mm cap, GET never moving anything, the 4x/10x allow-list, the e-stop in both client and bridge (with finishing an ND run still allowed), ND2 captures that never overwrite, ND run guards, the confirm gate, capture file names confined to the capture folder, and the NIS server's exact tool set.
docs/nis-bridge.md explains how the bridge, client and NIS MCP server fit together, how to run the bridge as a JOBS task, and the step-by-step test plan for the microscope - including the open questions (does NIS stay usable, does ChangeObjective turn the nosepiece, does ND_RunExperiment block). README and CHANGELOG point at it.
scipy, scikit-image, nd2, imageio-ffmpeg and opencv-python were imported by the analysis scripts but not declared, so a fresh install could not run them. They are now the 'analysis' group, included in 'all'.
The stage_positions demo loaded protocols/example_protocol.yaml, which is not in this repo, so it always failed; that step is removed. Comments citing docs/microscope-notes.md, run_protocol.py and the calibration tests now name ConfocalOrchestrator, and old names (mcp_server/server.py, acquisition_tools.py) are replaced with the current ones.
Canvas, fonts, centred text and an ffmpeg writer (x264 + AAC in one pass, or preview stills) used by the Physarum and C. elegans Shorts.
Runs the combined analysis script's alignment, draws the smoothed on-agar area under the time-lapse and wipes to growth_start_to_end_colour.jpg, which is the same frame so needs no registration.
Re-links tracks at 0.5 mm with a 3-frame position median, features the longest-followed adults named by speed, and states the Explorer/Homebody ratio as the smaller of the raw and filtered figures.
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.
No description provided.