Reconfigurable Acquisitions Using Features

What are features?

navigate allows users to reconfigure acquisition routines within the GUI by chaining so-called “features” together in sequence. A feature is the name given to a single acquisition unit such as Snap, which snaps an image, or MoveToNextPositionInMultiPositionTable, which moves the stage to the next imaging position indicated in the Multiposition Table. Some acquisition units, such as Autofocus or ZStackAcquisition have a bit more going on under the hood, but can be used in the same way.


Customizing Feature Functionality in the GUI

Features can be optionally customized within the GUI. For example instead of reprogramming a feature and loading it again, we can swap Python functions in and out of features. This can be helpful, e.g., when you are prototyping a function to automatically detect an object within an image and want to try a few different options.


Loading Custom Functions

  1. You can load customized functions in the software by selecting the menu Features ‣ Advanced Setting.

    ../_images/step_10.png
  2. In the Advanced Setting popup window, choose the feature name with which you want to use the dynamic customized functions as feature parameters.

    ../_images/step_11.png ../_images/step_12.png
  3. Click Add, A new line will appear and allow you to edit the parameter options. Type the function name which is defined in your python file.

    ../_images/step_13.png
  4. Then click Load to choose your Python file.

    ../_images/step_14.png
  5. When you run a feature list containing the feature you just set, the new function name will appear and you can choose the one you just added.

    ../_images/step_15.png

Creating a Custom Feature List in the GUI

Once you have loaded your feature list, the next step is to use it in combination with other features to create an intelligent acquisition workflow. To do this, you will need to create a new feature list that combines your custom feature with other features:

  1. Select Features ‣ Add Customized Feature List. This will open a new dialog box that allows you to create a new feature list.

  2. Provide the feature list with a Feature List Name of your choice, and type the feature list content (which must be a list object). The feature list content could be the whole feature list or just a simple feature name. In this example, the feature list name is Feature Example 2, and the content is a simple feature name:

    [{"name": PrepareNextChannel}]
    

    Once you select Preview, the feature list will be displayed in the Preview window. If you are satisfied with the feature list, select OK to save it.

    ../_images/step_3.png
  3. You can edit the list of features directly by modifying the text, or through a popup menu that is available by right clicking the feature tile. The popup menu allows you to add a new feature, delete a feature, or edit a feature. In this example, click Insert After, and a new feature PrepareNextChannel will be inserted by default.

    ../_images/step_4.png ../_images/step_5.png
  4. To change the identity of the inserted feature, you can select a different feature form the drop-down menu. For example, the feature can be changed from PrepareNextChannel to LoopByCount. The parameters of the feature can be changed automatically in the popup window.

    ../_images/step_6.png
  5. If you click the preview button, a graphical representation of the feature list will be displayed.

    ../_images/step_7.png
  1. If you want a loop structure, type a pair of parentheses around the features, then click Preview. Given this design, you can loop through arbitrary features in a user-selected format.

    How to create a custom feature list.
  2. After editing the feature list, click Add. The new feature list will show up under the Features menu.


Editing Feature Lists on the Fly

  1. Select the feature list you want to run, choose “Customized” acquisition mode, and then click Acquire. A Feature List Configuration popup window will show up. In this popup window, you can see the structure of the selected feature list.

    ../_images/step_16.png ../_images/step_17.png ../_images/step_18.png
  2. Click one feature in the preview window, a Feature Parameters window will show up. Then set the desired parameters (e.g., planes in this screenshot). Close the Feature Parameters window.

    ../_images/step_19.png
  3. Click Confirm. The feature list will start to run.

    ../_images/step_20.png

Deleting Feature Lists

  1. Select the feature list you want to delete in the Features menu.

  2. Then, go back to the Features menu and select Delete Selected Feature The feature list will be removed from the menu and the software.

    ../_images/step_9.png

Text Representation of Feature Lists

At the bottom of each of the Feature List Configuration frames above, there is a text box with a textual representation of the feature list. As an alternative to point-and-click editing, a user can update feature lists by editing this textual representation and then pressing Preview.

The square brackets [] create a sequence of events to run in the feature container. The {} braces contain features. The parentheses () indicate a loop.

As an example, let’s look at the feature list that describes the Continuous Scan mode:

[
  (
    {"name": PrepareNextChannel},
    {
        "name": LoopByCount,
        "args": ("experiment.MicroscopeState.selected_channels",),
    },
  )
]

Here, we have a sequence defined by [] containing one element, a loop, indicated by the closed parentheses. There are two features within this loop. One feature has the name PrepareNextChannel and the other LoopByCount. The parentheses indicate we will keep looping through both of these features until stopping criteria is met. In this case, the looping will stop when LoopByCount returns False due to running out of selected_channels to loop through. That is, it will end once all selected channel have been imaged.