set up z-stack start and end positions according to primary z axis#1211
Merged
annie-xd-wang merged 5 commits intoApr 30, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Channels tab stack-acquisition logic so that Z-stack start/end calculations are based on the currently selected primary Z (and focus) axis/device, rather than being hard-coded to the "z"/"f" axes.
Changes:
- Use
primary_z_axis/primary_f_axisto initializez_origin/focus_originfromStageParameters. - Update Z-stack flip handling and step sign logic to use the selected primary Z axis’ flip flag.
- Update Set Start / Set End logic to read Z/F positions from the selected primary Z/F axes.
Comments suppressed due to low confidence (1)
src/navigate/controller/sub_controllers/channels_tab.py:537
update_z_stepsnow derivesprimary_z_axisfrom the UI selection, but still usesself.z_originthat is only refreshed inpopulate_experiment_values()and the Set Start/End button handlers. If the user changes thez_deviceselection without pressing Set Start/End, absolute start/end (abs_z_start/abs_z_end) and flip handling can be computed against an origin from a different axis. Consider updatingz_origin/focus_originwhenz_device/f_devicechanges (or computing the origin fromStageParameters[primary_z_axis]here when the selected axis changes).
# get the primary z-stack and focus axis
primary_z_stage = self.stack_acq_vals["z_device"].get()
primary_z_axis = primary_z_stage.split(" - ")[1]
primary_f_stage = self.stack_acq_vals["f_device"].get()
primary_f_axis = primary_f_stage.split(" - ")[1]
# Shift the start/stop positions by the relative position
flip_flags = self.parent_controller.configuration_controller.stage_flip_flags
if flip_flags[primary_z_axis]:
self.microscope_state_dict["abs_z_start"] = self.z_origin + end_position
self.microscope_state_dict["abs_z_end"] = self.z_origin + start_position
# self.stack_acq_vals["abs_z_start"].set(self.z_origin + end_position)
# self.stack_acq_vals["abs_z_end"].set(self.z_origin + start_position)
else:
self.microscope_state_dict["abs_z_start"] = self.z_origin + start_position
self.microscope_state_dict["abs_z_end"] = self.z_origin + end_position
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
AdvancedImagingUTSW
approved these changes
Apr 30, 2026
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.