Skip to content

set up z-stack start and end positions according to primary z axis#1211

Merged
annie-xd-wang merged 5 commits into
TheDeanLab:developfrom
annie-xd-wang:fix-z-stack-setting
Apr 30, 2026
Merged

set up z-stack start and end positions according to primary z axis#1211
annie-xd-wang merged 5 commits into
TheDeanLab:developfrom
annie-xd-wang:fix-z-stack-setting

Conversation

@annie-xd-wang
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_axis to initialize z_origin / focus_origin from StageParameters.
  • 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_steps now derives primary_z_axis from the UI selection, but still uses self.z_origin that is only refreshed in populate_experiment_values() and the Set Start/End button handlers. If the user changes the z_device selection 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 updating z_origin/focus_origin when z_device/f_device changes (or computing the origin from StageParameters[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.

Comment thread src/navigate/controller/sub_controllers/channels_tab.py
Comment thread src/navigate/controller/sub_controllers/channels_tab.py Outdated
Comment thread src/navigate/controller/sub_controllers/channels_tab.py
Comment thread src/navigate/controller/sub_controllers/channels_tab.py
@AdvancedImagingUTSW AdvancedImagingUTSW self-assigned this Apr 30, 2026
@AdvancedImagingUTSW AdvancedImagingUTSW self-requested a review April 30, 2026 16:00
@AdvancedImagingUTSW AdvancedImagingUTSW removed their assignment Apr 30, 2026
@annie-xd-wang annie-xd-wang merged commit 348d3ab into TheDeanLab:develop Apr 30, 2026
1 check passed
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.

3 participants