Skip to content

fdrgsp/micromanager-gui

Repository files navigation

Micro-Manager GUI for Calcium Imaging

CI codecov

A Micro-Manager GUI based on pymmcore-widgets and pymmcore-plus.

It has been designed to record calcium imaging experiments with or without optical stimulation using Arduino and Thorlabs Components (paper in press...).

Screenshot 2025-05-30 at 4 23 04 PM
20250711_SupplementaryVideo1.mp4

Table of Contents

Installation

Create a virtual environment and install the package using pip:

pip install git+https://github.com/fdrgsp/micromanager-gui

Note: this is also installing the PyQt6 library for the GUI.

Installing Micro-Manager

You also need to install the Micro-Manager device adapters and C++ core provided by mmCoreAndDevices. This can be done by following the steps described in the pymmcore-plus documentation page.

Run the Micro-Manger GUI

mmgui

By passing the -c or -config flag, you can specify the path of a micromanager configuration file you want to load. For example:

mmgui -c path/to/config.cfg

Run the Micro-Manger GUI with SlackBot

By passing the -s or -slack boolean flag, you will be able to use a SlackBot to control the microscope. In particular, you will be able to start and stop the acquisition and to get the progress of the acquisition.

For example:

mmgui -c path/to/config.cfg -s True

To enable the SlackBot, you first need to follow the instructions in the Slack Bolt documentation to create your Slack App and get your SLACK_BOT_TOKEN and SLACK_APP_TOKEN. In particular, go through the Create an app, Tokens and installing apps and Setting up your project sections (NOTE: you can use this App Manifest to create your Slack App).

The OAuth & Permissions Scope required are:

  • channels:history
  • channels:read
  • chat:write
  • commands

Since this SlackBot comunicates with the Micro-Manager through a set of Slack commands, you also need to set up the following command in your Slack App Slash Commands section:

  • /run: Start the MDA Sequence
  • /cancel: Cancel the current MDA Sequence
  • /progress: Get the current MDA Sequence progress
  • /clear: Clear the chat from the SlackBot messages
  • /mda: Get the current MDASequence

Now that you have your SLACK_BOT_TOKEN and SLACK_APP_TOKEN, you can either create a .env file in the root of this project containing the SLACK_BOT_TOKEN and SLACK_APP_TOKEN variables (e.g. SLACK_BOT_TOKEN=xoxb-... and SLACK_APP_TOKEN=xapp...) or set them as global environment variables (e.g. export SLACK_BOT_TOKEN=xoxb-... and export SLACK_APP_TOKEN=xapp...).

The last step is to grant access to the desired Slack channel to the Slack App. This can be done by inviting the Slack App to the desired Slack channel: right-click on the channel name, select View channel details, select the Integrations tab and Add Apps. You now need to add to the .env file (or as global environment) a variable named CHANNEL_ID containing the Slack channel ID.

After that, you can run the GUI with the -s or -slack flag set to True and start using the Slack commands to interact with the microscope.

SlackBot App Manifest example

display_information:
  name: Eve
  description: A SlackBot for MicroManager & pymmcore-plus
  background_color: "#737373"
features:
  bot_user:
    display_name: Eve
    always_online: false
  slash_commands:
    - command: /run
      description: Run the MDA Acquisition
      should_escape: true
    - command: /cancel
      description: Cancel the ongoing MDA Acquisition
      should_escape: true
    - command: /progress
      description: Return the progress of the ongoing MDA Acquisition
      should_escape: true
    - command: /clear
      description: Clear the chat form the bot messages
      should_escape: true
    - command: /mda
      description: Return the current MDASequence.
      should_escape: true
oauth_config:
  scopes:
    bot:
      - chat:write
      - channels:read
      - channels:history
      - commands
settings:
  interactivity:
    is_enabled: true
  org_deploy_enabled: false
  socket_mode_enabled: true
  token_rotation_enabled: false

Run the Plate Viewer GUI

To explore the calcium imaging data acquired with micromanager-gui, you can use the Plate Viewer. This GUI allows you to visualize, segment (using Cellpose3) and analyze the calcium imaging data (currently you can use it only if you save the acquired data as tensorstore.zarr or ome.zarr).

To run the Plate Viewer GUI, you can use:

pv
20250711_SupplementaryVideo2.mp4

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5

Languages