Repository navigation
Add z-stack imaging (stimulation at the home z) - #76
Draft
Harrison-Oatman wants to merge 1 commit into
Draft
Harrison-Oatman wants to merge 1 commit into
Harrison-Oatman wants to merge 1 commit into
Conversation
…n at the home z
z_stack = { from_um, to_um, step_um } in [imaging] or a channel table
(z_stack = false turns it off) takes imaging channels as z-stacks around
each position's home z; the stimulation stays one frame at the home z.
Segmentation receives the (z, y, x) stack through segment_stack (Cellpose
in 3D or per slice with stitch_threshold; other methods default to the
maximum projection), or the projection with z_projection = "max". Labels,
tracking and pattern methods work in 2D; PatternContext.raw_stack gives the
stack. OME-Zarr stores stacked groups as (T, C, Z, Y, X), HDF5 as (Z, Y, X)
datasets; pyclm.io frame() returns projections and stack() the stack. The
pfs mover switches focus maintenance off for a stack and waits for lock at
the home z; [acquisition] z_settle_seconds waits after each focus step.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pjqs6ZVKxsT9T2e9MCHviJ
This branch has not been deployed
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.
Requested by Harrison · project thread
Each xy position can now take a z-stack per imaging channel; the stack goes to the segmentation method; the DMD stimulation stays one frame per position at the home z.
Config
pyclm_config.toml[acquisition] z_settle_seconds(default 0) waits after each focus step.What happens
_acquire_stack): home z = focus position after the move; one snap per offset; always back to home z.PositionMover.stack_begin/stack_endhooks: the PFS mover turns focus maintenance off for the stack and back on (with a wait for lock) at home z. Grids: each tile is stacked, each slice stitched.SegmentationMethod.segment_stack(stack); the default segments the max projection. Cellpose uses its 3D mode (do_3D,anisotropy) or per-slice +stitch_threshold. 3D labels are max-projected to 2D for tracking, patterns and storage.context.raw()is the max projection;context.raw_stack()is the stack.(T, C, Z, Y, X)(own cadence group,z_offsets_umin group metadata); HDF5 datasets are(Z, Y, X)withz_offsets_um,z_home_um,z_positions_umattrs.pyclm.ioframe()returns projections, so export, movies, viewer and watch keep working;stack()returns the stack.Not done / to check on hardware
Tests
tests/test_z_stack.py: schema, microscope stack positions and return to home, dry runs (zarr and HDF5) with a stack-recording segmentation and a pattern method that checks projection shapes, andz_projection = "max". Full suite: 635 passed, 21 skipped.Generated by Claude Code