TheDeanLab / navigate

navigate - open source light-sheet microscope controls
https://thedeanlab.github.io/navigate/
Other
32 stars 7 forks source link

User Task - Toolbar Functionality #12

Closed AdvancedImagingUTSW closed 2 years ago

AdvancedImagingUTSW commented 2 years ago

I would like to start to build out the toolbar's functionality.
image

I think to do this, we should first build out a sub-controller for the toolbar using @annie-xd-wang's format. This will pass the commands to the controller, and be initialized in the controller.

Under File, we would like to be able to load a particular 'experiment' yaml file, and populate the experiment settings in the model. Likewise, we would also like to save an experiment yaml file so that it can be reused later on. We do not have code for saving the experiment, but it should essentially give the user a standard save dialog so that they can choose the name and save location. When the user chooses to load the config, I believe our 'session' class (https://github.com/AdvancedImagingUTSW/ASLM/blob/b9f1583878343670452077cad681f2cfadfb01c7/base/1.0.0/model/aslm_model_config.py)

image

Under File, we will also provide the opportunity for a user to load images. Just like we had a save dialog to save the experiment, we would give a similar popup window that allows the user to explore the file tree and choose the image that they would like. As we get further along, this will allow the user to load an image, evaluate it using some of the computer vision tools that we will build out.

We can Change 'Edit' to 'Mode'. Two options should be 'Mesoscale' and 'Nanoscale'. This will ultimately decide which shutters to operate, cameras, etc. It will toggle the operation between the left half and the right half of the microscope, which we ultimately hope to do automatically in the future.

The Zoom buttons will need to work properly. In reality, it only influences the operation in the Mesoscale mode. These buttons will interact with the set_zoom function within the DynamixelZoom Device: https://github.com/AdvancedImagingUTSW/ASLM/blob/develop/base/1.0.0/model/devices/zoom/dynamixel/DynamixelZoom.py

The values that we send to this function are located in the model.configuration.ZoomParameters.zoom_position dictionary.

def set_zoom(self, zoom, wait_until_done=False): """ Changes zoom after checking that the commanded value exists """ if zoom in self.zoomdict: self._move(self.zoomdict[zoom], wait_until_done) self.zoomvalue = zoom else: raise ValueError('Zoom designation not in the configuration') if self.verbose: print('Zoom set to {}'.format(zoom))

ZoomParameters:

Dynamixel or SyntheticZoom

type: SyntheticZoom servo_id: 1 COMport: COM21 baudrate: 1000000 zoom_position: { 0.63x: 0, 1x: 627, 2x: 1711, 3x: 2301, 4x: 2710, 5x: 3079, 6x: 3383 }

AdvancedImagingUTSW commented 2 years ago

Or, rather than have the option to save the yaml file for the experiment, perhaps we just automatically save that with the images. Seems better...

AdvancedImagingUTSW commented 2 years ago

I think for all practical matters, this can be closed. The image loading dialog isn't important at this time.