Skip to content

Latest commit

 

History

History
79 lines (47 loc) · 3.02 KB

README.md

File metadata and controls

79 lines (47 loc) · 3.02 KB

Mesofield

This is a PyQt application that is designed to interface with scientific hardware through serial connections and MicroManager

The core of the application is the ExperimentConfig class (mesofield.config.ExperimentConfig) and the corresponding ConfigController widget (mesofield.gui.widgets.ConfigController)

Currently, ExperimentConfig loads hardware configurations via the mesofield.startup.Startup dataclass which loads by default params.json in the module directory

The ConfigController loads parameters to the ExperimentConfig instance by passing a JSON file to the ExperimentConfig.load_parameters() method.

A single instance of the ExperimentConfig is passed for reference to each component of the application.

NOTE: This has only been tested on Windows 10/11. Hardware control features rely on pymmcore-plus and an installation of MicroManager with specific device drivers.

Setting Up Mesofield in Visual Studio Code

Below is a brief tutorial on how to set up a Python environment in VS Code, install mesofield, and run the [mesofield] CLI.

1. Clone and Open in VS Code

  1. Clone this repository (or download it) to your local machine.
  2. Open the folder in Visual Studio Code.

2. Create a Virtual Environment

You can use a conda environment or a venv

Open VS Code’s integrated terminal and create a virtual environment:

python -m venv .venv

Activate it:

  • On Windows:
.venv\Scripts\activate

3. Install Dependencies

Install the required dependencies using [requirements.txt]:

pip install -r requirements.txt

Optionally, you can install directly from [setup.py]:

pip install .

Notable dependencies include: pymmcore-plus, pymmcore-widgets (for the MDAWidget), useq, PyQt, pyqtgraph, pyserial, pandas, numpy, matplotlib

4. Launch Mesofield

Run the mesofield module in development mode from [mesofield.main]:

python -m mesofield launch --dev True

That’s it! This will open the main Mesofield GUI and set it up with simulated hardware for development.

Using the Console in Mesofield

The IPython terminal can be launched with the Toggle Console button in the top-left menu bar.

The console gives you access to the backend of the application. Type >>locals() into the terminal to see the accesible namespace using dot-notation

self provides access to the MainWindow and its attributes config provides you access to the ExperimentConfig mda provides access to the MDAWidget

The config command is the most useful outside of development. Type config.hardware to see the loaded hardware, for example. Type config. + tab to see the available methods and parameters. Test them out, nothing should break in development mode.