Fix movements axes

This MR contains the following

  • Changes keybindings so that Right key increases the x value by default
  • Adds a setting for inverting the axes for BaseStage, set as a mapping of axis and True for inverting, False to not invert
  • A new action for inverting an axis
  • Creates an internal attribute _hardware_position to track the position as defined by the underlying hardware. The property position is in the "program" frame. Everything outside the stage Thing itself will only see things in the "program" frame.
  • Creates a private method for inverting position arrays. And turns move_relative and move_absolute into wrappers around _hardware_move_relative and _hardware_move_absolute that first change the desired positions or directions into the hardware coordinates. Child stages should now override the _hardware_move_relative and _hardware_move_absolute methods, and update _hardware_position not position.
  • Add in a check in __init__ for BaseStage that move_relative and move_absolute have not been overridden.
  • Sets default movement axis inversions to True, False, True for the Sangaboard. Inverting x and z.
  • Sets default movement axis inversions to True, False, False for the DummyStage. Inverting x.

Update to stage settings tab, allowing the user to flip z only

image

Stops user from flipping z key from navigate tab, and renames configuration

image

NOTE

  • x is inverted in both Sangaboard and DummyStage so that the sample moving in to the right is positive x.
  • y is not inverted in either so that the sample moving up is positive y
  • z is inverted for the sangaboard, so that the objective moving up is positive z

## Still TODO

  • Multiple users (Julian, Ben) to test this on their microscopes
  • [ ] Discussion of what the default behaviour should be, based on user expectations and ISO standards #514
  • [ ] Write a clear description into the documentation of what x,y, and z mean in terms of sample movement on the camera, and in terms of the stage. Now #514

Merge checklist:

  • All new/changed functions have up to date typehints and docstrings
  • Any UI updates have a before and after screenshot in the MR description
  • Unit testing of new functionality has similar or better coverage that similar existing code
  • This code has been tested on a microscope
    • With webapp has been recompiled (if changed)
    • [ ] With updated settings JSON (if changed)
    • SmartScan and live stitching work

Camera stage mapping also works

Final stitch also works

Closes #498 (closed)

Edited by Joe Knapper

Merge request reports

Loading