Skip to content

Commit

Permalink
Upgrade PM and MM (#39)
Browse files Browse the repository at this point in the history
* pycromanager==0.27.2

* MM docs

* update github workflows to python 3.10

* upgrade to python 3.10

* pin ndtiff==1.12.2

* recommend MM 230312

* bump versions

* update docs

* bump setuptools version

* store mm version in __init__.py

* update acq_engine default mm_app_path

* remove defaults from CLI options

* Revert "update acq_engine default mm_app_path"

This reverts commit bc4dd05.

* Revert "remove defaults from CLI options"

This reverts commit 58f74de.

* store default paths in `run_acquisition` only

* bump versions

* Oryx demo size bugfix

* patch until micro-manager/mmCoreAndDevices#362 merges

* bump pycromanager version

---------

Co-authored-by: Uditha Velidandla <[email protected]>
  • Loading branch information
talonchandler and ieivanov authored Aug 8, 2023
1 parent 2c018e3 commit 0d170ff
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 21 deletions.
8 changes: 4 additions & 4 deletions docs/data_structure.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

# Data format
# Data format

This document defines the standard for organizing data acquired by the mantis microscope.

## Raw directory organization
## Raw directory organization

Organization of the raw data is constrained by the `pycromanager`-based acquisitioon engine. Currently, we structure raw data in the following hierarchy:

Expand Down Expand Up @@ -49,7 +49,7 @@ Each acquisition will contain a PTCZYX dataset; some dimensions may be singleton

The structure of the mantis acquisition log file is not final and is subject to change. Input is welcome. Currently, acquisition script writes one log file per call.

A `positions.csv` file will accompany each acquisition. This file is needed as it carries information about the position labels, which is not saved by `pycromanager`. In the future, we may decide to manage that differently - see [pycro-manager#575](https://github.com/micro-manager/pycro-manager/issues/575). A template for this file is provided [here](positions.csv).
A `positions.csv` file will accompany each acquisition. This file is needed as it carries information about the position labels, which is not saved by `pycromanager`. In the future, we may decide to manage that differently - see [pycro-manager#575](https://github.com/micro-manager/pycro-manager/issues/575). A template for this file is provided [here](positions.csv).

A `platemap.csv` file will accompany each acquisition. This file carries information about the sample in each well and is populated by the user. Multiple wells may contain the same sample. A template for this file is provided [here](platemap.csv).

Expand Down Expand Up @@ -97,4 +97,4 @@ We will also store position metadata within [ome-zarr metadata](https://github.c

* The modalities (channels) contained in one acquisition folder are identical, i.e., all positions and calibration folders contain either labelfree, lightsheet, or labelfree + lightsheet stacks.
* The names of Positions (`Pos`) may be renamed to reflect the condition or perturbation.
* Question: what constraints are imposed by recOrder and dexp analysis pipelines?
* Question: what constraints are imposed by recOrder and dexp analysis pipelines?
2 changes: 1 addition & 1 deletion docs/mantis_usage.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Overview
## Overview - unofficial
Mantis microscope is a fast multimodal microscope capable of acquiring label-free and fluorescence measurments simultaneously via two remote-refocus based arms that quickly acquire volumetric information.

---
Expand Down
11 changes: 8 additions & 3 deletions docs/setup_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,18 @@ TODO: Update the setup instructions to reflect requirements for coPylot control.

## Install Micro-manager

The mantis acquisition currently works with Micro-manager nightly build 2023-03-12.
The Micro-manager nightly build tested and recommended for the mantis acquisition engine is declared in [`mantis/__init__.py`](../mantis/__init__.py) and can be obtained with:

* Download [Micro-Manager nightly build 2023-03-12](https://download.micro-manager.org/nightly/2.0/Windows/MMSetup_64bit_2.0.1_20230312.exe) and install following the installer prompts in the `C:\Program Files\Micro-Manager-2.0_03_12_2023` directory.
```python
import mantis
print(mantis.__mm_version__)
```

* Download the recommended [Micro-Manager nightly build](https://download.micro-manager.org/nightly/2.0/Windows/) and install following the installer prompts in the `C:\Program Files\Micro-Manager-2.0_YYYY_MM_DD` directory.

* Copy the `Ti2_Mic_Driver.dll` device adapter located at `C:\Program Files\Nikon\Ti2-SDK\bin` to the Micro-manager install directory, as described [here](https://micro-manager.org/NikonTi2).

* Install another copy of [Micro-Manager nightly build 2023-03-12](https://download.micro-manager.org/nightly/2.0/Windows/MMSetup_64bit_2.0.1_20230312.exe) in the `C:\Program Files\Micro-Manager-nightly` directory. This copy of Micro-manager will be used by the headless light-sheet acquisition engine.
* Install another copy of the recommended [Micro-Manager nightly build](https://download.micro-manager.org/nightly/2.0/Windows/) in the `C:\Program Files\Micro-Manager-2.0_YYYY_MM_DD_2` directory. This copy of Micro-manager will be used by the headless light-sheet acquisition engine.

## Test the hardware setup

Expand Down
1 change: 1 addition & 0 deletions mantis/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
__version__ = "0.1.0"
__mm_version__ = "2023-08-03"
12 changes: 6 additions & 6 deletions mantis/acquisition/acq_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,11 @@ class MantisAcquisition(object):
Directory where acquired data will be saved
acquisition_name : str
Name of the acquisition
mm_app_path : str, optional
mm_app_path : str
Path to Micro-manager installation directory which runs the light-sheet
acquisition, by default 'C:\\Program Files\\Micro-Manager-nightly'
config_file : str, optional
Path to config file which runs the light-sheet acquisition, by default
acquisition, typically 'C:\\Program Files\\Micro-Manager-2.0_YYYY_MM_DD_2'
config_file : str
Path to config file which runs the light-sheet acquisition, typically
'C:\\CompMicro_MMConfigs\\mantis\\mantis-LS.cfg'
enable_ls_acq : bool, optional
Set to False if only acquiring label-free data, by default True
Expand Down Expand Up @@ -279,8 +279,8 @@ def __init__(
self,
acquisition_directory: Union[str, os.PathLike],
acquisition_name: str,
mm_app_path: str = r'C:\\Program Files\\Micro-Manager-nightly',
mm_config_file: str = r'C:\\CompMicro_MMConfigs\\mantis\\mantis-LS.cfg',
mm_app_path: str,
mm_config_file: str,
enable_ls_acq: bool = True,
enable_lf_acq: bool = True,
demo_run: bool = False,
Expand Down
4 changes: 4 additions & 0 deletions mantis/acquisition/microscope_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ def set_roi(mmc, roi: tuple):

mmc.set_roi(*roi)

# patch until https://github.com/micro-manager/mmCoreAndDevices/pull/362 is
# merged
mmc.initialize_circular_buffer()


def get_position_list(mmStudio, z_stage_name):
mm_pos_list = mmStudio.get_position_list_manager().get_position_list()
Expand Down
7 changes: 5 additions & 2 deletions mantis/acquisition/settings/demo_acquisition_settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ lf_slice_settings:
use_sequencing: True

lf_microscope_settings:
# patch until https://github.com/micro-manager/mmCoreAndDevices/pull/362 is
# merged
roi: [0, 0, 1224, 1024]
config_group_settings:
- ['LightPath', 'Camera-left']
device_property_settings:
- ['Camera', 'OnCameraCCDXSize', '1024']
- ['Camera', 'OnCameraCCDYSize', '1224']
- ['Camera', 'OnCameraCCDXSize', '1224']
- ['Camera', 'OnCameraCCDYSize', '1024']
- ['Camera', 'BitDepth', '12']
z_sequencing_settings:
- ['Z', 'UseSequences', 'Yes']
Expand Down
10 changes: 8 additions & 2 deletions mantis/cli/run_acquisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,29 @@
import click
import yaml

from mantis import __mm_version__
from mantis.cli.parsing import config_filepath, output_dirpath

default_mm_app_path = 'C:\\Program Files\\Micro-Manager-2.0_{}_{}_{}_2'.format(
*__mm_version__.split('-')
)
default_mm_config_filepath = 'C:\\CompMicro_MMConfigs\\mantis\\mantis-LS.cfg'


@click.command()
@config_filepath()
@output_dirpath()
@click.option(
"--mm-app-path",
default='C:\\Program Files\\Micro-Manager-nightly',
default=default_mm_app_path,
type=click.Path(exists=True, file_okay=False, dir_okay=True),
show_default=True,
help='''Path to Micro-manager installation directory
which will run the light-sheet acquisition''',
)
@click.option(
"--mm-config-filepath",
default='C:\\CompMicro_MMConfigs\\mantis\\mantis-LS.cfg',
default=default_mm_config_filepath,
type=click.Path(exists=True, file_okay=True, dir_okay=False),
show_default=True,
help='''Path to Micro-manager config file
Expand Down
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools >= 42", "setuptools_scm[toml]>=3.4", "wheel"]
requires = ["setuptools >= 61", "setuptools_scm[toml]>=3.4", "wheel"]

[project]
name = "mantis"
Expand All @@ -20,15 +20,16 @@ classifiers = [

# list package dependencies here
dependencies = [
"iohub==0.1.0.dev3",
"iohub==0.1.0.dev4",
"matplotlib",
"napari; 'arm64' in platform_machine", # without Qt5 and skimage
"napari[all]; 'arm64' not in platform_machine", # with Qt5 and skimage
"PyQt6; 'arm64' in platform_machine",
"natsort",
"ndtiff>=2.0",
"nidaqmx",
"numpy",
"pycromanager==0.25.40",
"pycromanager==0.28.1",
"pydantic",
"pylablib==1.4.1",
"scipy",
Expand Down

0 comments on commit 0d170ff

Please sign in to comment.