From fe629eac9ee5c5239d0741fc2b859212d21a4b3b Mon Sep 17 00:00:00 2001 From: hamdaan-shaikh <42545761+hamdaan-shaikh@users.noreply.github.com> Date: Mon, 31 Jul 2023 16:33:16 +0200 Subject: [PATCH 01/16] Implemented Stage API for Micromanager --- docs/pycromanager.ipynb | 275 ++++++++++++++++++ .../microscope_adapters/micromanager.py | 41 +++ 2 files changed, 316 insertions(+) create mode 100644 docs/pycromanager.ipynb create mode 100644 microscope_gym/microscope_adapters/micromanager.py diff --git a/docs/pycromanager.ipynb b/docs/pycromanager.ipynb new file mode 100644 index 0000000..8ec4101 --- /dev/null +++ b/docs/pycromanager.ipynb @@ -0,0 +1,275 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n" + ] + } + ], + "source": [ + "from pycromanager import Core\n", + "\n", + "core = Core()\n", + "print(core)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "from pycromanager import Acquisition, multi_d_acquisition_events\n", + "\n", + "with Acquisition(directory='data/umanager', name='test_acquisition') as acq:\n", + " # Generate the events for a single z-stack\n", + " events = multi_d_acquisition_events(z_start=0, z_end=10, z_step=0.5)\n", + " acq.acquire(events)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "device = core.get_xy_stage_device()" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'XY'" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "device" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'Z'" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "core.get_focus_device()\n" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'Autofocus'" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "core.get_auto_focus_device()" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "4.005" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "core.get_x_position()" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "4.995" + ] + }, + "execution_count": 43, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "core.get_y_position()" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "6" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "core.get_position()\n", + "#Returns the current position of the stage in microns. Uses the current Z positioner (focus) device." + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "core.has_property('XY', 'pos')" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'XY'" + ] + }, + "execution_count": 26, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "core.get_xy_stage_device()" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [], + "source": [ + "config_groups = core.get_available_config_groups()" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": {}, + "outputs": [], + "source": [ + "core.set_xy_position(4, 5)" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 46, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "core.device_busy('Z')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "pycromanager", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.16" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/microscope_gym/microscope_adapters/micromanager.py b/microscope_gym/microscope_adapters/micromanager.py new file mode 100644 index 0000000..532054b --- /dev/null +++ b/microscope_gym/microscope_adapters/micromanager.py @@ -0,0 +1,41 @@ +from collections import OrderedDict +from pycromanager import Core +from microscope_gym import interface +from microscope_gym.interface import Objective, Microscope, Axis + + +class Stage(interface.Stage): + def __init__(self, mm_core: Core) -> None: + self.microscope_handler = mm_core + self.axes = OrderedDict() + self._get_axes_positions_from_microscope() + + def _get_axes_positions_from_microscope(self): + self.axes["z"] = Axis(name='z', + position_um=self.microscope_handler.get_position(), + min=-10, # TODO Figure out how to get this from MMCore + max=10) # TODO Figure out how to get this from MMCore + self.axes["y"] = Axis(name='y', + position_um=self.microscope_handler.get_y_position(), + min=-10, # TODO Figure out how to get this from MMCore + max=10) # TODO Figure out how to get this from MMCore + self.axes["x"] = Axis(name='x', + position_um=self.microscope_handler.get_x_position(), + min=-10, # TODO Figure out how to get this from MMCore + max=10) # TODO Figure out how to get this from MMCore + + def is_moving(self): + focus_device_name = self.microscope_handler.get_focus_device() + stage_device_name = self.microscope_handler.get_xy_stage_device() + + return self.microscope_handler.device_busy( + focus_device_name) or self.microscope_handler.device_busy(stage_device_name) + + +class Camera(interface.Camera): + def __init__(self, mm_core: Core) -> None: + self.microscope_handler = mm_core + + def capture_image(self) -> "numpy.ndarray": + # Trigger the Snap funtion from MicroManager and get the data + pass # TODO Figure out how to get this from MMCore From 88e1b7bac31e9a24e1aab580bb5f6193e9892bfa Mon Sep 17 00:00:00 2001 From: hamdaan-shaikh <42545761+hamdaan-shaikh@users.noreply.github.com> Date: Mon, 31 Jul 2023 16:59:26 +0200 Subject: [PATCH 02/16] Added _update_axes_positions() --- .../microscope_adapters/micromanager.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/microscope_gym/microscope_adapters/micromanager.py b/microscope_gym/microscope_adapters/micromanager.py index 532054b..e59b0d3 100644 --- a/microscope_gym/microscope_adapters/micromanager.py +++ b/microscope_gym/microscope_adapters/micromanager.py @@ -1,4 +1,5 @@ from collections import OrderedDict +from typing import List from pycromanager import Core from microscope_gym import interface from microscope_gym.interface import Objective, Microscope, Axis @@ -31,6 +32,22 @@ def is_moving(self): return self.microscope_handler.device_busy( focus_device_name) or self.microscope_handler.device_busy(stage_device_name) + def _update_axes_positions(self, axis_names: List[str], positions: List[float]): + '''Write new positions to axes. + + Position validation is done in Axis model. + + Parameters: + axis_names: list[str] + list of axis names + positions: list[float] + list of new positions (in um) + ''' + for name, position in zip(axis_names, positions): + self.axes[name].position_um = position + self.microscope_handler.set_xy_stage_position(self.axes['x'].position_um, self.axes['y'].position_um) + self.microscope_handler.set_position(self.axes['z'].position_um) + class Camera(interface.Camera): def __init__(self, mm_core: Core) -> None: From 9c651745c76abb819d90644347529a0f77f8d775 Mon Sep 17 00:00:00 2001 From: hamdaan-shaikh <42545761+hamdaan-shaikh@users.noreply.github.com> Date: Mon, 31 Jul 2023 17:01:18 +0200 Subject: [PATCH 03/16] Fixed set_xy_position --- microscope_gym/microscope_adapters/micromanager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microscope_gym/microscope_adapters/micromanager.py b/microscope_gym/microscope_adapters/micromanager.py index e59b0d3..3a3131d 100644 --- a/microscope_gym/microscope_adapters/micromanager.py +++ b/microscope_gym/microscope_adapters/micromanager.py @@ -45,7 +45,7 @@ def _update_axes_positions(self, axis_names: List[str], positions: List[float]): ''' for name, position in zip(axis_names, positions): self.axes[name].position_um = position - self.microscope_handler.set_xy_stage_position(self.axes['x'].position_um, self.axes['y'].position_um) + self.microscope_handler.set_xy_position(self.axes['x'].position_um, self.axes['y'].position_um) self.microscope_handler.set_position(self.axes['z'].position_um) From 2c9e02d66bf9b6c6defc54ec2642473d0784abfc Mon Sep 17 00:00:00 2001 From: hamdaan-shaikh <42545761+hamdaan-shaikh@users.noreply.github.com> Date: Mon, 31 Jul 2023 17:01:39 +0200 Subject: [PATCH 04/16] Played with Stage positions --- docs/pycromanager.ipynb | 80 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) diff --git a/docs/pycromanager.ipynb b/docs/pycromanager.ipynb index 8ec4101..ec233a0 100644 --- a/docs/pycromanager.ipynb +++ b/docs/pycromanager.ipynb @@ -9,7 +9,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "\n" + "\n" ] } ], @@ -242,6 +242,84 @@ "core.device_busy('Z')" ] }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "core.set_xy_position(2,3)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1.9949999999999999" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "core.get_x_position()" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "3" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "core.get_y_position()" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "core.set_position(5)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "5" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "core.get_position()" + ] + }, { "cell_type": "code", "execution_count": null, From be607fc79c7ef86d4b7016f98752f5017aa819ef Mon Sep 17 00:00:00 2001 From: hamdaan-shaikh <42545761+hamdaan-shaikh@users.noreply.github.com> Date: Mon, 31 Jul 2023 17:19:23 +0200 Subject: [PATCH 05/16] Added save_path for Camera images --- microscope_gym/microscope_adapters/micromanager.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/microscope_gym/microscope_adapters/micromanager.py b/microscope_gym/microscope_adapters/micromanager.py index 3a3131d..5b96f2b 100644 --- a/microscope_gym/microscope_adapters/micromanager.py +++ b/microscope_gym/microscope_adapters/micromanager.py @@ -1,5 +1,6 @@ from collections import OrderedDict from typing import List +from pathlib import Path from pycromanager import Core from microscope_gym import interface from microscope_gym.interface import Objective, Microscope, Axis @@ -50,8 +51,14 @@ def _update_axes_positions(self, axis_names: List[str], positions: List[float]): class Camera(interface.Camera): - def __init__(self, mm_core: Core) -> None: + def __init__(self, mm_core: Core, save_path: str = '') -> None: self.microscope_handler = mm_core + if save_path == '': + import tempfile + self.save_path = Path(tempfile.mkdtemp) + else: + self.save_path = Path(save_path) + self.save_path.mkdir(exist_ok=True, parents=True) def capture_image(self) -> "numpy.ndarray": # Trigger the Snap funtion from MicroManager and get the data From b0b3dfc98d021e7c2e558e72744d525f4ef536f7 Mon Sep 17 00:00:00 2001 From: Jamie White <74255929+jqwhite@users.noreply.github.com> Date: Tue, 15 Aug 2023 15:18:38 +0200 Subject: [PATCH 06/16] snap image done. exploring how to get and set camera properties. --- docs/micromanager_testing.ipynb | 1256 +++++++++++++++++ .../microscope_adapters/micromanager.py | 71 +- 2 files changed, 1321 insertions(+), 6 deletions(-) create mode 100644 docs/micromanager_testing.ipynb diff --git a/docs/micromanager_testing.ipynb b/docs/micromanager_testing.ipynb new file mode 100644 index 0000000..78dcded --- /dev/null +++ b/docs/micromanager_testing.ipynb @@ -0,0 +1,1256 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "source": [ + "Examples\n", + ">>> core = CMMCorePlus()\n", + ">>> device = Device('Camera', core)\n", + ">>> device.isLoaded()\n", + ">>> device.load('NotALib', 'DCam') # useful error\n", + ">>> device.load('DemoCamera', 'DCam')\n", + ">>> device.initialize()\n", + ">>> device.load('DemoCamera', 'DCam') # no-op w/ useful warning\n", + ">>> device.properties # tuple of DeviceProperty objects\n", + ">>> device.description()\n", + ">>> device.isBusy()\n", + ">>> device.wait()\n", + ">>> device.type()\n", + ">>> device.schema() # JSON schema of device properties\n", + "Params:\n", + "device_label – Device this property belongs to\n", + "mmcore – CMMCorePlus instance" + ], + "metadata": { + "collapsed": false + }, + "id": "9be652cc12c8a89a" + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "initial_id", + "metadata": { + "collapsed": true, + "ExecuteTime": { + "end_time": "2023-08-15T12:46:33.788056Z", + "start_time": "2023-08-15T12:46:33.565657Z" + } + }, + "outputs": [], + "source": [ + "import os.path\n", + "from enum import property\n", + "\n", + "# import numpy as np\n", + "import pymmcore_plus\n", + "from pymmcore_plus import CMMCorePlus, Device\n", + "from pymmcore_plus import find_micromanager" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "outputs": [ + { + "data": { + "text/plain": "'/Applications/Micro-Manager'" + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "micromanager_path = find_micromanager()\n", + "micromanager_path" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:46:33.803668Z", + "start_time": "2023-08-15T12:46:33.778931Z" + } + }, + "id": "ecad81c4c22e42f6" + }, + { + "cell_type": "code", + "execution_count": 3, + "outputs": [], + "source": [ + "# finding my way around a bit.\n", + "\n", + "mm_dir = find_micromanager()\n", + "config_file = 'MMConfig_demo.cfg'\n", + "\n", + "mmc = CMMCorePlus().instance()\n", + "mmc.setDeviceAdapterSearchPaths([mm_dir])\n", + "mmc.loadSystemConfiguration(os.path.join(mm_dir, config_file))" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:46:33.827148Z", + "start_time": "2023-08-15T12:46:33.785893Z" + } + }, + "id": "67b2bb34999df469" + }, + { + "cell_type": "code", + "execution_count": 4, + "outputs": [], + "source": [ + "mmc.snapImage??" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:46:33.864601Z", + "start_time": "2023-08-15T12:46:33.823058Z" + } + }, + "id": "db5e8c91fd6ae8f1" + }, + { + "cell_type": "code", + "execution_count": 5, + "outputs": [ + { + "data": { + "text/plain": "numpy.ndarray" + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mmc.snapImage()\n", + "image = mmc.getImage()\n", + "# np.array(image)\n", + "type(image)\n", + "# mmc.getImage()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:46:33.904095Z", + "start_time": "2023-08-15T12:46:33.857685Z" + } + }, + "id": "d900a080024977cd" + }, + { + "cell_type": "code", + "execution_count": 6, + "outputs": [ + { + "data": { + "text/plain": "array([[3276, 3339, 3402, ..., 3087, 3150, 3213],\n [3284, 3347, 3410, ..., 3095, 3158, 3221],\n [3292, 3355, 3418, ..., 3103, 3166, 3229],\n ...,\n [5846, 5846, 5844, ..., 5837, 5842, 5845],\n [5846, 5846, 5844, ..., 5838, 5842, 5845],\n [5846, 5846, 5843, ..., 5839, 5843, 5845]], dtype=uint16)" + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "image" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:46:33.904381Z", + "start_time": "2023-08-15T12:46:33.871589Z" + } + }, + "id": "a857247e33a72859" + }, + { + "cell_type": "code", + "execution_count": 7, + "outputs": [], + "source": [ + "mmc.snap??" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:46:33.905860Z", + "start_time": "2023-08-15T12:46:33.875080Z" + } + }, + "id": "5122b34bc0288bb3" + }, + { + "cell_type": "code", + "execution_count": 18, + "outputs": [ + { + "data": { + "text/plain": "array([[5846, 5845, 5843, ..., 5839, 5843, 5845],\n [5846, 5845, 5843, ..., 5840, 5843, 5846],\n [5846, 5845, 5842, ..., 5840, 5844, 5846],\n ...,\n [3300, 3237, 3174, ..., 3489, 3426, 3363],\n [3292, 3229, 3166, ..., 3481, 3418, 3355],\n [3284, 3221, 3158, ..., 3473, 3410, 3347]], dtype=uint16)" + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mmc.snap()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:46:52.762002Z", + "start_time": "2023-08-15T12:46:52.736119Z" + } + }, + "id": "ec2bd2d092f73425" + }, + { + "cell_type": "code", + "execution_count": 23, + "outputs": [ + { + "data": { + "text/plain": "('Res10x', 'Res20x', 'Res40x')" + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mmc.getAvailablePixelSizeConfigs()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:49:44.143958Z", + "start_time": "2023-08-15T12:49:44.114655Z" + } + }, + "id": "a33bb7ac60b1b4c6" + }, + { + "cell_type": "code", + "execution_count": 56, + "outputs": [ + { + "data": { + "text/plain": "dict_keys(['Camera', 'Dichroic', 'Emission', 'Excitation', 'Objective', 'Z', 'Path', 'XY', 'White Light Shutter', 'Autofocus', 'LED', 'LED Shutter', 'Core'])" + }, + "execution_count": 56, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mmc.getSystemState().dict().keys()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:58:18.926994Z", + "start_time": "2023-08-15T12:58:18.912057Z" + } + }, + "id": "516a7cc646a0750b" + }, + { + "cell_type": "markdown", + "source": [], + "metadata": { + "collapsed": false + }, + "id": "aa00906361d95fa0" + }, + { + "cell_type": "code", + "execution_count": 59, + "outputs": [ + { + "data": { + "text/plain": "'Camera'" + }, + "execution_count": 59, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mmc.getCameraDevice()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T13:11:03.888331Z", + "start_time": "2023-08-15T13:11:03.850539Z" + } + }, + "id": "5c7fa138702e96ef" + }, + { + "cell_type": "code", + "execution_count": 60, + "outputs": [], + "source": [ + "camera_name = mmc.getCameraDevice()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T13:11:15.158120Z", + "start_time": "2023-08-15T13:11:15.133511Z" + } + }, + "id": "43a5a3f62fe4cb37" + }, + { + "cell_type": "code", + "execution_count": 63, + "outputs": [ + { + "data": { + "text/plain": "('AllowMultiROI',\n 'AsyncPropertyDelayMS',\n 'AsyncPropertyFollower',\n 'AsyncPropertyLeader',\n 'Binning',\n 'BitDepth',\n 'CCDTemperature',\n 'CCDTemperature RO',\n 'CameraID',\n 'CameraName',\n 'Description',\n 'DisplayImageNumber',\n 'DropPixels',\n 'Exposure',\n 'FastImage',\n 'FractionOfPixelsToDropOrSaturate',\n 'Gain',\n 'HubID',\n 'MaximumExposureMs',\n 'Mode',\n 'MultiROIFillValue',\n 'Name',\n 'Offset',\n 'OnCameraCCDXSize',\n 'OnCameraCCDYSize',\n 'Photon Conversion Factor',\n 'Photon Flux',\n 'PixelType',\n 'ReadNoise (electrons)',\n 'ReadoutTime',\n 'RotateImages',\n 'SaturatePixels',\n 'ScanMode',\n 'SimulateCrash',\n 'StripeWidth',\n 'TestProperty1',\n 'TestProperty2',\n 'TestProperty3',\n 'TestProperty4',\n 'TestProperty5',\n 'TestProperty6',\n 'TransposeCorrection',\n 'TransposeMirrorX',\n 'TransposeMirrorY',\n 'TransposeXY',\n 'TriggerDevice',\n 'UseExposureSequences')" + }, + "execution_count": 63, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_properties = mmc.getDevicePropertyNames(camera_name)\n", + "camera_properties" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T13:12:54.281523Z", + "start_time": "2023-08-15T13:12:54.277338Z" + } + }, + "id": "ba615747b5cf6fd" + }, + { + "cell_type": "code", + "execution_count": 67, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "AllowMultiROI: 0\n", + "AsyncPropertyDelayMS: 2000\n", + "AsyncPropertyFollower: \n", + "AsyncPropertyLeader: \n", + "Binning: 1\n", + "BitDepth: 16\n", + "CCDTemperature: 0.0000\n", + "CCDTemperature RO: 0.0000\n", + "CameraID: V1.0\n", + "CameraName: DemoCamera-MultiMode\n", + "Description: Demo Camera Device Adapter\n", + "DisplayImageNumber: 0\n", + "DropPixels: 0\n", + "Exposure: 10.0000\n", + "FastImage: 0\n", + "FractionOfPixelsToDropOrSaturate: 0.0020\n", + "Gain: 0\n", + "HubID: \n", + "MaximumExposureMs: 10000.0000\n", + "Mode: Artificial Waves\n", + "MultiROIFillValue: 0\n", + "Name: DCam\n", + "Offset: 0\n", + "OnCameraCCDXSize: 512\n", + "OnCameraCCDYSize: 512\n", + "Photon Conversion Factor: 1.0000\n", + "Photon Flux: 50.0000\n", + "PixelType: 16bit\n", + "ReadNoise (electrons): 2.5000\n", + "ReadoutTime: 0.0000\n", + "RotateImages: 0\n", + "SaturatePixels: 0\n", + "ScanMode: 1\n", + "SimulateCrash: \n", + "StripeWidth: 1.0000\n", + "TestProperty1: 0.0000\n", + "TestProperty2: 0.0000\n", + "TestProperty3: 0.0000\n", + "TestProperty4: 0.0000\n", + "TestProperty5: 0.0000\n", + "TestProperty6: 0.0000\n", + "TransposeCorrection: 0\n", + "TransposeMirrorX: 0\n", + "TransposeMirrorY: 0\n", + "TransposeXY: 0\n", + "TriggerDevice: \n", + "UseExposureSequences: No\n" + ] + } + ], + "source": [ + "for property in camera_properties:\n", + " print(f'{property}: {mmc.getProperty(camera_name, property)}')" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T13:16:21.092061Z", + "start_time": "2023-08-15T13:16:21.088312Z" + } + }, + "id": "565b340440042438" + }, + { + "cell_type": "code", + "execution_count": 9, + "outputs": [], + "source": [ + "# core = pymmcore_plus.CMMCorePlus().instance()\n", + "core = CMMCorePlus()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:46:33.929405Z", + "start_time": "2023-08-15T12:46:33.891879Z" + } + }, + "id": "4574c4cbcfaf3d3" + }, + { + "cell_type": "code", + "execution_count": 10, + "outputs": [], + "source": [ + "core.loadSystemConfiguration()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:46:33.929770Z", + "start_time": "2023-08-15T12:46:33.906592Z" + } + }, + "id": "ccbe1d7bbbeed9ad" + }, + { + "cell_type": "code", + "execution_count": 11, + "outputs": [], + "source": [ + "device = Device('Stage', core)" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:46:33.929838Z", + "start_time": "2023-08-15T12:46:33.910878Z" + } + }, + "id": "cf1b058d0c36dd7" + }, + { + "cell_type": "code", + "execution_count": 12, + "outputs": [ + { + "data": { + "text/plain": "False" + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "device.isLoaded()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:46:33.929947Z", + "start_time": "2023-08-15T12:46:33.912981Z" + } + }, + "id": "210bfdaae941348f" + }, + { + "cell_type": "code", + "execution_count": 13, + "outputs": [ + { + "data": { + "text/plain": "'\\ndevice.load(\\'XY\\', \\'Stage\\')\\nRuntimeError: Failed to load device \"Stage\" from adapter module \"XY\". Adapter name \\'XY\\' not in list of known adapter names: (\\'LightSheetManager\\', \\'ASITiger\\', \\'LeicaDMR\\', \\'XLightV3\\', \\'HamiltonMVP\\', \\'SutterLambda\\', \\'LudlLow\\', \\'LeicaDMI\\', \\'CoolLEDpE4000\\', \\'CoherentOBIS\\', \\'XLight\\', \\'ImageProcessorChain\\', \\'SutterMPC\\', \\'SerialManager\\', \\'PIEZOCONCEPT\\', \\'MicroPoint\\', \\'CSUX\\', \\'MaestroServo\\', \\'CoherentCube\\', \\'LaserQuantumLaser\\', \\'CoolLEDpE300\\', \\'ThorLabs\\', \\'VariLC\\', \\'Nikon\\', \\'SequenceTester\\', \\'SpectralLMM5\\', \\'MicroFPGA\\', \\'MoticUCam\\', \\'MarzhauserLStep\\', \\'IsmatecMCP\\', \\'StarlightXpress\\', \\'PI\\', \\'XCiteXT600\\', \\'NewportCONEX\\', \\'SutterLambdaParallelArduino\\', \\'PriorLegacy\\', \\'BlueboxOptics_niji\\', \\'XCite120PCExacte\\', \\'ThorlabsElliptecSlider\\', \\'ArduinoNeoPixel\\', \\'ChuoSeikiMD5000\\', \\'NikonAZ100\\', \\'SmarActHCU3D\\', \\'Piezosystem_NV40_1\\', \\'Aquinas\\', \\'ChuoSeikiQT\\', \\'PIGCS2\\', \\'OxxiusCombiner\\', \\'OpenCVgrabber\\', \\'MP285\\', \\'TriggerScopeMM\\', \\'Utilities.la\\', \\'ThorLabsSC10\\', \\'CARVII\\', \\'KDV\\', \\'Xcite\\', \\'Cobolt\\', \\'Arduino\\', \\'pgFocus\\', \\'FreeSerialPort\\', \\'K8055\\', \\'Stradus\\', \\'Vincent\\', \\'ASIWPTR\\', \\'Piezosystem_NV120_1\\', \\'GPhoto\\', \\'ESImagingIOControllers\\', \\'nPoint\\', \\'Piezosystem_dDrive\\', \\'DemoCamera\\', \\'ThorlabsFilterWheel\\', \\'NewportSMC\\', \\'LumencorSpectra\\', \\'FakeCamera\\', \\'LeicaDMSTC\\', \\'MarzhauserLStepOld\\', \\'HIDManager\\', \\'OVP_ECS2\\', \\'Prior\\', \\'YodnE600\\', \\'Diskovery\\', \\'NNLC\\', \\'CSUW1\\', \\'VarispecLCTF\\', \\'Aladdin\\', \\'TriggerScope\\', \\'FocalPoint\\', \\'SutterStage\\', \\'ZeissCAN\\', \\'CSU22\\', \\'Thorlabs_ELL14\\', \\'NikonTE2000\\', \\'AAAOTF\\', \\'SouthPort\\', \\'ThorlabsDCxxxx\\', \\'Toptica_iBeamSmartCW\\', \\'Skyra\\', \\'CoherentScientificRemote\\', \\'VersaLase\\', \\'Arduino32bitBoards\\', \\'RAMPS\\', \\'dc1394\\', \\'Polychrome5000\\', \\'ZeissCAN29\\', \\'UserDefinedSerial\\', \\'DemoCamera.la\\', \\'Oxxius\\', \\'ASIFW1000\\', \\'Utilities\\', \\'Scientifica\\', \\'WieneckeSinske\\', \\'Conix\\', \\'Neos\\', \\'SutterLambda2\\', \\'Piezosystem_30DV50\\', \\'Omicron\\', \\'Olympus\\', \\'XCiteLed\\', \\'IIDC\\', \\'Ludl\\', \\'Piezosystem_NV40_3\\', \\'PrecisExcite\\', \\'Marzhauser\\', \\'NikonEclipse90i\\', \\'Hydra\\', \\'ASIStage\\', \\'Sapphire\\', \\'USBManager\\', \\'Tofra\\', \\'Pecon\\', \\'Zaber\\', \\'Corvus\\', \\'PIGCS\\', \\'K8061\\', \\'MPBLaser\\').\\n\\n'" + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "'''\n", + "device.load('XY', 'Stage')\n", + "RuntimeError: Failed to load device \"Stage\" from adapter module \"XY\". Adapter name 'XY' not in list of known adapter names: ('LightSheetManager', 'ASITiger', 'LeicaDMR', 'XLightV3', 'HamiltonMVP', 'SutterLambda', 'LudlLow', 'LeicaDMI', 'CoolLEDpE4000', 'CoherentOBIS', 'XLight', 'ImageProcessorChain', 'SutterMPC', 'SerialManager', 'PIEZOCONCEPT', 'MicroPoint', 'CSUX', 'MaestroServo', 'CoherentCube', 'LaserQuantumLaser', 'CoolLEDpE300', 'ThorLabs', 'VariLC', 'Nikon', 'SequenceTester', 'SpectralLMM5', 'MicroFPGA', 'MoticUCam', 'MarzhauserLStep', 'IsmatecMCP', 'StarlightXpress', 'PI', 'XCiteXT600', 'NewportCONEX', 'SutterLambdaParallelArduino', 'PriorLegacy', 'BlueboxOptics_niji', 'XCite120PCExacte', 'ThorlabsElliptecSlider', 'ArduinoNeoPixel', 'ChuoSeikiMD5000', 'NikonAZ100', 'SmarActHCU3D', 'Piezosystem_NV40_1', 'Aquinas', 'ChuoSeikiQT', 'PIGCS2', 'OxxiusCombiner', 'OpenCVgrabber', 'MP285', 'TriggerScopeMM', 'Utilities.la', 'ThorLabsSC10', 'CARVII', 'KDV', 'Xcite', 'Cobolt', 'Arduino', 'pgFocus', 'FreeSerialPort', 'K8055', 'Stradus', 'Vincent', 'ASIWPTR', 'Piezosystem_NV120_1', 'GPhoto', 'ESImagingIOControllers', 'nPoint', 'Piezosystem_dDrive', 'DemoCamera', 'ThorlabsFilterWheel', 'NewportSMC', 'LumencorSpectra', 'FakeCamera', 'LeicaDMSTC', 'MarzhauserLStepOld', 'HIDManager', 'OVP_ECS2', 'Prior', 'YodnE600', 'Diskovery', 'NNLC', 'CSUW1', 'VarispecLCTF', 'Aladdin', 'TriggerScope', 'FocalPoint', 'SutterStage', 'ZeissCAN', 'CSU22', 'Thorlabs_ELL14', 'NikonTE2000', 'AAAOTF', 'SouthPort', 'ThorlabsDCxxxx', 'Toptica_iBeamSmartCW', 'Skyra', 'CoherentScientificRemote', 'VersaLase', 'Arduino32bitBoards', 'RAMPS', 'dc1394', 'Polychrome5000', 'ZeissCAN29', 'UserDefinedSerial', 'DemoCamera.la', 'Oxxius', 'ASIFW1000', 'Utilities', 'Scientifica', 'WieneckeSinske', 'Conix', 'Neos', 'SutterLambda2', 'Piezosystem_30DV50', 'Omicron', 'Olympus', 'XCiteLed', 'IIDC', 'Ludl', 'Piezosystem_NV40_3', 'PrecisExcite', 'Marzhauser', 'NikonEclipse90i', 'Hydra', 'ASIStage', 'Sapphire', 'USBManager', 'Tofra', 'Pecon', 'Zaber', 'Corvus', 'PIGCS', 'K8061', 'MPBLaser').\n", + "\n", + "'''" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:46:33.930064Z", + "start_time": "2023-08-15T12:46:33.915618Z" + } + }, + "id": "521a0002b343b233" + }, + { + "cell_type": "code", + "execution_count": 14, + "outputs": [ + { + "data": { + "text/plain": "['LightSheetManager',\n 'ASITiger',\n 'LeicaDMR',\n 'XLightV3',\n 'HamiltonMVP',\n 'SutterLambda',\n 'LudlLow',\n 'LeicaDMI',\n 'CoolLEDpE4000',\n 'CoherentOBIS',\n 'XLight',\n 'ImageProcessorChain',\n 'SutterMPC',\n 'SerialManager',\n 'PIEZOCONCEPT',\n 'MicroPoint',\n 'CSUX',\n 'MaestroServo',\n 'CoherentCube',\n 'LaserQuantumLaser',\n 'CoolLEDpE300',\n 'ThorLabs',\n 'VariLC',\n 'Nikon',\n 'SequenceTester',\n 'SpectralLMM5',\n 'MicroFPGA',\n 'MoticUCam',\n 'MarzhauserLStep',\n 'IsmatecMCP',\n 'StarlightXpress',\n 'PI',\n 'XCiteXT600',\n 'NewportCONEX',\n 'SutterLambdaParallelArduino',\n 'PriorLegacy',\n 'BlueboxOptics_niji',\n 'XCite120PCExacte',\n 'ThorlabsElliptecSlider',\n 'ArduinoNeoPixel',\n 'ChuoSeikiMD5000',\n 'NikonAZ100',\n 'SmarActHCU3D',\n 'Piezosystem_NV40_1',\n 'Aquinas',\n 'ChuoSeikiQT',\n 'PIGCS2',\n 'OxxiusCombiner',\n 'OpenCVgrabber',\n 'MP285',\n 'TriggerScopeMM',\n 'Utilities.la',\n 'ThorLabsSC10',\n 'CARVII',\n 'KDV',\n 'Xcite',\n 'Cobolt',\n 'Arduino',\n 'pgFocus',\n 'FreeSerialPort',\n 'K8055',\n 'Stradus',\n 'Vincent',\n 'ASIWPTR',\n 'Piezosystem_NV120_1',\n 'GPhoto',\n 'ESImagingIOControllers',\n 'nPoint',\n 'Piezosystem_dDrive',\n 'DemoCamera',\n 'ThorlabsFilterWheel',\n 'NewportSMC',\n 'LumencorSpectra',\n 'FakeCamera',\n 'LeicaDMSTC',\n 'MarzhauserLStepOld',\n 'HIDManager',\n 'OVP_ECS2',\n 'Prior',\n 'YodnE600',\n 'Diskovery',\n 'NNLC',\n 'CSUW1',\n 'VarispecLCTF',\n 'Aladdin',\n 'TriggerScope',\n 'FocalPoint',\n 'SutterStage',\n 'ZeissCAN',\n 'CSU22',\n 'Thorlabs_ELL14',\n 'NikonTE2000',\n 'AAAOTF',\n 'SouthPort',\n 'ThorlabsDCxxxx',\n 'Toptica_iBeamSmartCW',\n 'Skyra',\n 'CoherentScientificRemote',\n 'VersaLase',\n 'Arduino32bitBoards',\n 'RAMPS',\n 'dc1394',\n 'Polychrome5000',\n 'ZeissCAN29',\n 'UserDefinedSerial',\n 'DemoCamera.la',\n 'Oxxius',\n 'ASIFW1000',\n 'Utilities',\n 'Scientifica',\n 'WieneckeSinske',\n 'Conix',\n 'Neos',\n 'SutterLambda2',\n 'Piezosystem_30DV50',\n 'Omicron',\n 'Olympus',\n 'XCiteLed',\n 'IIDC',\n 'Ludl',\n 'Piezosystem_NV40_3',\n 'PrecisExcite',\n 'Marzhauser',\n 'NikonEclipse90i',\n 'Hydra',\n 'ASIStage',\n 'Sapphire',\n 'USBManager',\n 'Tofra',\n 'Pecon',\n 'Zaber',\n 'Corvus',\n 'PIGCS',\n 'K8061',\n 'MPBLaser']" + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "device_list = list(('LightSheetManager', 'ASITiger', 'LeicaDMR', 'XLightV3', 'HamiltonMVP', 'SutterLambda', 'LudlLow', 'LeicaDMI', 'CoolLEDpE4000', 'CoherentOBIS', 'XLight', 'ImageProcessorChain', 'SutterMPC', 'SerialManager', 'PIEZOCONCEPT', 'MicroPoint', 'CSUX', 'MaestroServo', 'CoherentCube', 'LaserQuantumLaser', 'CoolLEDpE300', 'ThorLabs', 'VariLC', 'Nikon', 'SequenceTester', 'SpectralLMM5', 'MicroFPGA', 'MoticUCam', 'MarzhauserLStep', 'IsmatecMCP', 'StarlightXpress', 'PI', 'XCiteXT600', 'NewportCONEX', 'SutterLambdaParallelArduino', 'PriorLegacy', 'BlueboxOptics_niji', 'XCite120PCExacte', 'ThorlabsElliptecSlider', 'ArduinoNeoPixel', 'ChuoSeikiMD5000', 'NikonAZ100', 'SmarActHCU3D', 'Piezosystem_NV40_1', 'Aquinas', 'ChuoSeikiQT', 'PIGCS2', 'OxxiusCombiner', 'OpenCVgrabber', 'MP285', 'TriggerScopeMM', 'Utilities.la', 'ThorLabsSC10', 'CARVII', 'KDV', 'Xcite', 'Cobolt', 'Arduino', 'pgFocus', 'FreeSerialPort', 'K8055', 'Stradus', 'Vincent', 'ASIWPTR', 'Piezosystem_NV120_1', 'GPhoto', 'ESImagingIOControllers', 'nPoint', 'Piezosystem_dDrive', 'DemoCamera', 'ThorlabsFilterWheel', 'NewportSMC', 'LumencorSpectra', 'FakeCamera', 'LeicaDMSTC', 'MarzhauserLStepOld', 'HIDManager', 'OVP_ECS2', 'Prior', 'YodnE600', 'Diskovery', 'NNLC', 'CSUW1', 'VarispecLCTF', 'Aladdin', 'TriggerScope', 'FocalPoint', 'SutterStage', 'ZeissCAN', 'CSU22', 'Thorlabs_ELL14', 'NikonTE2000', 'AAAOTF', 'SouthPort', 'ThorlabsDCxxxx', 'Toptica_iBeamSmartCW', 'Skyra', 'CoherentScientificRemote', 'VersaLase', 'Arduino32bitBoards', 'RAMPS', 'dc1394', 'Polychrome5000', 'ZeissCAN29', 'UserDefinedSerial', 'DemoCamera.la', 'Oxxius', 'ASIFW1000', 'Utilities', 'Scientifica', 'WieneckeSinske', 'Conix', 'Neos', 'SutterLambda2', 'Piezosystem_30DV50', 'Omicron', 'Olympus', 'XCiteLed', 'IIDC', 'Ludl', 'Piezosystem_NV40_3', 'PrecisExcite', 'Marzhauser', 'NikonEclipse90i', 'Hydra', 'ASIStage', 'Sapphire', 'USBManager', 'Tofra', 'Pecon', 'Zaber', 'Corvus', 'PIGCS', 'K8061', 'MPBLaser'))\n", + "device_list" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:46:33.930777Z", + "start_time": "2023-08-15T12:46:33.921876Z" + } + }, + "id": "b9e3ed5c86f459a2" + }, + { + "cell_type": "code", + "execution_count": 15, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "total 105288\r\n", + "drwxr-xr-x@ 153 admin 4896 Aug 7 17:24 \u001B[1m\u001B[36m.\u001B[m\u001B[m\r\n", + "drwxrwxr-x 36 admin 1152 Aug 11 20:14 \u001B[1m\u001B[36m..\u001B[m\u001B[m\r\n", + "-rw-r--r--@ 1 admin 6148 Aug 4 20:23 .DS_Store\r\n", + "-rw-r--r-- 1 admin 462 Aug 4 08:11 IJ_Prefs.txt\r\n", + "-rw-r--r--@ 1 admin 0 Nov 15 2009 Icon?\r\n", + "drwxr-xr-x@ 3 admin 96 Aug 4 08:11 \u001B[1m\u001B[36mImageJ.app\u001B[m\u001B[m\r\n", + "-rw-r--r-- 1 admin 6258 Aug 4 20:01 MMConfig_demo.cfg\r\n", + "-rw-r--r--@ 1 admin 6258 Aug 4 20:01 MMConfig_demo2.cfg\r\n", + "drwxr-xr-x 2 admin 64 Aug 4 19:47 \u001B[1m\u001B[36m_Micro-Manager-2.0.1-20230803\u001B[m\u001B[m\r\n", + "-rwxr-xr-x@ 1 admin 1684216 Aug 4 08:11 \u001B[1m\u001B[32mlibMMCoreJ_wrap.jnilib\u001B[m\u001B[m\r\n", + "drwxr-xr-x 7 admin 224 Aug 4 08:11 \u001B[1m\u001B[36mlibgphoto2\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 218568 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_AAAOTF\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 288968 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_ASIFW1000\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 547952 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_ASIStage\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 1729496 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_ASITiger\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 189216 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_ASIWPTR\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 213976 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Aladdin\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 191264 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Aquinas\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 298472 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Arduino\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 300792 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Arduino32bitBoards\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 226232 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_ArduinoNeoPixel\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 244392 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_BlueboxOptics_niji\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 410240 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_CARVII\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 270640 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_CSU22\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 453936 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_CSUW1\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 274648 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_CSUX\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 267328 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_ChuoSeikiMD5000\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 251848 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_ChuoSeikiQT\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 246000 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Cobolt\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 217392 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_CoherentCube\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 197840 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_CoherentOBIS\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 237368 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_CoherentScientificRemote\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 287400 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Conix\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 199968 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_CoolLEDpE300\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 217720 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_CoolLEDpE4000\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 233376 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Corvus\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 696232 Aug 4 20:01 \u001B[1m\u001B[32mlibmmgr_dal_DemoCamera\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 1044 Aug 4 20:01 \u001B[1m\u001B[32mlibmmgr_dal_DemoCamera.la\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 438472 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Diskovery\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 304848 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_ESImagingIOControllers\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 2799392 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_FakeCamera\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 194720 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_FocalPoint\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 195872 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_FreeSerialPort\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 3088944 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_GPhoto\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 222984 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_HIDManager\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 231616 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_HamiltonMVP\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 222120 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Hydra\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 1390064 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_IIDC\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 191112 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_ImageProcessorChain\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 247432 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_IsmatecMCP\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 258496 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_K8055\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 273120 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_K8061\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 194280 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_KDV\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 249232 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_LaserQuantumLaser\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 733480 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_LeicaDMI\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 346024 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_LeicaDMR\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 226640 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_LeicaDMSTC\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 227984 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_LightSheetManager\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 335024 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Ludl\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 294584 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_LudlLow\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 195304 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_LumencorSpectra\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 328592 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_MP285\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 199320 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_MPBLaser\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 202496 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_MaestroServo\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 421704 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Marzhauser\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 264608 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_MarzhauserLStep\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 196752 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_MarzhauserLStepOld\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 305568 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_MicroFPGA\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 195296 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_MicroPoint\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 229664 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_MoticUCam\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 312104 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_NNLC\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 189664 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Neos\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 236136 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_NewportCONEX\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 213272 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_NewportSMC\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 260208 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Nikon\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 280568 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_NikonAZ100\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 424992 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_NikonEclipse90i\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 469400 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_NikonTE2000\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 219496 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_OVP_ECS2\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 387408 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Olympus\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 266144 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Omicron\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 4297736 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_OpenCVgrabber\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 213664 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Oxxius\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 293040 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_OxxiusCombiner\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 193968 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_PI\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 240256 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_PIEZOCONCEPT\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 194216 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_PIGCS\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 353904 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_PIGCS2\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 256472 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Pecon\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 317016 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Piezosystem_30DV50\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 219896 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Piezosystem_NV120_1\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 195368 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Piezosystem_NV40_1\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 285864 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Piezosystem_NV40_3\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 744528 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Piezosystem_dDrive\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 194336 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Polychrome5000\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 198128 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_PrecisExcite\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 380176 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Prior\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 223352 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_PriorLegacy\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 277648 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_RAMPS\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 215872 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Sapphire\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 224400 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Scientifica\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 1468184 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_SequenceTester\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 713856 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_SerialManager\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 262376 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Skyra\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 242200 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_SmarActHCU3D\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 197872 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_SouthPort\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 229920 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_SpectralLMM5\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 201520 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_StarlightXpress\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 228848 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Stradus\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 355424 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_SutterLambda\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 292552 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_SutterLambda2\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 215632 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_SutterLambdaParallelArduino\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 293720 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_SutterMPC\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 273808 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_SutterStage\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 301096 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_ThorLabs\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 188464 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_ThorLabsSC10\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 327616 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_ThorlabsDCxxxx\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 304136 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_ThorlabsElliptecSlider\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 196216 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_ThorlabsFilterWheel\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 212752 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Thorlabs_ELL14\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 388560 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Tofra\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 277768 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Toptica_iBeamSmartCW\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 324072 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_TriggerScope\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 280640 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_TriggerScopeMM\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 316600 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_USBManager\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 400616 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_UserDefinedSerial\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 686648 Aug 4 20:01 \u001B[1m\u001B[32mlibmmgr_dal_Utilities\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 1039 Aug 4 20:01 \u001B[1m\u001B[32mlibmmgr_dal_Utilities.la\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 213680 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_VariLC\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 195424 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_VarispecLCTF\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 217560 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_VersaLase\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 202968 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Vincent\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 285424 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_WieneckeSinske\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 273200 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_XCite120PCExacte\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 325816 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_XCiteLed\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 325432 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_XCiteXT600\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 333552 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_XLight\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 243024 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_XLightV3\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 194320 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Xcite\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 201592 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_YodnE600\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 375240 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_Zaber\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 622128 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_ZeissCAN\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 538288 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_ZeissCAN29\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 695512 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_dc1394\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 257440 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_nPoint\u001B[m\u001B[m\r\n", + "-rwxr-xr-x 1 admin 269736 Aug 4 08:11 \u001B[1m\u001B[32mlibmmgr_dal_pgFocus\u001B[m\u001B[m\r\n", + "drwxr-xr-x 29 admin 928 Aug 4 08:11 \u001B[1m\u001B[36mluts\u001B[m\u001B[m\r\n", + "drwxr-xr-x 4 admin 128 Aug 4 08:11 \u001B[1m\u001B[36mmacros\u001B[m\u001B[m\r\n", + "drwxr-xr-x 8 admin 256 Aug 4 19:47 \u001B[1m\u001B[36mmmautofocus\u001B[m\u001B[m\r\n", + "drwxr-xr-x 31 admin 992 Aug 4 08:11 \u001B[1m\u001B[36mmmplugins\u001B[m\u001B[m\r\n", + "drwxr-xr-x 3 admin 96 Aug 4 08:11 \u001B[1m\u001B[36mnatives\u001B[m\u001B[m\r\n", + "drwxr-xr-x 4 admin 128 Aug 4 08:11 \u001B[1m\u001B[36mplugins\u001B[m\u001B[m\r\n", + "drwxr-xr-x 22 admin 704 Aug 4 08:11 \u001B[1m\u001B[36mscripts\u001B[m\u001B[m\r\n" + ] + } + ], + "source": [ + "! ls -lga '{micromanager_path}' " + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:46:34.047554Z", + "start_time": "2023-08-15T12:46:33.924099Z" + } + }, + "id": "e5ff699a3f9d9d09" + }, + { + "cell_type": "code", + "execution_count": 30, + "outputs": [ + { + "data": { + "text/plain": "'/Applications/Micro-Managerlibmmgr_dal_ASIStage'" + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "asi_stage_adapter = micromanager_path + \"libmmgr_dal_ASIStage\"\n", + "# device.load('ASIStage')\n", + "core.getAdapterObject(asi_stage_adapter).name" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:53:25.426320Z", + "start_time": "2023-08-15T12:53:25.422664Z" + } + }, + "id": "131654326058a108" + }, + { + "cell_type": "code", + "execution_count": 31, + "outputs": [], + "source": [ + "device.load('DemoCamera', 'DCam')\n" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:53:45.831222Z", + "start_time": "2023-08-15T12:53:45.827719Z" + } + }, + "id": "b7d56d2ac5fa1e9c" + }, + { + "cell_type": "code", + "execution_count": 32, + "outputs": [], + "source": [ + "device.unload()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:53:46.729992Z", + "start_time": "2023-08-15T12:53:46.723149Z" + } + }, + "id": "44bdf47bec31f28e" + }, + { + "cell_type": "code", + "execution_count": 33, + "outputs": [], + "source": [ + "device.load('DemoCamera', 'DCam')\n" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:53:53.629407Z", + "start_time": "2023-08-15T12:53:53.623643Z" + } + }, + "id": "890186e3e95f9875" + }, + { + "cell_type": "code", + "execution_count": 34, + "outputs": [ + { + "data": { + "text/plain": "(,\n ,\n ,\n ,\n ,\n )" + }, + "execution_count": 34, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "device.properties" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:53:54.374559Z", + "start_time": "2023-08-15T12:53:54.371049Z" + } + }, + "id": "149caa3e057fe921" + }, + { + "cell_type": "markdown", + "source": [ + "Examples\n", + ">>> core = CMMCorePlus()\n", + ">>> device = Device('Camera', core)\n", + ">>> device.isLoaded()\n", + ">>> device.load('NotALib', 'DCam') # useful error\n", + ">>> device.load('DemoCamera', 'DCam')\n", + ">>> device.initialize()\n", + ">>> device.load('DemoCamera', 'DCam') # no-op w/ useful warning\n", + ">>> device.properties # tuple of DeviceProperty objects\n", + ">>> device.description()\n", + ">>> device.isBusy()\n", + ">>> device.wait()\n", + ">>> device.type()\n", + ">>> device.schema() # JSON schema of device properties\n", + "Params:\n", + "device_label – Device this property belongs to\n", + "mmcore – CMMCorePlus instance" + ], + "metadata": { + "collapsed": false + }, + "id": "45c415306e495eff" + }, + { + "cell_type": "code", + "execution_count": 35, + "outputs": [], + "source": [ + "camera_device = Device('Camera', core)" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:53:56.965664Z", + "start_time": "2023-08-15T12:53:56.961290Z" + } + }, + "id": "45ddd8148f41b907" + }, + { + "cell_type": "code", + "execution_count": 36, + "outputs": [ + { + "data": { + "text/plain": "True" + }, + "execution_count": 36, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_device.isLoaded()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:53:57.610465Z", + "start_time": "2023-08-15T12:53:57.604732Z" + } + }, + "id": "b931ba85a6681219" + }, + { + "cell_type": "code", + "execution_count": 37, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/opt/homebrew/Caskroom/mambaforge/base/envs/microscope-gym/lib/python3.11/site-packages/pymmcore_plus/core/_device.py:113: UserWarning: Failed to load device \"DCam\" from adapter module \"DemoCamera\". Device 'Camera' appears to be loaded already.\n", + " self._mmc.loadDevice(self.label, adapter_name, device_name)\n" + ] + } + ], + "source": [ + "camera_device.load('DemoCamera', 'DCam')" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:53:58.731064Z", + "start_time": "2023-08-15T12:53:58.727391Z" + } + }, + "id": "ecea844baae82596" + }, + { + "cell_type": "code", + "execution_count": 38, + "outputs": [ + { + "data": { + "text/plain": "True" + }, + "execution_count": 38, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_device.isLoaded()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:54:00.335271Z", + "start_time": "2023-08-15T12:54:00.328283Z" + } + }, + "id": "a7031d29791f6d67" + }, + { + "cell_type": "code", + "execution_count": 39, + "outputs": [], + "source": [ + "camera_device.initialize()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:54:02.629615Z", + "start_time": "2023-08-15T12:54:02.623157Z" + } + }, + "id": "10a69dc6e76b8afe" + }, + { + "cell_type": "code", + "execution_count": 40, + "outputs": [ + { + "data": { + "text/plain": "True" + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_device.isLoaded()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:54:03.498803Z", + "start_time": "2023-08-15T12:54:03.493965Z" + } + }, + "id": "c1d358eaf11f411b" + }, + { + "cell_type": "code", + "execution_count": 41, + "outputs": [ + { + "data": { + "text/plain": "False" + }, + "execution_count": 41, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_device.isBusy()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:54:06.756616Z", + "start_time": "2023-08-15T12:54:06.732815Z" + } + }, + "id": "699cb1d8426e7d47" + }, + { + "cell_type": "code", + "execution_count": 42, + "outputs": [ + { + "data": { + "text/plain": "(,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n )" + }, + "execution_count": 42, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_device.properties" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:54:07.743308Z", + "start_time": "2023-08-15T12:54:07.705873Z" + } + }, + "id": "86243e58047181e5" + }, + { + "cell_type": "code", + "execution_count": 43, + "outputs": [ + { + "data": { + "text/plain": "{'title': 'DCam',\n 'description': 'Demo camera',\n 'type': 'object',\n 'properties': {'AllowMultiROI': {'type': 'boolean'},\n 'AsyncPropertyDelayMS': {'type': 'integer'},\n 'AsyncPropertyFollower': {'type': 'string', 'readOnly': True, 'default': ''},\n 'AsyncPropertyLeader': {'type': 'string'},\n 'Binning': {'type': 'integer', 'enum': [1, 2, 4, 8]},\n 'BitDepth': {'type': 'integer', 'enum': [10, 11, 12, 14, 16, 32, 8]},\n 'CCDTemperature': {'type': 'number', 'minimum': -100.0, 'maximum': 10.0},\n 'CCDTemperature RO': {'type': 'number', 'readOnly': True, 'default': 0.0},\n 'CameraID': {'type': 'string', 'readOnly': True, 'default': 'V1.0'},\n 'CameraName': {'type': 'string',\n 'readOnly': True,\n 'default': 'DemoCamera-MultiMode'},\n 'Description': {'type': 'string',\n 'readOnly': True,\n 'default': 'Demo Camera Device Adapter'},\n 'DisplayImageNumber': {'type': 'boolean'},\n 'DropPixels': {'type': 'boolean'},\n 'Exposure': {'type': 'number', 'minimum': 0.0, 'maximum': 10000.0},\n 'FastImage': {'type': 'boolean'},\n 'FractionOfPixelsToDropOrSaturate': {'type': 'number',\n 'minimum': 0.0,\n 'maximum': 0.1},\n 'Gain': {'type': 'integer', 'minimum': -5.0, 'maximum': 8.0},\n 'HubID': {'type': 'string', 'readOnly': True, 'default': ''},\n 'MaximumExposureMs': {'type': 'number', 'preInit': True},\n 'Mode': {'type': 'string',\n 'enum': ['Artificial Waves', 'Color Test Pattern', 'Noise']},\n 'MultiROIFillValue': {'type': 'integer', 'minimum': 0.0, 'maximum': 65536.0},\n 'Name': {'type': 'string', 'readOnly': True, 'default': 'DCam'},\n 'Offset': {'type': 'integer'},\n 'OnCameraCCDXSize': {'type': 'integer'},\n 'OnCameraCCDYSize': {'type': 'integer'},\n 'Photon Conversion Factor': {'type': 'number',\n 'minimum': 0.01,\n 'maximum': 10.0},\n 'Photon Flux': {'type': 'number', 'minimum': 2.0, 'maximum': 5000.0},\n 'PixelType': {'type': 'string',\n 'enum': ['16bit', '32bit', '32bitRGB', '64bitRGB', '8bit']},\n 'ReadNoise (electrons)': {'type': 'number',\n 'minimum': 0.25,\n 'maximum': 50.0},\n 'ReadoutTime': {'type': 'number'},\n 'RotateImages': {'type': 'boolean'},\n 'SaturatePixels': {'type': 'boolean'},\n 'ScanMode': {'type': 'integer', 'enum': [1, 2, 3]},\n 'SimulateCrash': {'type': 'string',\n 'enum': ['', 'Dereference Null Pointer', 'Divide by Zero']},\n 'StripeWidth': {'type': 'number', 'minimum': 0.0, 'maximum': 10.0},\n 'TestProperty1': {'type': 'number', 'minimum': -0.1, 'maximum': 0.1},\n 'TestProperty2': {'type': 'number', 'minimum': -200.0, 'maximum': 200.0},\n 'TestProperty3': {'type': 'number', 'minimum': 0.0, 'maximum': 0.003},\n 'TestProperty4': {'type': 'number', 'minimum': -40000.0, 'maximum': 40000.0},\n 'TestProperty5': {'type': 'number'},\n 'TestProperty6': {'type': 'number', 'minimum': 0.0, 'maximum': 6000000.0},\n 'TransposeCorrection': {'type': 'boolean'},\n 'TransposeMirrorX': {'type': 'boolean'},\n 'TransposeMirrorY': {'type': 'boolean'},\n 'TransposeXY': {'type': 'boolean'},\n 'TriggerDevice': {'type': 'string'},\n 'UseExposureSequences': {'type': 'string', 'enum': ['No', 'Yes']}}}" + }, + "execution_count": 43, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_device.schema()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:54:09.366406Z", + "start_time": "2023-08-15T12:54:09.362451Z" + } + }, + "id": "f2ecca8d84b6c54d" + }, + { + "cell_type": "code", + "execution_count": 44, + "outputs": [ + { + "data": { + "text/plain": "'Demo camera'" + }, + "execution_count": 44, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_device.description()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:54:10.311529Z", + "start_time": "2023-08-15T12:54:10.305698Z" + } + }, + "id": "6045e0c3b4f1919e" + }, + { + "cell_type": "code", + "execution_count": 45, + "outputs": [ + { + "data": { + "text/plain": "{'valid': True,\n 'value': '',\n 'type': 'string',\n 'device_type': 'CameraDevice',\n 'read_only': False,\n 'sequenceable': False,\n 'sequence_max_length': None,\n 'pre_init': False,\n 'range': None,\n 'allowed_values': ()}" + }, + "execution_count": 45, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_device.getPropertyObject('TriggerDevice').dict()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:54:10.970196Z", + "start_time": "2023-08-15T12:54:10.965029Z" + } + }, + "id": "9cd0c3ad934ab9d2" + }, + { + "cell_type": "code", + "execution_count": 46, + "outputs": [ + { + "data": { + "text/plain": "{'valid': True,\n 'value': 'Artificial Waves',\n 'type': 'string',\n 'device_type': 'CameraDevice',\n 'read_only': False,\n 'sequenceable': False,\n 'sequence_max_length': None,\n 'pre_init': False,\n 'range': None,\n 'allowed_values': ('Artificial Waves', 'Color Test Pattern', 'Noise')}" + }, + "execution_count": 46, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_device.getPropertyObject('Mode').dict()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:54:12.282143Z", + "start_time": "2023-08-15T12:54:12.259020Z" + } + }, + "id": "31e4f673864666fa" + }, + { + "cell_type": "code", + "execution_count": 47, + "outputs": [ + { + "data": { + "text/plain": "{'valid': True,\n 'value': 0.0,\n 'type': 'number',\n 'device_type': 'CameraDevice',\n 'read_only': False,\n 'sequenceable': False,\n 'sequence_max_length': None,\n 'pre_init': False,\n 'range': (-0.1, 0.1),\n 'allowed_values': ()}" + }, + "execution_count": 47, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_device.getPropertyObject('TestProperty1').dict()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:54:13.105013Z", + "start_time": "2023-08-15T12:54:13.100812Z" + } + }, + "id": "4544054ba5ae3ddc" + }, + { + "cell_type": "code", + "execution_count": 48, + "outputs": [ + { + "data": { + "text/plain": "" + }, + "execution_count": 48, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_device.type()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:54:15.040978Z", + "start_time": "2023-08-15T12:54:15.036180Z" + } + }, + "id": "90acd36aa3d225cc" + }, + { + "cell_type": "code", + "execution_count": 49, + "outputs": [ + { + "data": { + "text/plain": "" + }, + "execution_count": 49, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_device.type().Camera" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:54:15.866641Z", + "start_time": "2023-08-15T12:54:15.863483Z" + } + }, + "id": "bd00c76e673bcb23" + }, + { + "cell_type": "code", + "execution_count": 50, + "outputs": [ + { + "data": { + "text/plain": "" + }, + "execution_count": 50, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_device.type().CameraDevice" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-15T12:54:16.972159Z", + "start_time": "2023-08-15T12:54:16.968209Z" + } + }, + "id": "ef70b4cd04cfbf46" + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "start_time": "2023-08-15T12:46:34.168173Z" + } + }, + "id": "74a0da3eb1a2a6ac" + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/microscope_gym/microscope_adapters/micromanager.py b/microscope_gym/microscope_adapters/micromanager.py index 5b96f2b..8dfd916 100644 --- a/microscope_gym/microscope_adapters/micromanager.py +++ b/microscope_gym/microscope_adapters/micromanager.py @@ -1,13 +1,22 @@ +import os.path from collections import OrderedDict from typing import List from pathlib import Path -from pycromanager import Core +# from pycromanager import Core +# [Jamie] I think this should be pymmcore_plus, not pycromanager +# pycromanager interfaces with the jova objects in the gui +# pymmcore(_plus) interface directly with the microscope devices +# defined by the configuration file +# the goal should be to translate a micromanager .cfg file into a microscope-gym adapter +# would it be better to just access micromanager directly from the smart module?? + +from pymmcore_plus import CMMCorePlus, Device, find_micromanager from microscope_gym import interface -from microscope_gym.interface import Objective, Microscope, Axis +from microscope_gym.interface import Objective, Microscope, Axis, Camera class Stage(interface.Stage): - def __init__(self, mm_core: Core) -> None: + def __init__(self, mm_core: CMMCorePlus) -> None: self.microscope_handler = mm_core self.axes = OrderedDict() self._get_axes_positions_from_microscope() @@ -51,7 +60,7 @@ def _update_axes_positions(self, axis_names: List[str], positions: List[float]): class Camera(interface.Camera): - def __init__(self, mm_core: Core, save_path: str = '') -> None: + def __init__(self, mm_core: CMMCorePlus, save_path: str = '', micromanager_path: str = '/Applications/Micro-Manager', config_file: str = 'MMConfig_demo.cfg' ) -> None: self.microscope_handler = mm_core if save_path == '': import tempfile @@ -59,7 +68,57 @@ def __init__(self, mm_core: Core, save_path: str = '') -> None: else: self.save_path = Path(save_path) self.save_path.mkdir(exist_ok=True, parents=True) + if find_micromanager() == '': + raise Exception('Micro-manager installation not found or environment variable not set.') + else: + self.micromanager_path = find_micromanager() + config_path = os.path.join(mm_dir, config_file) + if not Path(config_path): + raise Exception(f'Configuration file {config_file} not found in folder {micromanager_path}.') + else: + print(f'Loading configuration file {config_path}.') + self.microscope_handler.loadSystemConfiguration() def capture_image(self) -> "numpy.ndarray": - # Trigger the Snap funtion from MicroManager and get the data - pass # TODO Figure out how to get this from MMCore + + # mmc.snap can take a channel as a parameter (for multi-channel cameras) + + """ + Trigger the Snap function from MicroManager and get the data + + **from mmcore docs** + + Signature: `mmc.snap(numChannel: 'int | None' = None, *, fix: 'bool' = True) -> 'np.ndarray'` + + Source: + def snap(self, numChannel: int | None = None, *, fix: bool = True) -> np.ndarray: + + Snap and return an image. + + :sparkles: *This method is new in `CMMCorePlus`.* + + Convenience for calling `self.snapImage()` followed by returning the value + of `self.getImage()`. + + Parameters + ---------- + numChannel : int, optional + The camera channel to get the image from. If None, (the default), then + Multi-Channel cameras will return the content of the first channel. + fix : bool, default: True + If `True` (the default), then images with n_components > 1 (like RGB images) + will be reshaped to (w, h, n_components) using `fixImage`. + + Returns + ------- + img : np.ndarray + + Example from pymmcore-plus + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + self.snapImage() + img = self.getImage(numChannel, fix=fix) # type: ignore + self.events.imageSnapped.emit(img) + return img + + """ + return self.microscope_handler.snap() \ No newline at end of file From 24da1951af1d525f7a7a4ffeb0f59b666826e957 Mon Sep 17 00:00:00 2001 From: Jamie White <74255929+jqwhite@users.noreply.github.com> Date: Thu, 17 Aug 2023 14:06:15 +0200 Subject: [PATCH 07/16] Camera settings implemented --- docs/micromanager_testing.ipynb | 1272 ++++++++++++++--- .../microscope_adapters/micromanager.py | 35 +- 2 files changed, 1127 insertions(+), 180 deletions(-) diff --git a/docs/micromanager_testing.ipynb b/docs/micromanager_testing.ipynb index 78dcded..787c184 100644 --- a/docs/micromanager_testing.ipynb +++ b/docs/micromanager_testing.ipynb @@ -28,13 +28,13 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 37, "id": "initial_id", "metadata": { "collapsed": true, "ExecuteTime": { - "end_time": "2023-08-15T12:46:33.788056Z", - "start_time": "2023-08-15T12:46:33.565657Z" + "end_time": "2023-08-17T11:49:13.837707Z", + "start_time": "2023-08-17T11:49:13.488699Z" } }, "outputs": [], @@ -44,19 +44,37 @@ "\n", "# import numpy as np\n", "import pymmcore_plus\n", - "from pymmcore_plus import CMMCorePlus, Device\n", + "from pymmcore_plus import CMMCorePlus, Device, DeviceProperty, DeviceType\n", "from pymmcore_plus import find_micromanager" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 38, + "outputs": [], + "source": [ + "import json\n", + "def pretty(d):\n", + " print(json.dumps(d, indent=4))" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:49:14.023282Z", + "start_time": "2023-08-17T11:49:13.492272Z" + } + }, + "id": "9fad950cc2c5ebfa" + }, + { + "cell_type": "code", + "execution_count": 39, "outputs": [ { "data": { "text/plain": "'/Applications/Micro-Manager'" }, - "execution_count": 2, + "execution_count": 39, "metadata": {}, "output_type": "execute_result" } @@ -68,15 +86,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:46:33.803668Z", - "start_time": "2023-08-15T12:46:33.778931Z" + "end_time": "2023-08-17T11:49:14.023937Z", + "start_time": "2023-08-17T11:49:13.497269Z" } }, "id": "ecad81c4c22e42f6" }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 40, "outputs": [], "source": [ "# finding my way around a bit.\n", @@ -91,15 +109,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:46:33.827148Z", - "start_time": "2023-08-15T12:46:33.785893Z" + "end_time": "2023-08-17T11:49:14.072258Z", + "start_time": "2023-08-17T11:49:13.498508Z" } }, "id": "67b2bb34999df469" }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 41, "outputs": [], "source": [ "mmc.snapImage??" @@ -107,21 +125,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:46:33.864601Z", - "start_time": "2023-08-15T12:46:33.823058Z" + "end_time": "2023-08-17T11:49:14.073310Z", + "start_time": "2023-08-17T11:49:13.513972Z" } }, "id": "db5e8c91fd6ae8f1" }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 42, "outputs": [ { "data": { "text/plain": "numpy.ndarray" }, - "execution_count": 5, + "execution_count": 42, "metadata": {}, "output_type": "execute_result" } @@ -136,21 +154,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:46:33.904095Z", - "start_time": "2023-08-15T12:46:33.857685Z" + "end_time": "2023-08-17T11:49:14.073453Z", + "start_time": "2023-08-17T11:49:13.518129Z" } }, "id": "d900a080024977cd" }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 43, "outputs": [ { "data": { "text/plain": "array([[3276, 3339, 3402, ..., 3087, 3150, 3213],\n [3284, 3347, 3410, ..., 3095, 3158, 3221],\n [3292, 3355, 3418, ..., 3103, 3166, 3229],\n ...,\n [5846, 5846, 5844, ..., 5837, 5842, 5845],\n [5846, 5846, 5844, ..., 5838, 5842, 5845],\n [5846, 5846, 5843, ..., 5839, 5843, 5845]], dtype=uint16)" }, - "execution_count": 6, + "execution_count": 43, "metadata": {}, "output_type": "execute_result" } @@ -161,15 +179,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:46:33.904381Z", - "start_time": "2023-08-15T12:46:33.871589Z" + "end_time": "2023-08-17T11:49:14.073553Z", + "start_time": "2023-08-17T11:49:13.530877Z" } }, "id": "a857247e33a72859" }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 44, "outputs": [], "source": [ "mmc.snap??" @@ -177,21 +195,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:46:33.905860Z", - "start_time": "2023-08-15T12:46:33.875080Z" + "end_time": "2023-08-17T11:49:14.073910Z", + "start_time": "2023-08-17T11:49:13.532794Z" } }, "id": "5122b34bc0288bb3" }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 45, "outputs": [ { "data": { - "text/plain": "array([[5846, 5845, 5843, ..., 5839, 5843, 5845],\n [5846, 5845, 5843, ..., 5840, 5843, 5846],\n [5846, 5845, 5842, ..., 5840, 5844, 5846],\n ...,\n [3300, 3237, 3174, ..., 3489, 3426, 3363],\n [3292, 3229, 3166, ..., 3481, 3418, 3355],\n [3284, 3221, 3158, ..., 3473, 3410, 3347]], dtype=uint16)" + "text/plain": "array([[5093, 5138, 5180, ..., 4955, 5002, 5048],\n [5099, 5143, 5186, ..., 4961, 5008, 5054],\n [5105, 5148, 5191, ..., 4967, 5014, 5060],\n ...,\n [5110, 5065, 5020, ..., 5238, 5196, 5154],\n [5105, 5060, 5014, ..., 5232, 5191, 5148],\n [5099, 5054, 5008, ..., 5227, 5186, 5143]], dtype=uint16)" }, - "execution_count": 18, + "execution_count": 45, "metadata": {}, "output_type": "execute_result" } @@ -202,21 +220,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:46:52.762002Z", - "start_time": "2023-08-15T12:46:52.736119Z" + "end_time": "2023-08-17T11:49:14.086635Z", + "start_time": "2023-08-17T11:49:13.536726Z" } }, "id": "ec2bd2d092f73425" }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 46, "outputs": [ { "data": { "text/plain": "('Res10x', 'Res20x', 'Res40x')" }, - "execution_count": 23, + "execution_count": 46, "metadata": {}, "output_type": "execute_result" } @@ -227,21 +245,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:49:44.143958Z", - "start_time": "2023-08-15T12:49:44.114655Z" + "end_time": "2023-08-17T11:49:14.086837Z", + "start_time": "2023-08-17T11:49:13.549499Z" } }, "id": "a33bb7ac60b1b4c6" }, { "cell_type": "code", - "execution_count": 56, + "execution_count": 47, "outputs": [ { "data": { "text/plain": "dict_keys(['Camera', 'Dichroic', 'Emission', 'Excitation', 'Objective', 'Z', 'Path', 'XY', 'White Light Shutter', 'Autofocus', 'LED', 'LED Shutter', 'Core'])" }, - "execution_count": 56, + "execution_count": 47, "metadata": {}, "output_type": "execute_result" } @@ -252,29 +270,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:58:18.926994Z", - "start_time": "2023-08-15T12:58:18.912057Z" + "end_time": "2023-08-17T11:49:14.086929Z", + "start_time": "2023-08-17T11:49:13.551444Z" } }, "id": "516a7cc646a0750b" }, - { - "cell_type": "markdown", - "source": [], - "metadata": { - "collapsed": false - }, - "id": "aa00906361d95fa0" - }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 48, "outputs": [ { "data": { "text/plain": "'Camera'" }, - "execution_count": 59, + "execution_count": 48, "metadata": {}, "output_type": "execute_result" } @@ -285,15 +295,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T13:11:03.888331Z", - "start_time": "2023-08-15T13:11:03.850539Z" + "end_time": "2023-08-17T11:49:14.087004Z", + "start_time": "2023-08-17T11:49:13.554361Z" } }, - "id": "5c7fa138702e96ef" + "id": "bb46170fa723fb5e" }, { "cell_type": "code", - "execution_count": 60, + "execution_count": 49, "outputs": [], "source": [ "camera_name = mmc.getCameraDevice()" @@ -301,21 +311,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T13:11:15.158120Z", - "start_time": "2023-08-15T13:11:15.133511Z" + "end_time": "2023-08-17T11:49:14.087039Z", + "start_time": "2023-08-17T11:49:13.556382Z" } }, "id": "43a5a3f62fe4cb37" }, { "cell_type": "code", - "execution_count": 63, + "execution_count": 50, "outputs": [ { "data": { "text/plain": "('AllowMultiROI',\n 'AsyncPropertyDelayMS',\n 'AsyncPropertyFollower',\n 'AsyncPropertyLeader',\n 'Binning',\n 'BitDepth',\n 'CCDTemperature',\n 'CCDTemperature RO',\n 'CameraID',\n 'CameraName',\n 'Description',\n 'DisplayImageNumber',\n 'DropPixels',\n 'Exposure',\n 'FastImage',\n 'FractionOfPixelsToDropOrSaturate',\n 'Gain',\n 'HubID',\n 'MaximumExposureMs',\n 'Mode',\n 'MultiROIFillValue',\n 'Name',\n 'Offset',\n 'OnCameraCCDXSize',\n 'OnCameraCCDYSize',\n 'Photon Conversion Factor',\n 'Photon Flux',\n 'PixelType',\n 'ReadNoise (electrons)',\n 'ReadoutTime',\n 'RotateImages',\n 'SaturatePixels',\n 'ScanMode',\n 'SimulateCrash',\n 'StripeWidth',\n 'TestProperty1',\n 'TestProperty2',\n 'TestProperty3',\n 'TestProperty4',\n 'TestProperty5',\n 'TestProperty6',\n 'TransposeCorrection',\n 'TransposeMirrorX',\n 'TransposeMirrorY',\n 'TransposeXY',\n 'TriggerDevice',\n 'UseExposureSequences')" }, - "execution_count": 63, + "execution_count": 50, "metadata": {}, "output_type": "execute_result" } @@ -327,15 +337,40 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T13:12:54.281523Z", - "start_time": "2023-08-15T13:12:54.277338Z" + "end_time": "2023-08-17T11:49:14.087125Z", + "start_time": "2023-08-17T11:49:13.561088Z" } }, "id": "ba615747b5cf6fd" }, { "cell_type": "code", - "execution_count": 67, + "execution_count": 51, + "outputs": [ + { + "data": { + "text/plain": "'512'" + }, + "execution_count": 51, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mmc.getProperty(camera_name,'OnCameraCCDXSize')" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:49:14.087192Z", + "start_time": "2023-08-17T11:49:13.563380Z" + } + }, + "id": "4340d42a9dabdbb6" + }, + { + "cell_type": "code", + "execution_count": 52, "outputs": [ { "name": "stdout", @@ -398,70 +433,198 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T13:16:21.092061Z", - "start_time": "2023-08-15T13:16:21.088312Z" + "end_time": "2023-08-17T11:49:14.087271Z", + "start_time": "2023-08-17T11:49:13.565565Z" } }, "id": "565b340440042438" }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 53, + "outputs": [ + { + "data": { + "text/plain": "1.0" + }, + "execution_count": 53, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mmc.getPixelSizeUm()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:49:14.087367Z", + "start_time": "2023-08-17T11:49:13.567432Z" + } + }, + "id": "a993661bfe90bb28" + }, + { + "cell_type": "code", + "execution_count": 54, + "outputs": [], + "source": [ + "# mmc.getProperty(camera_name, \"Width\")" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:49:14.087400Z", + "start_time": "2023-08-17T11:49:13.569614Z" + } + }, + "id": "24452e3bde009055" + }, + { + "cell_type": "code", + "execution_count": 55, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "AllowMultiROI, \n", + "AsyncPropertyDelayMS, \n", + "AsyncPropertyFollower, \n", + "AsyncPropertyLeader, \n", + "Binning, \n", + "BitDepth, \n", + "CCDTemperature, \n", + "CCDTemperature RO, \n", + "CameraID, \n", + "CameraName, \n", + "Description, \n", + "DisplayImageNumber, \n", + "DropPixels, \n", + "Exposure, \n", + "FastImage, \n", + "FractionOfPixelsToDropOrSaturate, \n", + "Gain, \n", + "HubID, \n", + "MaximumExposureMs, \n", + "Mode, \n", + "MultiROIFillValue, \n", + "Name, \n", + "Offset, \n", + "OnCameraCCDXSize, \n", + "OnCameraCCDYSize, \n", + "Photon Conversion Factor, \n", + "Photon Flux, \n", + "PixelType, \n", + "ReadNoise (electrons), \n", + "ReadoutTime, \n", + "RotateImages, \n", + "SaturatePixels, \n", + "ScanMode, \n", + "SimulateCrash, \n", + "StripeWidth, \n", + "TestProperty1, \n", + "TestProperty2, \n", + "TestProperty3, \n", + "TestProperty4, \n", + "TestProperty5, \n", + "TestProperty6, \n", + "TransposeCorrection, \n", + "TransposeMirrorX, \n", + "TransposeMirrorY, \n", + "TransposeXY, \n", + "TriggerDevice, \n", + "UseExposureSequences, \n" + ] + } + ], + "source": [ + "for property in camera_properties:\n", + " print(f'{property}, ')" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:49:14.087474Z", + "start_time": "2023-08-17T11:49:13.571913Z" + } + }, + "id": "cb9a11166a6d3633" + }, + { + "cell_type": "code", + "execution_count": 56, + "outputs": [], + "source": [ + "camera_props = DeviceProperty" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:49:14.087511Z", + "start_time": "2023-08-17T11:49:13.573656Z" + } + }, + "id": "c2f078fb9bef433a" + }, + { + "cell_type": "code", + "execution_count": 57, "outputs": [], "source": [ "# core = pymmcore_plus.CMMCorePlus().instance()\n", - "core = CMMCorePlus()" + "# core = CMMCorePlus()" ], "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:46:33.929405Z", - "start_time": "2023-08-15T12:46:33.891879Z" + "end_time": "2023-08-17T11:49:14.087648Z", + "start_time": "2023-08-17T11:49:13.575591Z" } }, "id": "4574c4cbcfaf3d3" }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 58, "outputs": [], "source": [ - "core.loadSystemConfiguration()" + "mmc.loadSystemConfiguration()" ], "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:46:33.929770Z", - "start_time": "2023-08-15T12:46:33.906592Z" + "end_time": "2023-08-17T11:49:14.087724Z", + "start_time": "2023-08-17T11:49:13.577264Z" } }, "id": "ccbe1d7bbbeed9ad" }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 59, "outputs": [], "source": [ - "device = Device('Stage', core)" + "device = Device('Stage', mmc)" ], "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:46:33.929838Z", - "start_time": "2023-08-15T12:46:33.910878Z" + "end_time": "2023-08-17T11:49:14.087773Z", + "start_time": "2023-08-17T11:49:13.581042Z" } }, "id": "cf1b058d0c36dd7" }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 60, "outputs": [ { "data": { "text/plain": "False" }, - "execution_count": 12, + "execution_count": 60, "metadata": {}, "output_type": "execute_result" } @@ -472,21 +635,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:46:33.929947Z", - "start_time": "2023-08-15T12:46:33.912981Z" + "end_time": "2023-08-17T11:49:14.088109Z", + "start_time": "2023-08-17T11:49:13.583224Z" } }, "id": "210bfdaae941348f" }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 61, "outputs": [ { "data": { "text/plain": "'\\ndevice.load(\\'XY\\', \\'Stage\\')\\nRuntimeError: Failed to load device \"Stage\" from adapter module \"XY\". Adapter name \\'XY\\' not in list of known adapter names: (\\'LightSheetManager\\', \\'ASITiger\\', \\'LeicaDMR\\', \\'XLightV3\\', \\'HamiltonMVP\\', \\'SutterLambda\\', \\'LudlLow\\', \\'LeicaDMI\\', \\'CoolLEDpE4000\\', \\'CoherentOBIS\\', \\'XLight\\', \\'ImageProcessorChain\\', \\'SutterMPC\\', \\'SerialManager\\', \\'PIEZOCONCEPT\\', \\'MicroPoint\\', \\'CSUX\\', \\'MaestroServo\\', \\'CoherentCube\\', \\'LaserQuantumLaser\\', \\'CoolLEDpE300\\', \\'ThorLabs\\', \\'VariLC\\', \\'Nikon\\', \\'SequenceTester\\', \\'SpectralLMM5\\', \\'MicroFPGA\\', \\'MoticUCam\\', \\'MarzhauserLStep\\', \\'IsmatecMCP\\', \\'StarlightXpress\\', \\'PI\\', \\'XCiteXT600\\', \\'NewportCONEX\\', \\'SutterLambdaParallelArduino\\', \\'PriorLegacy\\', \\'BlueboxOptics_niji\\', \\'XCite120PCExacte\\', \\'ThorlabsElliptecSlider\\', \\'ArduinoNeoPixel\\', \\'ChuoSeikiMD5000\\', \\'NikonAZ100\\', \\'SmarActHCU3D\\', \\'Piezosystem_NV40_1\\', \\'Aquinas\\', \\'ChuoSeikiQT\\', \\'PIGCS2\\', \\'OxxiusCombiner\\', \\'OpenCVgrabber\\', \\'MP285\\', \\'TriggerScopeMM\\', \\'Utilities.la\\', \\'ThorLabsSC10\\', \\'CARVII\\', \\'KDV\\', \\'Xcite\\', \\'Cobolt\\', \\'Arduino\\', \\'pgFocus\\', \\'FreeSerialPort\\', \\'K8055\\', \\'Stradus\\', \\'Vincent\\', \\'ASIWPTR\\', \\'Piezosystem_NV120_1\\', \\'GPhoto\\', \\'ESImagingIOControllers\\', \\'nPoint\\', \\'Piezosystem_dDrive\\', \\'DemoCamera\\', \\'ThorlabsFilterWheel\\', \\'NewportSMC\\', \\'LumencorSpectra\\', \\'FakeCamera\\', \\'LeicaDMSTC\\', \\'MarzhauserLStepOld\\', \\'HIDManager\\', \\'OVP_ECS2\\', \\'Prior\\', \\'YodnE600\\', \\'Diskovery\\', \\'NNLC\\', \\'CSUW1\\', \\'VarispecLCTF\\', \\'Aladdin\\', \\'TriggerScope\\', \\'FocalPoint\\', \\'SutterStage\\', \\'ZeissCAN\\', \\'CSU22\\', \\'Thorlabs_ELL14\\', \\'NikonTE2000\\', \\'AAAOTF\\', \\'SouthPort\\', \\'ThorlabsDCxxxx\\', \\'Toptica_iBeamSmartCW\\', \\'Skyra\\', \\'CoherentScientificRemote\\', \\'VersaLase\\', \\'Arduino32bitBoards\\', \\'RAMPS\\', \\'dc1394\\', \\'Polychrome5000\\', \\'ZeissCAN29\\', \\'UserDefinedSerial\\', \\'DemoCamera.la\\', \\'Oxxius\\', \\'ASIFW1000\\', \\'Utilities\\', \\'Scientifica\\', \\'WieneckeSinske\\', \\'Conix\\', \\'Neos\\', \\'SutterLambda2\\', \\'Piezosystem_30DV50\\', \\'Omicron\\', \\'Olympus\\', \\'XCiteLed\\', \\'IIDC\\', \\'Ludl\\', \\'Piezosystem_NV40_3\\', \\'PrecisExcite\\', \\'Marzhauser\\', \\'NikonEclipse90i\\', \\'Hydra\\', \\'ASIStage\\', \\'Sapphire\\', \\'USBManager\\', \\'Tofra\\', \\'Pecon\\', \\'Zaber\\', \\'Corvus\\', \\'PIGCS\\', \\'K8061\\', \\'MPBLaser\\').\\n\\n'" }, - "execution_count": 13, + "execution_count": 61, "metadata": {}, "output_type": "execute_result" } @@ -501,21 +664,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:46:33.930064Z", - "start_time": "2023-08-15T12:46:33.915618Z" + "end_time": "2023-08-17T11:49:14.088233Z", + "start_time": "2023-08-17T11:49:13.585912Z" } }, "id": "521a0002b343b233" }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 62, "outputs": [ { "data": { "text/plain": "['LightSheetManager',\n 'ASITiger',\n 'LeicaDMR',\n 'XLightV3',\n 'HamiltonMVP',\n 'SutterLambda',\n 'LudlLow',\n 'LeicaDMI',\n 'CoolLEDpE4000',\n 'CoherentOBIS',\n 'XLight',\n 'ImageProcessorChain',\n 'SutterMPC',\n 'SerialManager',\n 'PIEZOCONCEPT',\n 'MicroPoint',\n 'CSUX',\n 'MaestroServo',\n 'CoherentCube',\n 'LaserQuantumLaser',\n 'CoolLEDpE300',\n 'ThorLabs',\n 'VariLC',\n 'Nikon',\n 'SequenceTester',\n 'SpectralLMM5',\n 'MicroFPGA',\n 'MoticUCam',\n 'MarzhauserLStep',\n 'IsmatecMCP',\n 'StarlightXpress',\n 'PI',\n 'XCiteXT600',\n 'NewportCONEX',\n 'SutterLambdaParallelArduino',\n 'PriorLegacy',\n 'BlueboxOptics_niji',\n 'XCite120PCExacte',\n 'ThorlabsElliptecSlider',\n 'ArduinoNeoPixel',\n 'ChuoSeikiMD5000',\n 'NikonAZ100',\n 'SmarActHCU3D',\n 'Piezosystem_NV40_1',\n 'Aquinas',\n 'ChuoSeikiQT',\n 'PIGCS2',\n 'OxxiusCombiner',\n 'OpenCVgrabber',\n 'MP285',\n 'TriggerScopeMM',\n 'Utilities.la',\n 'ThorLabsSC10',\n 'CARVII',\n 'KDV',\n 'Xcite',\n 'Cobolt',\n 'Arduino',\n 'pgFocus',\n 'FreeSerialPort',\n 'K8055',\n 'Stradus',\n 'Vincent',\n 'ASIWPTR',\n 'Piezosystem_NV120_1',\n 'GPhoto',\n 'ESImagingIOControllers',\n 'nPoint',\n 'Piezosystem_dDrive',\n 'DemoCamera',\n 'ThorlabsFilterWheel',\n 'NewportSMC',\n 'LumencorSpectra',\n 'FakeCamera',\n 'LeicaDMSTC',\n 'MarzhauserLStepOld',\n 'HIDManager',\n 'OVP_ECS2',\n 'Prior',\n 'YodnE600',\n 'Diskovery',\n 'NNLC',\n 'CSUW1',\n 'VarispecLCTF',\n 'Aladdin',\n 'TriggerScope',\n 'FocalPoint',\n 'SutterStage',\n 'ZeissCAN',\n 'CSU22',\n 'Thorlabs_ELL14',\n 'NikonTE2000',\n 'AAAOTF',\n 'SouthPort',\n 'ThorlabsDCxxxx',\n 'Toptica_iBeamSmartCW',\n 'Skyra',\n 'CoherentScientificRemote',\n 'VersaLase',\n 'Arduino32bitBoards',\n 'RAMPS',\n 'dc1394',\n 'Polychrome5000',\n 'ZeissCAN29',\n 'UserDefinedSerial',\n 'DemoCamera.la',\n 'Oxxius',\n 'ASIFW1000',\n 'Utilities',\n 'Scientifica',\n 'WieneckeSinske',\n 'Conix',\n 'Neos',\n 'SutterLambda2',\n 'Piezosystem_30DV50',\n 'Omicron',\n 'Olympus',\n 'XCiteLed',\n 'IIDC',\n 'Ludl',\n 'Piezosystem_NV40_3',\n 'PrecisExcite',\n 'Marzhauser',\n 'NikonEclipse90i',\n 'Hydra',\n 'ASIStage',\n 'Sapphire',\n 'USBManager',\n 'Tofra',\n 'Pecon',\n 'Zaber',\n 'Corvus',\n 'PIGCS',\n 'K8061',\n 'MPBLaser']" }, - "execution_count": 14, + "execution_count": 62, "metadata": {}, "output_type": "execute_result" } @@ -527,15 +690,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:46:33.930777Z", - "start_time": "2023-08-15T12:46:33.921876Z" + "end_time": "2023-08-17T11:49:14.088478Z", + "start_time": "2023-08-17T11:49:13.590376Z" } }, "id": "b9e3ed5c86f459a2" }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 63, "outputs": [ { "name": "stdout", @@ -543,7 +706,7 @@ "text": [ "total 105288\r\n", "drwxr-xr-x@ 153 admin 4896 Aug 7 17:24 \u001B[1m\u001B[36m.\u001B[m\u001B[m\r\n", - "drwxrwxr-x 36 admin 1152 Aug 11 20:14 \u001B[1m\u001B[36m..\u001B[m\u001B[m\r\n", + "drwxrwxr-x 36 admin 1152 Aug 16 11:29 \u001B[1m\u001B[36m..\u001B[m\u001B[m\r\n", "-rw-r--r--@ 1 admin 6148 Aug 4 20:23 .DS_Store\r\n", "-rw-r--r-- 1 admin 462 Aug 4 08:11 IJ_Prefs.txt\r\n", "-rw-r--r--@ 1 admin 0 Nov 15 2009 Icon?\r\n", @@ -704,21 +867,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:46:34.047554Z", - "start_time": "2023-08-15T12:46:33.924099Z" + "end_time": "2023-08-17T11:49:14.088609Z", + "start_time": "2023-08-17T11:49:13.592907Z" } }, "id": "e5ff699a3f9d9d09" }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 64, "outputs": [ { "data": { "text/plain": "'/Applications/Micro-Managerlibmmgr_dal_ASIStage'" }, - "execution_count": 30, + "execution_count": 64, "metadata": {}, "output_type": "execute_result" } @@ -726,20 +889,20 @@ "source": [ "asi_stage_adapter = micromanager_path + \"libmmgr_dal_ASIStage\"\n", "# device.load('ASIStage')\n", - "core.getAdapterObject(asi_stage_adapter).name" + "mmc.getAdapterObject(asi_stage_adapter).name" ], "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:53:25.426320Z", - "start_time": "2023-08-15T12:53:25.422664Z" + "end_time": "2023-08-17T11:49:14.088684Z", + "start_time": "2023-08-17T11:49:13.716190Z" } }, "id": "131654326058a108" }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 65, "outputs": [], "source": [ "device.load('DemoCamera', 'DCam')\n" @@ -747,15 +910,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:53:45.831222Z", - "start_time": "2023-08-15T12:53:45.827719Z" + "end_time": "2023-08-17T11:49:14.088721Z", + "start_time": "2023-08-17T11:49:13.718633Z" } }, "id": "b7d56d2ac5fa1e9c" }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 66, "outputs": [], "source": [ "device.unload()" @@ -763,15 +926,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:53:46.729992Z", - "start_time": "2023-08-15T12:53:46.723149Z" + "end_time": "2023-08-17T11:49:14.088759Z", + "start_time": "2023-08-17T11:49:13.720543Z" } }, "id": "44bdf47bec31f28e" }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 67, "outputs": [], "source": [ "device.load('DemoCamera', 'DCam')\n" @@ -779,21 +942,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:53:53.629407Z", - "start_time": "2023-08-15T12:53:53.623643Z" + "end_time": "2023-08-17T11:49:14.088799Z", + "start_time": "2023-08-17T11:49:13.722334Z" } }, "id": "890186e3e95f9875" }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 68, "outputs": [ { "data": { - "text/plain": "(,\n ,\n ,\n ,\n ,\n )" + "text/plain": "(,\n ,\n ,\n ,\n ,\n )" }, - "execution_count": 34, + "execution_count": 68, "metadata": {}, "output_type": "execute_result" } @@ -804,8 +967,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:53:54.374559Z", - "start_time": "2023-08-15T12:53:54.371049Z" + "end_time": "2023-08-17T11:49:14.088881Z", + "start_time": "2023-08-17T11:49:13.724505Z" } }, "id": "149caa3e057fe921" @@ -838,29 +1001,71 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 69, "outputs": [], "source": [ - "camera_device = Device('Camera', core)" + "camera_device = Device('Camera', mmc)" ], "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:53:56.965664Z", - "start_time": "2023-08-15T12:53:56.961290Z" + "end_time": "2023-08-17T11:49:14.088916Z", + "start_time": "2023-08-17T11:49:13.727173Z" } }, "id": "45ddd8148f41b907" }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 70, + "outputs": [ + { + "data": { + "text/plain": "(,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n )" + }, + "execution_count": 70, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_props = camera_device.properties\n", + "camera_props" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:49:14.089056Z", + "start_time": "2023-08-17T11:49:13.729023Z" + } + }, + "id": "3c14f3076b49b2f8" + }, + { + "cell_type": "code", + "execution_count": 71, + "outputs": [], + "source": [ + "# camera_props.hasLimits()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:49:14.089091Z", + "start_time": "2023-08-17T11:49:13.731700Z" + } + }, + "id": "f447c4a15741f10d" + }, + { + "cell_type": "code", + "execution_count": 72, "outputs": [ { "data": { "text/plain": "True" }, - "execution_count": 36, + "execution_count": 72, "metadata": {}, "output_type": "execute_result" } @@ -871,15 +1076,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:53:57.610465Z", - "start_time": "2023-08-15T12:53:57.604732Z" + "end_time": "2023-08-17T11:49:14.089166Z", + "start_time": "2023-08-17T11:49:13.733033Z" } }, "id": "b931ba85a6681219" }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 73, "outputs": [ { "name": "stderr", @@ -896,21 +1101,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:53:58.731064Z", - "start_time": "2023-08-15T12:53:58.727391Z" + "end_time": "2023-08-17T11:49:14.089236Z", + "start_time": "2023-08-17T11:49:13.735935Z" } }, "id": "ecea844baae82596" }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 106, "outputs": [ { "data": { "text/plain": "True" }, - "execution_count": 38, + "execution_count": 106, "metadata": {}, "output_type": "execute_result" } @@ -921,15 +1126,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:54:00.335271Z", - "start_time": "2023-08-15T12:54:00.328283Z" + "end_time": "2023-08-17T11:49:52.427596Z", + "start_time": "2023-08-17T11:49:52.413916Z" } }, "id": "a7031d29791f6d67" }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 75, "outputs": [], "source": [ "camera_device.initialize()" @@ -937,21 +1142,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:54:02.629615Z", - "start_time": "2023-08-15T12:54:02.623157Z" + "end_time": "2023-08-17T11:49:14.089336Z", + "start_time": "2023-08-17T11:49:13.740774Z" } }, "id": "10a69dc6e76b8afe" }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 76, "outputs": [ { "data": { "text/plain": "True" }, - "execution_count": 40, + "execution_count": 76, "metadata": {}, "output_type": "execute_result" } @@ -962,21 +1167,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:54:03.498803Z", - "start_time": "2023-08-15T12:54:03.493965Z" + "end_time": "2023-08-17T11:49:14.089405Z", + "start_time": "2023-08-17T11:49:13.742826Z" } }, "id": "c1d358eaf11f411b" }, { "cell_type": "code", - "execution_count": 41, + "execution_count": 77, "outputs": [ { "data": { "text/plain": "False" }, - "execution_count": 41, + "execution_count": 77, "metadata": {}, "output_type": "execute_result" } @@ -987,21 +1192,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:54:06.756616Z", - "start_time": "2023-08-15T12:54:06.732815Z" + "end_time": "2023-08-17T11:49:14.089476Z", + "start_time": "2023-08-17T11:49:13.749115Z" } }, "id": "699cb1d8426e7d47" }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 78, "outputs": [ { "data": { - "text/plain": "(,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n )" + "text/plain": "(,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n )" }, - "execution_count": 42, + "execution_count": 78, "metadata": {}, "output_type": "execute_result" } @@ -1012,21 +1217,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:54:07.743308Z", - "start_time": "2023-08-15T12:54:07.705873Z" + "end_time": "2023-08-17T11:49:14.089613Z", + "start_time": "2023-08-17T11:49:13.751353Z" } }, "id": "86243e58047181e5" }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 79, "outputs": [ { "data": { "text/plain": "{'title': 'DCam',\n 'description': 'Demo camera',\n 'type': 'object',\n 'properties': {'AllowMultiROI': {'type': 'boolean'},\n 'AsyncPropertyDelayMS': {'type': 'integer'},\n 'AsyncPropertyFollower': {'type': 'string', 'readOnly': True, 'default': ''},\n 'AsyncPropertyLeader': {'type': 'string'},\n 'Binning': {'type': 'integer', 'enum': [1, 2, 4, 8]},\n 'BitDepth': {'type': 'integer', 'enum': [10, 11, 12, 14, 16, 32, 8]},\n 'CCDTemperature': {'type': 'number', 'minimum': -100.0, 'maximum': 10.0},\n 'CCDTemperature RO': {'type': 'number', 'readOnly': True, 'default': 0.0},\n 'CameraID': {'type': 'string', 'readOnly': True, 'default': 'V1.0'},\n 'CameraName': {'type': 'string',\n 'readOnly': True,\n 'default': 'DemoCamera-MultiMode'},\n 'Description': {'type': 'string',\n 'readOnly': True,\n 'default': 'Demo Camera Device Adapter'},\n 'DisplayImageNumber': {'type': 'boolean'},\n 'DropPixels': {'type': 'boolean'},\n 'Exposure': {'type': 'number', 'minimum': 0.0, 'maximum': 10000.0},\n 'FastImage': {'type': 'boolean'},\n 'FractionOfPixelsToDropOrSaturate': {'type': 'number',\n 'minimum': 0.0,\n 'maximum': 0.1},\n 'Gain': {'type': 'integer', 'minimum': -5.0, 'maximum': 8.0},\n 'HubID': {'type': 'string', 'readOnly': True, 'default': ''},\n 'MaximumExposureMs': {'type': 'number', 'preInit': True},\n 'Mode': {'type': 'string',\n 'enum': ['Artificial Waves', 'Color Test Pattern', 'Noise']},\n 'MultiROIFillValue': {'type': 'integer', 'minimum': 0.0, 'maximum': 65536.0},\n 'Name': {'type': 'string', 'readOnly': True, 'default': 'DCam'},\n 'Offset': {'type': 'integer'},\n 'OnCameraCCDXSize': {'type': 'integer'},\n 'OnCameraCCDYSize': {'type': 'integer'},\n 'Photon Conversion Factor': {'type': 'number',\n 'minimum': 0.01,\n 'maximum': 10.0},\n 'Photon Flux': {'type': 'number', 'minimum': 2.0, 'maximum': 5000.0},\n 'PixelType': {'type': 'string',\n 'enum': ['16bit', '32bit', '32bitRGB', '64bitRGB', '8bit']},\n 'ReadNoise (electrons)': {'type': 'number',\n 'minimum': 0.25,\n 'maximum': 50.0},\n 'ReadoutTime': {'type': 'number'},\n 'RotateImages': {'type': 'boolean'},\n 'SaturatePixels': {'type': 'boolean'},\n 'ScanMode': {'type': 'integer', 'enum': [1, 2, 3]},\n 'SimulateCrash': {'type': 'string',\n 'enum': ['', 'Dereference Null Pointer', 'Divide by Zero']},\n 'StripeWidth': {'type': 'number', 'minimum': 0.0, 'maximum': 10.0},\n 'TestProperty1': {'type': 'number', 'minimum': -0.1, 'maximum': 0.1},\n 'TestProperty2': {'type': 'number', 'minimum': -200.0, 'maximum': 200.0},\n 'TestProperty3': {'type': 'number', 'minimum': 0.0, 'maximum': 0.003},\n 'TestProperty4': {'type': 'number', 'minimum': -40000.0, 'maximum': 40000.0},\n 'TestProperty5': {'type': 'number'},\n 'TestProperty6': {'type': 'number', 'minimum': 0.0, 'maximum': 6000000.0},\n 'TransposeCorrection': {'type': 'boolean'},\n 'TransposeMirrorX': {'type': 'boolean'},\n 'TransposeMirrorY': {'type': 'boolean'},\n 'TransposeXY': {'type': 'boolean'},\n 'TriggerDevice': {'type': 'string'},\n 'UseExposureSequences': {'type': 'string', 'enum': ['No', 'Yes']}}}" }, - "execution_count": 43, + "execution_count": 79, "metadata": {}, "output_type": "execute_result" } @@ -1037,21 +1242,97 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:54:09.366406Z", - "start_time": "2023-08-15T12:54:09.362451Z" + "end_time": "2023-08-17T11:49:14.089748Z", + "start_time": "2023-08-17T11:49:13.754237Z" } }, "id": "f2ecca8d84b6c54d" }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 80, + "outputs": [ + { + "data": { + "text/plain": "" + }, + "execution_count": 80, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "props = DeviceProperty('Camera', 'HubID', mmc)\n", + "props" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:49:14.089819Z", + "start_time": "2023-08-17T11:49:13.758497Z" + } + }, + "id": "22a53df9f31735c0" + }, + { + "cell_type": "code", + "execution_count": 81, + "outputs": [ + { + "data": { + "text/plain": "False" + }, + "execution_count": 81, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "props.hasLimits()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:49:14.089891Z", + "start_time": "2023-08-17T11:49:13.760852Z" + } + }, + "id": "25af53a41eea593" + }, + { + "cell_type": "code", + "execution_count": 82, + "outputs": [ + { + "data": { + "text/plain": ">" + }, + "execution_count": 82, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "props.range" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:49:14.089963Z", + "start_time": "2023-08-17T11:49:13.762942Z" + } + }, + "id": "70ad7c58d44dfe5a" + }, + { + "cell_type": "code", + "execution_count": 83, "outputs": [ { "data": { "text/plain": "'Demo camera'" }, - "execution_count": 44, + "execution_count": 83, "metadata": {}, "output_type": "execute_result" } @@ -1062,21 +1343,46 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:54:10.311529Z", - "start_time": "2023-08-15T12:54:10.305698Z" + "end_time": "2023-08-17T11:49:14.090033Z", + "start_time": "2023-08-17T11:49:13.765280Z" } }, "id": "6045e0c3b4f1919e" }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 84, + "outputs": [ + { + "data": { + "text/plain": "'Camera'" + }, + "execution_count": 84, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mmc.getCameraDevice()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:49:14.090103Z", + "start_time": "2023-08-17T11:49:13.767503Z" + } + }, + "id": "302ed27c95db1a0f" + }, + { + "cell_type": "code", + "execution_count": 85, "outputs": [ { "data": { "text/plain": "{'valid': True,\n 'value': '',\n 'type': 'string',\n 'device_type': 'CameraDevice',\n 'read_only': False,\n 'sequenceable': False,\n 'sequence_max_length': None,\n 'pre_init': False,\n 'range': None,\n 'allowed_values': ()}" }, - "execution_count": 45, + "execution_count": 85, "metadata": {}, "output_type": "execute_result" } @@ -1087,21 +1393,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:54:10.970196Z", - "start_time": "2023-08-15T12:54:10.965029Z" + "end_time": "2023-08-17T11:49:14.090177Z", + "start_time": "2023-08-17T11:49:13.769514Z" } }, "id": "9cd0c3ad934ab9d2" }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 86, "outputs": [ { "data": { "text/plain": "{'valid': True,\n 'value': 'Artificial Waves',\n 'type': 'string',\n 'device_type': 'CameraDevice',\n 'read_only': False,\n 'sequenceable': False,\n 'sequence_max_length': None,\n 'pre_init': False,\n 'range': None,\n 'allowed_values': ('Artificial Waves', 'Color Test Pattern', 'Noise')}" }, - "execution_count": 46, + "execution_count": 86, "metadata": {}, "output_type": "execute_result" } @@ -1112,21 +1418,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:54:12.282143Z", - "start_time": "2023-08-15T12:54:12.259020Z" + "end_time": "2023-08-17T11:49:14.090249Z", + "start_time": "2023-08-17T11:49:13.771994Z" } }, "id": "31e4f673864666fa" }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 87, "outputs": [ { "data": { "text/plain": "{'valid': True,\n 'value': 0.0,\n 'type': 'number',\n 'device_type': 'CameraDevice',\n 'read_only': False,\n 'sequenceable': False,\n 'sequence_max_length': None,\n 'pre_init': False,\n 'range': (-0.1, 0.1),\n 'allowed_values': ()}" }, - "execution_count": 47, + "execution_count": 87, "metadata": {}, "output_type": "execute_result" } @@ -1137,21 +1443,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:54:13.105013Z", - "start_time": "2023-08-15T12:54:13.100812Z" + "end_time": "2023-08-17T11:49:14.090330Z", + "start_time": "2023-08-17T11:49:13.774998Z" } }, "id": "4544054ba5ae3ddc" }, { "cell_type": "code", - "execution_count": 48, + "execution_count": 88, "outputs": [ { "data": { "text/plain": "" }, - "execution_count": 48, + "execution_count": 88, "metadata": {}, "output_type": "execute_result" } @@ -1162,21 +1468,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:54:15.040978Z", - "start_time": "2023-08-15T12:54:15.036180Z" + "end_time": "2023-08-17T11:49:14.090401Z", + "start_time": "2023-08-17T11:49:13.776153Z" } }, "id": "90acd36aa3d225cc" }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 89, "outputs": [ { "data": { "text/plain": "" }, - "execution_count": 49, + "execution_count": 89, "metadata": {}, "output_type": "execute_result" } @@ -1187,21 +1493,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:54:15.866641Z", - "start_time": "2023-08-15T12:54:15.863483Z" + "end_time": "2023-08-17T11:49:14.090467Z", + "start_time": "2023-08-17T11:49:13.778331Z" } }, "id": "bd00c76e673bcb23" }, { "cell_type": "code", - "execution_count": 50, + "execution_count": 90, "outputs": [ { "data": { "text/plain": "" }, - "execution_count": 50, + "execution_count": 90, "metadata": {}, "output_type": "execute_result" } @@ -1212,24 +1518,636 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-15T12:54:16.972159Z", - "start_time": "2023-08-15T12:54:16.968209Z" + "end_time": "2023-08-17T11:49:14.091066Z", + "start_time": "2023-08-17T11:49:13.780662Z" } }, "id": "ef70b4cd04cfbf46" }, { "cell_type": "code", - "execution_count": null, - "outputs": [], - "source": [], - "metadata": { - "collapsed": false, + "execution_count": 91, + "outputs": [ + { + "data": { + "text/plain": "{'AllowMultiROI': '0',\n 'AsyncPropertyDelayMS': '2000',\n 'AsyncPropertyFollower': '',\n 'AsyncPropertyLeader': '',\n 'Binning': '1',\n 'BitDepth': '16',\n 'CCDTemperature': '0.0000',\n 'CCDTemperature RO': '0.0000',\n 'CameraID': 'V1.0',\n 'CameraName': 'DemoCamera-MultiMode',\n 'Description': 'Demo Camera Device Adapter',\n 'DisplayImageNumber': '0',\n 'DropPixels': '0',\n 'Exposure': '10.0000',\n 'FastImage': '0',\n 'FractionOfPixelsToDropOrSaturate': '0.0020',\n 'Gain': '0',\n 'HubID': '',\n 'MaximumExposureMs': '10000.0000',\n 'Mode': 'Artificial Waves',\n 'MultiROIFillValue': '0',\n 'Name': 'DCam',\n 'Offset': '0',\n 'OnCameraCCDXSize': '512',\n 'OnCameraCCDYSize': '512',\n 'Photon Conversion Factor': '1.0000',\n 'Photon Flux': '50.0000',\n 'PixelType': '16bit',\n 'ReadNoise (electrons)': '2.5000',\n 'ReadoutTime': '0.0000',\n 'RotateImages': '0',\n 'SaturatePixels': '0',\n 'ScanMode': '1',\n 'SimulateCrash': '',\n 'StripeWidth': '1.0000',\n 'TestProperty1': '0.0000',\n 'TestProperty2': '0.0000',\n 'TestProperty3': '0.0000',\n 'TestProperty4': '0.0000',\n 'TestProperty5': '0.0000',\n 'TestProperty6': '0.0000',\n 'TransposeCorrection': '0',\n 'TransposeMirrorX': '0',\n 'TransposeMirrorY': '0',\n 'TransposeXY': '0',\n 'TriggerDevice': '',\n 'UseExposureSequences': 'No'}" + }, + "execution_count": 91, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mmc.getSystemState().dict()['Camera']" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:49:14.091184Z", + "start_time": "2023-08-17T11:49:13.782536Z" + } + }, + "id": "9c7893c1fd5b86af" + }, + { + "cell_type": "code", + "execution_count": 92, + "outputs": [ + { + "data": { + "text/plain": "" + }, + "execution_count": 92, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "DeviceProperty('Camera', camera_name, mmc)" + ], + "metadata": { + "collapsed": false, "ExecuteTime": { - "start_time": "2023-08-15T12:46:34.168173Z" + "end_time": "2023-08-17T11:49:14.091260Z", + "start_time": "2023-08-17T11:49:13.785733Z" } }, "id": "74a0da3eb1a2a6ac" + }, + { + "cell_type": "code", + "execution_count": 93, + "outputs": [ + { + "data": { + "text/plain": "('Camera', 'Stage')" + }, + "execution_count": 93, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mmc.getLoadedDevicesOfType(DeviceType.CameraDevice)" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:49:14.091347Z", + "start_time": "2023-08-17T11:49:13.787801Z" + } + }, + "id": "ea5b4c5d7afd1f68" + }, + { + "cell_type": "code", + "execution_count": 94, + "outputs": [], + "source": [ + "# DeviceProperty('Camera',)" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:49:14.091384Z", + "start_time": "2023-08-17T11:49:13.789664Z" + } + }, + "id": "7b0488e677f88af1" + }, + { + "cell_type": "code", + "execution_count": 95, + "outputs": [ + { + "data": { + "text/plain": "'Camera'" + }, + "execution_count": 95, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mmc.getCameraDevice()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:49:14.091463Z", + "start_time": "2023-08-17T11:49:13.791824Z" + } + }, + "id": "3bff169e5fe7e900" + }, + { + "cell_type": "code", + "execution_count": 96, + "outputs": [], + "source": [ + "camera_device = Device(mmc.getCameraDevice(), mmc)" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:49:14.091504Z", + "start_time": "2023-08-17T11:49:13.793658Z" + } + }, + "id": "55025f655d7db8ae" + }, + { + "cell_type": "code", + "execution_count": 97, + "outputs": [ + { + "data": { + "text/plain": "" + }, + "execution_count": 97, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_device" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:49:14.091585Z", + "start_time": "2023-08-17T11:49:13.795692Z" + } + }, + "id": "f71c54d23462bf" + }, + { + "cell_type": "code", + "execution_count": 98, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{\n", + " \"title\": \"DCam\",\n", + " \"description\": \"Demo camera\",\n", + " \"type\": \"object\",\n", + " \"properties\": {\n", + " \"AllowMultiROI\": {\n", + " \"type\": \"boolean\"\n", + " },\n", + " \"AsyncPropertyDelayMS\": {\n", + " \"type\": \"integer\"\n", + " },\n", + " \"AsyncPropertyFollower\": {\n", + " \"type\": \"string\",\n", + " \"readOnly\": true,\n", + " \"default\": \"\"\n", + " },\n", + " \"AsyncPropertyLeader\": {\n", + " \"type\": \"string\"\n", + " },\n", + " \"Binning\": {\n", + " \"type\": \"integer\",\n", + " \"enum\": [\n", + " 1,\n", + " 2,\n", + " 4,\n", + " 8\n", + " ]\n", + " },\n", + " \"BitDepth\": {\n", + " \"type\": \"integer\",\n", + " \"enum\": [\n", + " 10,\n", + " 11,\n", + " 12,\n", + " 14,\n", + " 16,\n", + " 32,\n", + " 8\n", + " ]\n", + " },\n", + " \"CCDTemperature\": {\n", + " \"type\": \"number\",\n", + " \"minimum\": -100.0,\n", + " \"maximum\": 10.0\n", + " },\n", + " \"CCDTemperature RO\": {\n", + " \"type\": \"number\",\n", + " \"readOnly\": true,\n", + " \"default\": 0.0\n", + " },\n", + " \"CameraID\": {\n", + " \"type\": \"string\",\n", + " \"readOnly\": true,\n", + " \"default\": \"V1.0\"\n", + " },\n", + " \"CameraName\": {\n", + " \"type\": \"string\",\n", + " \"readOnly\": true,\n", + " \"default\": \"DemoCamera-MultiMode\"\n", + " },\n", + " \"Description\": {\n", + " \"type\": \"string\",\n", + " \"readOnly\": true,\n", + " \"default\": \"Demo Camera Device Adapter\"\n", + " },\n", + " \"DisplayImageNumber\": {\n", + " \"type\": \"boolean\"\n", + " },\n", + " \"DropPixels\": {\n", + " \"type\": \"boolean\"\n", + " },\n", + " \"Exposure\": {\n", + " \"type\": \"number\",\n", + " \"minimum\": 0.0,\n", + " \"maximum\": 10000.0\n", + " },\n", + " \"FastImage\": {\n", + " \"type\": \"boolean\"\n", + " },\n", + " \"FractionOfPixelsToDropOrSaturate\": {\n", + " \"type\": \"number\",\n", + " \"minimum\": 0.0,\n", + " \"maximum\": 0.1\n", + " },\n", + " \"Gain\": {\n", + " \"type\": \"integer\",\n", + " \"minimum\": -5.0,\n", + " \"maximum\": 8.0\n", + " },\n", + " \"HubID\": {\n", + " \"type\": \"string\",\n", + " \"readOnly\": true,\n", + " \"default\": \"\"\n", + " },\n", + " \"MaximumExposureMs\": {\n", + " \"type\": \"number\",\n", + " \"preInit\": true\n", + " },\n", + " \"Mode\": {\n", + " \"type\": \"string\",\n", + " \"enum\": [\n", + " \"Artificial Waves\",\n", + " \"Color Test Pattern\",\n", + " \"Noise\"\n", + " ]\n", + " },\n", + " \"MultiROIFillValue\": {\n", + " \"type\": \"integer\",\n", + " \"minimum\": 0.0,\n", + " \"maximum\": 65536.0\n", + " },\n", + " \"Name\": {\n", + " \"type\": \"string\",\n", + " \"readOnly\": true,\n", + " \"default\": \"DCam\"\n", + " },\n", + " \"Offset\": {\n", + " \"type\": \"integer\"\n", + " },\n", + " \"OnCameraCCDXSize\": {\n", + " \"type\": \"integer\"\n", + " },\n", + " \"OnCameraCCDYSize\": {\n", + " \"type\": \"integer\"\n", + " },\n", + " \"Photon Conversion Factor\": {\n", + " \"type\": \"number\",\n", + " \"minimum\": 0.01,\n", + " \"maximum\": 10.0\n", + " },\n", + " \"Photon Flux\": {\n", + " \"type\": \"number\",\n", + " \"minimum\": 2.0,\n", + " \"maximum\": 5000.0\n", + " },\n", + " \"PixelType\": {\n", + " \"type\": \"string\",\n", + " \"enum\": [\n", + " \"16bit\",\n", + " \"32bit\",\n", + " \"32bitRGB\",\n", + " \"64bitRGB\",\n", + " \"8bit\"\n", + " ]\n", + " },\n", + " \"ReadNoise (electrons)\": {\n", + " \"type\": \"number\",\n", + " \"minimum\": 0.25,\n", + " \"maximum\": 50.0\n", + " },\n", + " \"ReadoutTime\": {\n", + " \"type\": \"number\"\n", + " },\n", + " \"RotateImages\": {\n", + " \"type\": \"boolean\"\n", + " },\n", + " \"SaturatePixels\": {\n", + " \"type\": \"boolean\"\n", + " },\n", + " \"ScanMode\": {\n", + " \"type\": \"integer\",\n", + " \"enum\": [\n", + " 1,\n", + " 2,\n", + " 3\n", + " ]\n", + " },\n", + " \"SimulateCrash\": {\n", + " \"type\": \"string\",\n", + " \"enum\": [\n", + " \"\",\n", + " \"Dereference Null Pointer\",\n", + " \"Divide by Zero\"\n", + " ]\n", + " },\n", + " \"StripeWidth\": {\n", + " \"type\": \"number\",\n", + " \"minimum\": 0.0,\n", + " \"maximum\": 10.0\n", + " },\n", + " \"TestProperty1\": {\n", + " \"type\": \"number\",\n", + " \"minimum\": -0.1,\n", + " \"maximum\": 0.1\n", + " },\n", + " \"TestProperty2\": {\n", + " \"type\": \"number\",\n", + " \"minimum\": -200.0,\n", + " \"maximum\": 200.0\n", + " },\n", + " \"TestProperty3\": {\n", + " \"type\": \"number\",\n", + " \"minimum\": 0.0,\n", + " \"maximum\": 0.003\n", + " },\n", + " \"TestProperty4\": {\n", + " \"type\": \"number\",\n", + " \"minimum\": -40000.0,\n", + " \"maximum\": 40000.0\n", + " },\n", + " \"TestProperty5\": {\n", + " \"type\": \"number\"\n", + " },\n", + " \"TestProperty6\": {\n", + " \"type\": \"number\",\n", + " \"minimum\": 0.0,\n", + " \"maximum\": 6000000.0\n", + " },\n", + " \"TransposeCorrection\": {\n", + " \"type\": \"boolean\"\n", + " },\n", + " \"TransposeMirrorX\": {\n", + " \"type\": \"boolean\"\n", + " },\n", + " \"TransposeMirrorY\": {\n", + " \"type\": \"boolean\"\n", + " },\n", + " \"TransposeXY\": {\n", + " \"type\": \"boolean\"\n", + " },\n", + " \"TriggerDevice\": {\n", + " \"type\": \"string\"\n", + " },\n", + " \"UseExposureSequences\": {\n", + " \"type\": \"string\",\n", + " \"enum\": [\n", + " \"No\",\n", + " \"Yes\"\n", + " ]\n", + " }\n", + " }\n", + "}\n" + ] + } + ], + "source": [ + "pretty(dict(camera_device.schema()))" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:49:14.091668Z", + "start_time": "2023-08-17T11:49:13.797823Z" + } + }, + "id": "fad00fea11de84bf" + }, + { + "cell_type": "code", + "execution_count": 99, + "outputs": [ + { + "data": { + "text/plain": "'Demo camera'" + }, + "execution_count": 99, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_device.description()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:49:14.091749Z", + "start_time": "2023-08-17T11:49:13.800591Z" + } + }, + "id": "2d11576aabbc54" + }, + { + "cell_type": "code", + "execution_count": 100, + "outputs": [ + { + "data": { + "text/plain": "(,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n )" + }, + "execution_count": 100, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_device.properties" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:49:14.091890Z", + "start_time": "2023-08-17T11:49:13.802779Z" + } + }, + "id": "faa97b1adfd964cd" + }, + { + "cell_type": "code", + "execution_count": 101, + "outputs": [ + { + "data": { + "text/plain": "512" + }, + "execution_count": 101, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_device.getPropertyObject('OnCameraCCDXSize').value" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:49:14.101370Z", + "start_time": "2023-08-17T11:49:13.805256Z" + } + }, + "id": "5ae872c3ee21197c" + }, + { + "cell_type": "code", + "execution_count": 102, + "outputs": [ + { + "data": { + "text/plain": "False" + }, + "execution_count": 102, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_device.getPropertyObject('OnCameraCCDXSize').hasLimits()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:49:14.101510Z", + "start_time": "2023-08-17T11:49:13.807880Z" + } + }, + "id": "5e0acd96a5a818b6" + }, + { + "cell_type": "code", + "execution_count": 103, + "outputs": [ + { + "data": { + "text/plain": "0.0" + }, + "execution_count": 103, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_device.getPropertyObject('OnCameraCCDXSize').upperLimit()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:49:14.101617Z", + "start_time": "2023-08-17T11:49:13.809792Z" + } + }, + "id": "52e45a974b1348d4" + }, + { + "cell_type": "code", + "execution_count": 104, + "outputs": [ + { + "data": { + "text/plain": "()" + }, + "execution_count": 104, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_device.getPropertyObject('OnCameraCCDXSize').allowedValues()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:49:14.101695Z", + "start_time": "2023-08-17T11:49:13.811828Z" + } + }, + "id": "58660a8306ebd959" + }, + { + "cell_type": "code", + "execution_count": 113, + "outputs": [ + { + "data": { + "text/plain": "()" + }, + "execution_count": 113, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_device.getPropertyObject('Gain').allowedValues()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:53:01.740449Z", + "start_time": "2023-08-17T11:53:01.733466Z" + } + }, + "id": "ad51eb7303a7df62" + }, + { + "cell_type": "code", + "execution_count": 114, + "outputs": [ + { + "data": { + "text/plain": "1.0" + }, + "execution_count": 114, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mmc.getPixelSizeUm()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T11:53:32.942446Z", + "start_time": "2023-08-17T11:53:32.928889Z" + } + }, + "id": "bb4191f3a438d45" + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "start_time": "2023-08-17T11:49:13.824390Z" + } + }, + "id": "dd61fe65bdac5d5a" } ], "metadata": { diff --git a/microscope_gym/microscope_adapters/micromanager.py b/microscope_gym/microscope_adapters/micromanager.py index 8dfd916..d8e473b 100644 --- a/microscope_gym/microscope_adapters/micromanager.py +++ b/microscope_gym/microscope_adapters/micromanager.py @@ -12,7 +12,7 @@ from pymmcore_plus import CMMCorePlus, Device, find_micromanager from microscope_gym import interface -from microscope_gym.interface import Objective, Microscope, Axis, Camera +from microscope_gym.interface import Objective, Microscope, Axis, Camera, CameraSettings class Stage(interface.Stage): @@ -58,7 +58,7 @@ def _update_axes_positions(self, axis_names: List[str], positions: List[float]): self.microscope_handler.set_xy_position(self.axes['x'].position_um, self.axes['y'].position_um) self.microscope_handler.set_position(self.axes['z'].position_um) - +# assume only one camera per microscope for now class Camera(interface.Camera): def __init__(self, mm_core: CMMCorePlus, save_path: str = '', micromanager_path: str = '/Applications/Micro-Manager', config_file: str = 'MMConfig_demo.cfg' ) -> None: self.microscope_handler = mm_core @@ -79,6 +79,31 @@ def __init__(self, mm_core: CMMCorePlus, save_path: str = '', micromanager_path: print(f'Loading configuration file {config_path}.') self.microscope_handler.loadSystemConfiguration() + self.camera_device = Device( + self.microscope_handler.getCameraDevice(), + self.microscope_handler + ) + self._settings = CameraSettings( + pixel_size_um=self.microscope_handler.getPixelSizeUm(), + width_pixels=self.camera_device.getPropertyObject( + 'OnCameraCCDXsize').value, + height_pixels=self.camera_device.getPropertyObject( + 'OnCameraCCDYsize').value, + exposure_time_ms=self.camera_device.getPropertyObject( + 'Exposure' ).value, + gain=self.camera_device.getPropertyObject( + 'Gain').value) + # assert self.settings.pixel_size_um !=0 and self.settings.pixel_size_um !=1, f"Pixel size is set to {pixel_size}; it is likely not set or calibrated." + # if pixel_size == 0: + # raise Error(f"Pixel size is set to {pixel_size}; it is likely not set or calibrated.") + # elif pixel_size == 1: + # raise Error(f"Pixel size is set to {pixel_size}; it is likely not set or calibrated.") + # else: + # print(f"Pixel size set to {pixel_size} um") + # return self.microscope_handler.getPixelSizeUm() + + self.settings(). + def capture_image(self) -> "numpy.ndarray": # mmc.snap can take a channel as a parameter (for multi-channel cameras) @@ -121,4 +146,8 @@ def snap(self, numChannel: int | None = None, *, fix: bool = True) -> np.ndarray return img """ - return self.microscope_handler.snap() \ No newline at end of file + return self.microscope_handler.snap() + + # use a logger -> make issue + + From 0ef8154d305382e7fafaa7d23eced82a4272a900 Mon Sep 17 00:00:00 2001 From: Jamie White <74255929+jqwhite@users.noreply.github.com> Date: Thu, 17 Aug 2023 16:46:02 +0200 Subject: [PATCH 08/16] first try at configure_camera function --- docs/micromanager_testing.ipynb | 248 ++++++++++++++++-- .../microscope_adapters/micromanager.py | 61 ++++- 2 files changed, 281 insertions(+), 28 deletions(-) diff --git a/docs/micromanager_testing.ipynb b/docs/micromanager_testing.ipynb index 787c184..b6c82e7 100644 --- a/docs/micromanager_testing.ipynb +++ b/docs/micromanager_testing.ipynb @@ -2088,66 +2088,280 @@ }, { "cell_type": "code", - "execution_count": 113, + "execution_count": 114, "outputs": [ { "data": { - "text/plain": "()" + "text/plain": "1.0" }, - "execution_count": 113, + "execution_count": 114, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "camera_device.getPropertyObject('Gain').allowedValues()" + "mmc.getPixelSizeUm()" ], "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:53:01.740449Z", - "start_time": "2023-08-17T11:53:01.733466Z" + "end_time": "2023-08-17T11:53:32.942446Z", + "start_time": "2023-08-17T11:53:32.928889Z" } }, - "id": "ad51eb7303a7df62" + "id": "bb4191f3a438d45" }, { "cell_type": "code", - "execution_count": 114, + "execution_count": 135, + "outputs": [], + "source": [ + "mmc.setProperty(\n", + " camera_name,\n", + " 'Gain',\n", + " 0\n", + ")" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T12:18:11.015697Z", + "start_time": "2023-08-17T12:18:11.002650Z" + } + }, + "id": "de3df31a8bbd37e8" + }, + { + "cell_type": "code", + "execution_count": 136, "outputs": [ { "data": { - "text/plain": "1.0" + "text/plain": "0" }, - "execution_count": 114, + "execution_count": 136, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "mmc.getPixelSizeUm()" + "camera_device.getPropertyObject('Gain').value" ], "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:53:32.942446Z", - "start_time": "2023-08-17T11:53:32.928889Z" + "end_time": "2023-08-17T12:18:11.673622Z", + "start_time": "2023-08-17T12:18:11.639727Z" } }, - "id": "bb4191f3a438d45" + "id": "ad51eb7303a7df62" }, { "cell_type": "code", - "execution_count": null, + "execution_count": 137, "outputs": [], - "source": [], + "source": [ + "mmc.setProperty(\n", + " camera_name,\n", + " 'Gain',\n", + " 4\n", + ")" + ], "metadata": { "collapsed": false, "ExecuteTime": { - "start_time": "2023-08-17T11:49:13.824390Z" + "end_time": "2023-08-17T12:18:12.250523Z", + "start_time": "2023-08-17T12:18:12.237831Z" } }, "id": "dd61fe65bdac5d5a" + }, + { + "cell_type": "code", + "execution_count": 138, + "outputs": [ + { + "data": { + "text/plain": "4" + }, + "execution_count": 138, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_device.getPropertyObject('Gain').value" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T12:18:12.936112Z", + "start_time": "2023-08-17T12:18:12.924398Z" + } + }, + "id": "36c00b27c00029eb" + }, + { + "cell_type": "code", + "execution_count": 117, + "outputs": [], + "source": [ + "mmc.setProperty(\n", + " camera_name,\n", + " 'Gain',\n", + " 4\n", + ")" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T12:14:59.825378Z", + "start_time": "2023-08-17T12:14:59.788909Z" + } + }, + "id": "5fb5c85b4d7f6cef" + }, + { + "cell_type": "code", + "execution_count": 151, + "outputs": [], + "source": [ + "mmc.setPixelSizeUm(resolutionID='Res10x', pixSize=2)" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T13:37:32.979081Z", + "start_time": "2023-08-17T13:37:32.896325Z" + } + }, + "id": "84287fed4c005b37" + }, + { + "cell_type": "code", + "execution_count": 143, + "outputs": [ + { + "data": { + "text/plain": "('Camera', 'Channel', 'Channel-Multiband', 'LightPath', 'Objective', 'System')" + }, + "execution_count": 143, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mmc.getAvailableConfigGroups()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T13:30:29.152145Z", + "start_time": "2023-08-17T13:30:29.073187Z" + } + }, + "id": "684e6960676667df" + }, + { + "cell_type": "code", + "execution_count": 150, + "outputs": [ + { + "data": { + "text/plain": "'Res10x'" + }, + "execution_count": 150, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mmc.getCurrentPixelSizeConfig()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T13:37:16.202450Z", + "start_time": "2023-08-17T13:37:16.167207Z" + } + }, + "id": "bda1f6bd0f9a1ad2" + }, + { + "cell_type": "code", + "execution_count": 153, + "outputs": [], + "source": [ + "mmc.setPixelSizeUm(resolutionID=mmc.getCurrentPixelSizeConfig(), pixSize=mmc.getPixelSizeUm())" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T13:49:56.418276Z", + "start_time": "2023-08-17T13:49:56.404561Z" + } + }, + "id": "42f86413ad2ded10" + }, + { + "cell_type": "code", + "execution_count": 154, + "outputs": [ + { + "data": { + "text/plain": "2.0" + }, + "execution_count": 154, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mmc.getPixelSizeUm()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T13:50:00.460011Z", + "start_time": "2023-08-17T13:50:00.420256Z" + } + }, + "id": "9b4fd804edc9583e" + }, + { + "cell_type": "code", + "execution_count": 159, + "outputs": [ + { + "data": { + "text/plain": "'Demo camera'" + }, + "execution_count": 159, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_device." + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-17T14:34:12.953390Z", + "start_time": "2023-08-17T14:34:12.937088Z" + } + }, + "id": "55f5f90aa35b07fe" + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [], + "metadata": { + "collapsed": false + }, + "id": "423f2869ab4006e4" } ], "metadata": { diff --git a/microscope_gym/microscope_adapters/micromanager.py b/microscope_gym/microscope_adapters/micromanager.py index d8e473b..7c64d42 100644 --- a/microscope_gym/microscope_adapters/micromanager.py +++ b/microscope_gym/microscope_adapters/micromanager.py @@ -2,6 +2,7 @@ from collections import OrderedDict from typing import List from pathlib import Path +from warnings import warn # from pycromanager import Core # [Jamie] I think this should be pymmcore_plus, not pycromanager # pycromanager interfaces with the jova objects in the gui @@ -60,7 +61,8 @@ def _update_axes_positions(self, axis_names: List[str], positions: List[float]): # assume only one camera per microscope for now class Camera(interface.Camera): - def __init__(self, mm_core: CMMCorePlus, save_path: str = '', micromanager_path: str = '/Applications/Micro-Manager', config_file: str = 'MMConfig_demo.cfg' ) -> None: + def __init__(self, mm_core: CMMCorePlus, save_path: str = '', micromanager_path: str = '/Applications/Micro-Manager', config_file: str = 'MMConfig_demo.cfg', + pixel_size_um=None) -> None: self.microscope_handler = mm_core if save_path == '': import tempfile @@ -92,17 +94,12 @@ def __init__(self, mm_core: CMMCorePlus, save_path: str = '', micromanager_path: exposure_time_ms=self.camera_device.getPropertyObject( 'Exposure' ).value, gain=self.camera_device.getPropertyObject( - 'Gain').value) + 'Gain').value + ) # assert self.settings.pixel_size_um !=0 and self.settings.pixel_size_um !=1, f"Pixel size is set to {pixel_size}; it is likely not set or calibrated." - # if pixel_size == 0: - # raise Error(f"Pixel size is set to {pixel_size}; it is likely not set or calibrated.") - # elif pixel_size == 1: - # raise Error(f"Pixel size is set to {pixel_size}; it is likely not set or calibrated.") - # else: - # print(f"Pixel size set to {pixel_size} um") - # return self.microscope_handler.getPixelSizeUm() + if (pixel_size_um == 0 | pixel_size_um == 1): + warn(f'Pixel size is set to {pixel_size_um}; it is may not set or calibrated.') - self.settings(). def capture_image(self) -> "numpy.ndarray": @@ -148,6 +145,48 @@ def snap(self, numChannel: int | None = None, *, fix: bool = True) -> np.ndarray """ return self.microscope_handler.snap() - # use a logger -> make issue + # todo: use a logger -> make issue + + def configure_camera(self, settings: CameraSettings) -> None: + ''' + Configure camera settings. + + from pymmcore-plus source code: + + @synchronized(_lock) + def setProperty(self, + label: str, + propName: str, + propValue: bool | float | int | str) -> None + ''' + + # Micromanager sets different pixel sizes for a configuration using a resolutionID + # set the current pixel size (they should all be set in the MM configuration file) + self.microscope_handler.setPixelSizeUm( + resolutionID=self.microscope_handler.getCurrentPixelSizeConfig(), + pixSize=settings.pixel_size_um + ), + # using luxendo code as a hint... + self.microscope_handler.setProperty( + self.camera_device, + 'OnCameraCCDXsize', + settings.width_pixels + ) + self.microscope_handler.setProperty( + self.camera_device, + 'OnCameraCCDYsize', + settings.height_pixels + ) + self.microscope_handler.setProperty( + self.camera_device, + 'Exposure', + settings.exposure_time_ms + ) + self.microscope_handler.setProperty( + self.camera_device, + 'Gain', + settings.gain + ) + return From c4634c62ac3be6e477d4038aab18bfb4d6164b45 Mon Sep 17 00:00:00 2001 From: Jamie White <74255929+jqwhite@users.noreply.github.com> Date: Fri, 18 Aug 2023 19:22:45 +0200 Subject: [PATCH 09/16] Determined that there is no general X min and Y min property embedded in MMCore device properties. XY min/max need to be empirically set. --- docs/micromanager_testing.ipynb | 348 +++++++++++++++++- .../microscope_adapters/micromanager.py | 7 +- 2 files changed, 351 insertions(+), 4 deletions(-) diff --git a/docs/micromanager_testing.ipynb b/docs/micromanager_testing.ipynb index b6c82e7..2cc4ef1 100644 --- a/docs/micromanager_testing.ipynb +++ b/docs/micromanager_testing.ipynb @@ -2353,6 +2353,97 @@ }, "id": "55f5f90aa35b07fe" }, + { + "cell_type": "code", + "execution_count": 160, + "outputs": [ + { + "data": { + "text/plain": "'/Applications/Micro-Managerlibmmgr_dal_ASIStage'" + }, + "execution_count": 160, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "asi_stage_adapter" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-18T16:40:59.195971Z", + "start_time": "2023-08-18T16:40:59.151153Z" + } + }, + "id": "423f2869ab4006e4" + }, + { + "cell_type": "code", + "execution_count": 170, + "outputs": [], + "source": [ + "stage_device = Device(mmc.getXYStageDevice(), mmc)" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-18T16:53:43.163642Z", + "start_time": "2023-08-18T16:53:43.147572Z" + } + }, + "id": "a9ed7469c07a4067" + }, + { + "cell_type": "code", + "execution_count": 192, + "outputs": [ + { + "data": { + "text/plain": "(,\n ,\n ,\n ,\n )" + }, + "execution_count": 192, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "stage_device.properties" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-18T17:21:46.493548Z", + "start_time": "2023-08-18T17:21:46.442919Z" + } + }, + "id": "a9802baaf9783234" + }, + { + "cell_type": "code", + "execution_count": 193, + "outputs": [ + { + "data": { + "text/plain": "'DXYStage'" + }, + "execution_count": 193, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "stage_device.name()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-18T17:21:54.581199Z", + "start_time": "2023-08-18T17:21:54.563206Z" + } + }, + "id": "5ac5e9941efc81b9" + }, { "cell_type": "code", "execution_count": null, @@ -2361,7 +2452,262 @@ "metadata": { "collapsed": false }, - "id": "423f2869ab4006e4" + "id": "8eb54bb7594b2701" + }, + { + "cell_type": "code", + "execution_count": 172, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{\n", + " \"title\": \"DXYStage\",\n", + " \"description\": \"Demo XY stage\",\n", + " \"type\": \"object\",\n", + " \"properties\": {\n", + " \"Description\": {\n", + " \"type\": \"string\",\n", + " \"readOnly\": true,\n", + " \"default\": \"Demo XY stage driver\"\n", + " },\n", + " \"HubID\": {\n", + " \"type\": \"string\",\n", + " \"readOnly\": true,\n", + " \"default\": \"\"\n", + " },\n", + " \"Name\": {\n", + " \"type\": \"string\",\n", + " \"readOnly\": true,\n", + " \"default\": \"DXYStage\"\n", + " },\n", + " \"TransposeMirrorX\": {\n", + " \"type\": \"boolean\"\n", + " },\n", + " \"TransposeMirrorY\": {\n", + " \"type\": \"boolean\"\n", + " }\n", + " }\n", + "}\n" + ] + } + ], + "source": [ + "pretty(stage_device.schema())" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-18T16:53:45.135284Z", + "start_time": "2023-08-18T16:53:45.123114Z" + } + }, + "id": "f1311bca201d635b" + }, + { + "cell_type": "code", + "execution_count": 173, + "outputs": [ + { + "data": { + "text/plain": "0.0" + }, + "execution_count": 173, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mmc.getZPosition()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-18T16:54:30.568407Z", + "start_time": "2023-08-18T16:54:30.533323Z" + } + }, + "id": "57aa776adf116a70" + }, + { + "cell_type": "code", + "execution_count": 174, + "outputs": [], + "source": [ + "mmc.setZPosition(2)" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-18T16:54:42.323154Z", + "start_time": "2023-08-18T16:54:42.270412Z" + } + }, + "id": "b46e4cd75ca62035" + }, + { + "cell_type": "code", + "execution_count": 175, + "outputs": [ + { + "data": { + "text/plain": "2.0" + }, + "execution_count": 175, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mmc.getZPosition()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-18T16:54:48.003358Z", + "start_time": "2023-08-18T16:54:47.951151Z" + } + }, + "id": "63e00ac6afbe07bf" + }, + { + "cell_type": "code", + "execution_count": 189, + "outputs": [ + { + "data": { + "text/plain": "('HubID',\n 'MaximumExposureMs',\n 'TransposeCorrection',\n 'TransposeMirrorX',\n 'TransposeMirrorY',\n 'TransposeXY')" + }, + "execution_count": 189, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mmc.getDevicePropertyNames(\"Stage\")" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-18T17:02:48.345007Z", + "start_time": "2023-08-18T17:02:48.319548Z" + } + }, + "id": "c685f737fa355047" + }, + { + "cell_type": "code", + "execution_count": 184, + "outputs": [ + { + "data": { + "text/plain": "" + }, + "execution_count": 184, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mmc.getPropertyObject(\"XY\",'Description')" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-18T17:01:24.880120Z", + "start_time": "2023-08-18T17:01:24.834185Z" + } + }, + "id": "cbb2822500cd7007" + }, + { + "cell_type": "code", + "execution_count": 191, + "outputs": [ + { + "data": { + "text/plain": "0.0" + }, + "execution_count": 191, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mmc.getPropertyUpperLimit('Stage','MaximumExposureMs')" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-18T17:04:02.619581Z", + "start_time": "2023-08-18T17:04:02.594320Z" + } + }, + "id": "8af142d0f73e55c2" + }, + { + "cell_type": "code", + "execution_count": 186, + "outputs": [ + { + "data": { + "text/plain": "('DHub',\n 'Camera',\n 'Dichroic',\n 'Emission',\n 'Excitation',\n 'Objective',\n 'Z',\n 'Path',\n 'XY',\n 'White Light Shutter',\n 'Autofocus',\n 'LED',\n 'LED Shutter',\n 'Stage',\n 'Core')" + }, + "execution_count": 186, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mmc.getLoadedDevices()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-18T17:01:41.845048Z", + "start_time": "2023-08-18T17:01:41.826559Z" + } + }, + "id": "cc21ccd465163eda" + }, + { + "cell_type": "code", + "execution_count": 188, + "outputs": [ + { + "ename": "RuntimeError", + "evalue": "Error in device \"Stage\": Invalid property name encountered: Position (2)", + "output_type": "error", + "traceback": [ + "\u001B[0;31m---------------------------------------------------------------------------\u001B[0m", + "\u001B[0;31mRuntimeError\u001B[0m Traceback (most recent call last)", + "Cell \u001B[0;32mIn[188], line 1\u001B[0m\n\u001B[0;32m----> 1\u001B[0m \u001B[43mmmc\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mgetPropertyLowerLimit\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;124;43m'\u001B[39;49m\u001B[38;5;124;43mStage\u001B[39;49m\u001B[38;5;124;43m'\u001B[39;49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;124;43m\"\u001B[39;49m\u001B[38;5;124;43mPosition\u001B[39;49m\u001B[38;5;124;43m\"\u001B[39;49m\u001B[43m)\u001B[49m\n", + "\u001B[0;31mRuntimeError\u001B[0m: Error in device \"Stage\": Invalid property name encountered: Position (2)" + ] + } + ], + "source": [ + "mmc.getPropertyLowerLimit('Stage',)" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-08-18T17:02:34.358611Z", + "start_time": "2023-08-18T17:02:34.338823Z" + } + }, + "id": "a7442dc420009ca3" + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [], + "metadata": { + "collapsed": false + }, + "id": "c86520952438b92b" } ], "metadata": { diff --git a/microscope_gym/microscope_adapters/micromanager.py b/microscope_gym/microscope_adapters/micromanager.py index 7c64d42..2a12ae6 100644 --- a/microscope_gym/microscope_adapters/micromanager.py +++ b/microscope_gym/microscope_adapters/micromanager.py @@ -23,16 +23,17 @@ def __init__(self, mm_core: CMMCorePlus) -> None: self._get_axes_positions_from_microscope() def _get_axes_positions_from_microscope(self): + # Todo: limits. There is no general way to get the X and Y limits for a particular stage from mmcore. self.axes["z"] = Axis(name='z', - position_um=self.microscope_handler.get_position(), + position_um=self.microscope_handler.getZPosition(), min=-10, # TODO Figure out how to get this from MMCore max=10) # TODO Figure out how to get this from MMCore self.axes["y"] = Axis(name='y', - position_um=self.microscope_handler.get_y_position(), + position_um=self.microscope_handler.getYPosition(), min=-10, # TODO Figure out how to get this from MMCore max=10) # TODO Figure out how to get this from MMCore self.axes["x"] = Axis(name='x', - position_um=self.microscope_handler.get_x_position(), + position_um=self.microscope_handler.getXPosition(), min=-10, # TODO Figure out how to get this from MMCore max=10) # TODO Figure out how to get this from MMCore From 49e07610bf93ae39e33f51d15e327a2ca37be74b Mon Sep 17 00:00:00 2001 From: Jamie White <74255929+jqwhite@users.noreply.github.com> Date: Fri, 15 Sep 2023 11:56:39 +0200 Subject: [PATCH 10/16] Added developer documentation. Working on micromanager adapter with Till and Hamdaan. --- docs/developer_documentation.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 docs/developer_documentation.md diff --git a/docs/developer_documentation.md b/docs/developer_documentation.md new file mode 100644 index 0000000..69c66dd --- /dev/null +++ b/docs/developer_documentation.md @@ -0,0 +1,33 @@ +# how might this work? + +``` +from microscopegym.micromanager import .... ? +``` + +long term: installable packages + +`pip install microscope-gym-micromanager` + +## 1st approach + +```python +from microscope_gym_micromanager import microscope_factory +required_components = ['camera', 'stage', 'laser_cutter', 'objectives', 'lasers', 'filters'] +my_microscope = microscope_factory(required_components) + +``` +*then* factory initializes components as below in 2nd approach and returns a Microscope object +components are attributes of microscope object +or...??? + +## 2nd approach: + +```python +from microscope_gym.interface import Objective, Microscope, Axis, Camera, CameraSettings, Stage, microscope_handler_factory +my_handler = microscope_handler_factory() +my_objective = Objective(my_handler) +my_stage = Stage(my_handler) +my...etc +``` +if 2nd option, how we initialize the components (Objective, Stage, Camera, etc) becomes part of api init fxn signature becomes part of api +if 1st (microscope factory creates microscope object) then only the microscope is part of public interfacee (and some public methods of components -- objectve, stage, etc). From 1362c787dc620f02dd477d03a9e9adc7eb7c2357 Mon Sep 17 00:00:00 2001 From: Jamie White <74255929+jqwhite@users.noreply.github.com> Date: Fri, 15 Sep 2023 13:13:39 +0200 Subject: [PATCH 11/16] Added explicit type limitations to Axis Class. Co-coding with Till. --- microscope_gym/microscope_adapters/mock_scope.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/microscope_gym/microscope_adapters/mock_scope.py b/microscope_gym/microscope_adapters/mock_scope.py index 1933b72..f6f0b78 100644 --- a/microscope_gym/microscope_adapters/mock_scope.py +++ b/microscope_gym/microscope_adapters/mock_scope.py @@ -7,8 +7,8 @@ class Axis(interface.stage.Axis): - last_move_time = -1.0 - move_timeout = 0.001 + last_move_time:float = -1.0 + move_timeout:float = 0.001 class Stage(interface.Stage): From 3967ffc283f2e95f19847d9418bbcf01b71bc203 Mon Sep 17 00:00:00 2001 From: Jamie White <74255929+jqwhite@users.noreply.github.com> Date: Fri, 15 Sep 2023 14:39:27 +0200 Subject: [PATCH 12/16] Camera bass class done. Co-coding with Till. Also inlcudes a camera test notebook. --- docs/developer_documentation.md | 1 + docs/micromanager_camera.ipynb | 544 +++++++++++++++ docs/micromanager_testing.ipynb | 627 +++++++++--------- .../microscope_adapters/micromanager.py | 93 +-- 4 files changed, 911 insertions(+), 354 deletions(-) create mode 100644 docs/micromanager_camera.ipynb diff --git a/docs/developer_documentation.md b/docs/developer_documentation.md index 69c66dd..2c006a6 100644 --- a/docs/developer_documentation.md +++ b/docs/developer_documentation.md @@ -31,3 +31,4 @@ my...etc ``` if 2nd option, how we initialize the components (Objective, Stage, Camera, etc) becomes part of api init fxn signature becomes part of api if 1st (microscope factory creates microscope object) then only the microscope is part of public interfacee (and some public methods of components -- objectve, stage, etc). + \ No newline at end of file diff --git a/docs/micromanager_camera.ipynb b/docs/micromanager_camera.ipynb new file mode 100644 index 0000000..2d4feb6 --- /dev/null +++ b/docs/micromanager_camera.ipynb @@ -0,0 +1,544 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "source": [ + "# Micromanager Camera\n", + "\n", + "Notebook for developing a microscope-gym micromanager Camera class.\n", + "\n", + "Base class stores settings: \n", + "\n", + "```python\n", + " pixel_size_um: float = Field(..., ge=0.0, description=\"physical pixel size of camera chip in µm\")\n", + " width_pixels: int = Field(..., ge=0, description=\"width of camera chip in pixels\")\n", + " height_pixels: int = Field(..., ge=0, description=\"height of camera chip in pixels\")\n", + " exposure_time_ms: float = Field(100.0, ge=0.0)\n", + " gain: float = Field(0.0, ge=0.0, description=\"amplifier gain\")\n", + "```" + ], + "metadata": { + "collapsed": false + }, + "id": "94ddcc96f498bb36" + }, + { + "cell_type": "code", + "execution_count": 1, + "outputs": [], + "source": [ + "from microscope_gym.microscope_adapters.micromanager import Camera, CameraSettings\n", + "\n", + "from pymmcore_plus import CMMCorePlus, Device, find_micromanager\n", + "\n", + "from pathlib import Path\n", + "\n", + "import stackview\n", + "import skimage" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-09-15T12:04:05.428186Z", + "start_time": "2023-09-15T12:04:04.848601Z" + } + }, + "id": "1c7518933f1c0522" + }, + { + "cell_type": "code", + "execution_count": 2, + "outputs": [ + { + "data": { + "text/plain": "PosixPath('/Applications/Micro-Manager')" + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "micromanager_path = Path(find_micromanager())\n", + "micromanager_path" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-09-15T12:04:05.434635Z", + "start_time": "2023-09-15T12:04:05.428479Z" + } + }, + "id": "fd2655dae8242600" + }, + { + "cell_type": "code", + "execution_count": 3, + "outputs": [], + "source": [ + "config_file = 'MMConfig_demo.cfg'" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-09-15T12:04:05.436463Z", + "start_time": "2023-09-15T12:04:05.434724Z" + } + }, + "id": "d0842d07b7cac5d9" + }, + { + "cell_type": "code", + "execution_count": 4, + "outputs": [ + { + "data": { + "text/plain": "" + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "microscope_handler = CMMCorePlus().instance()\n", + "microscope_handler" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-09-15T12:04:05.467226Z", + "start_time": "2023-09-15T12:04:05.436921Z" + } + }, + "id": "941f036ef35d2f7b" + }, + { + "cell_type": "code", + "execution_count": 5, + "outputs": [], + "source": [ + "microscope_handler.loadSystemConfiguration((micromanager_path / config_file))" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-09-15T12:04:05.474888Z", + "start_time": "2023-09-15T12:04:05.468511Z" + } + }, + "id": "773fabe4c3966d44" + }, + { + "cell_type": "code", + "execution_count": 6, + "outputs": [], + "source": [ + "configuration = microscope_handler.getSystemState()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-09-15T12:04:05.478755Z", + "start_time": "2023-09-15T12:04:05.475983Z" + } + }, + "id": "f93b9290a6086393" + }, + { + "cell_type": "code", + "execution_count": 7, + "outputs": [ + { + "data": { + "text/plain": "{'Camera': {'AllowMultiROI': '0',\n 'AsyncPropertyDelayMS': '2000',\n 'AsyncPropertyFollower': '',\n 'AsyncPropertyLeader': '',\n 'Binning': '1',\n 'BitDepth': '16',\n 'CCDTemperature': '0.0000',\n 'CCDTemperature RO': '0.0000',\n 'CameraID': 'V1.0',\n 'CameraName': 'DemoCamera-MultiMode',\n 'Description': 'Demo Camera Device Adapter',\n 'DisplayImageNumber': '0',\n 'DropPixels': '0',\n 'Exposure': '10.0000',\n 'FastImage': '0',\n 'FractionOfPixelsToDropOrSaturate': '0.0020',\n 'Gain': '0',\n 'HubID': '',\n 'MaximumExposureMs': '10000.0000',\n 'Mode': 'Artificial Waves',\n 'MultiROIFillValue': '0',\n 'Name': 'DCam',\n 'Offset': '0',\n 'OnCameraCCDXSize': '512',\n 'OnCameraCCDYSize': '512',\n 'Photon Conversion Factor': '1.0000',\n 'Photon Flux': '50.0000',\n 'PixelType': '16bit',\n 'ReadNoise (electrons)': '2.5000',\n 'ReadoutTime': '0.0000',\n 'RotateImages': '0',\n 'SaturatePixels': '0',\n 'ScanMode': '1',\n 'SimulateCrash': '',\n 'StripeWidth': '1.0000',\n 'TestProperty1': '0.0000',\n 'TestProperty2': '0.0000',\n 'TestProperty3': '0.0000',\n 'TestProperty4': '0.0000',\n 'TestProperty5': '0.0000',\n 'TestProperty6': '0.0000',\n 'TransposeCorrection': '0',\n 'TransposeMirrorX': '0',\n 'TransposeMirrorY': '0',\n 'TransposeXY': '0',\n 'TriggerDevice': '',\n 'UseExposureSequences': 'No'},\n 'Dichroic': {'ClosedPosition': '0',\n 'Description': 'Demo filter wheel driver',\n 'HubID': '',\n 'Label': '400DCLP',\n 'Name': 'DWheel',\n 'State': '0'},\n 'Emission': {'ClosedPosition': '0',\n 'Description': 'Demo filter wheel driver',\n 'HubID': '',\n 'Label': 'Chroma-HQ620',\n 'Name': 'DWheel',\n 'State': '0'},\n 'Excitation': {'ClosedPosition': '0',\n 'Description': 'Demo filter wheel driver',\n 'HubID': '',\n 'Label': 'Chroma-D360',\n 'Name': 'DWheel',\n 'State': '0'},\n 'Objective': {'Description': 'Demo objective turret driver',\n 'HubID': '',\n 'Label': 'Nikon 10X S Fluor',\n 'Name': 'DObjective',\n 'State': '1',\n 'Trigger': '-'},\n 'Z': {'Description': 'Demo stage driver',\n 'HubID': '',\n 'Name': 'DStage',\n 'Position': '0.0000',\n 'UseSequences': 'No'},\n 'Path': {'Description': 'Demo light-path driver',\n 'HubID': '',\n 'Label': 'State-0',\n 'Name': 'DLightPath',\n 'State': '0'},\n 'XY': {'Description': 'Demo XY stage driver',\n 'HubID': '',\n 'Name': 'DXYStage',\n 'TransposeMirrorX': '0',\n 'TransposeMirrorY': '0'},\n 'White Light Shutter': {'Description': 'Demo shutter driver',\n 'HubID': '',\n 'Name': 'DShutter',\n 'State': '1'},\n 'Autofocus': {'Description': 'Demo auto-focus adapter',\n 'HubID': '',\n 'Name': 'DAutoFocus'},\n 'LED': {'ClosedPosition': '0',\n 'Description': 'Demo state device driver',\n 'HubID': '',\n 'Label': 'Closed',\n 'Name': 'DStateDevice',\n 'Number of positions': '10',\n 'Sequence': 'Off',\n 'State': '0'},\n 'LED Shutter': {'Description': 'State device that is used as a shutter',\n 'Name': 'State Device Shutter',\n 'State Device': 'LED'},\n 'Core': {'AutoFocus': 'Autofocus',\n 'AutoShutter': '1',\n 'Camera': 'Camera',\n 'ChannelGroup': 'Channel',\n 'Focus': 'Z',\n 'Galvo': '',\n 'ImageProcessor': '',\n 'Initialize': '1',\n 'SLM': '',\n 'Shutter': 'White Light Shutter',\n 'TimeoutMs': '5000',\n 'XYStage': 'XY'}}" + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "configuration.dict()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-09-15T12:04:05.483637Z", + "start_time": "2023-09-15T12:04:05.478810Z" + } + }, + "id": "5174af5fbd61cefc" + }, + { + "cell_type": "code", + "execution_count": 8, + "outputs": [ + { + "data": { + "text/plain": "'Camera'" + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# just return the label of the CameraDevice as a string\n", + "# could be useful, but we want a device object\n", + "microscope_handler.getCameraDevice()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-09-15T12:04:05.485838Z", + "start_time": "2023-09-15T12:04:05.483553Z" + } + }, + "id": "8ed6ebf214abbfb4" + }, + { + "cell_type": "code", + "execution_count": 22, + "outputs": [ + { + "data": { + "text/plain": "" + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# device object\n", + "camera_device = Device(\n", + " microscope_handler.getCameraDevice(),\n", + " microscope_handler\n", + ")\n", + "camera_device" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-09-15T12:16:10.586609Z", + "start_time": "2023-09-15T12:16:10.565224Z" + } + }, + "id": "7621fa31a87572c0" + }, + { + "cell_type": "code", + "execution_count": 24, + "outputs": [ + { + "data": { + "text/plain": "{'title': 'DCam',\n 'description': 'Demo camera',\n 'type': 'object',\n 'properties': {'AllowMultiROI': {'type': 'boolean'},\n 'AsyncPropertyDelayMS': {'type': 'integer'},\n 'AsyncPropertyFollower': {'type': 'string', 'readOnly': True, 'default': ''},\n 'AsyncPropertyLeader': {'type': 'string'},\n 'Binning': {'type': 'integer', 'enum': [1, 2, 4, 8]},\n 'BitDepth': {'type': 'integer', 'enum': [10, 11, 12, 14, 16, 32, 8]},\n 'CCDTemperature': {'type': 'number', 'minimum': -100.0, 'maximum': 10.0},\n 'CCDTemperature RO': {'type': 'number', 'readOnly': True, 'default': 0.0},\n 'CameraID': {'type': 'string', 'readOnly': True, 'default': 'V1.0'},\n 'CameraName': {'type': 'string',\n 'readOnly': True,\n 'default': 'DemoCamera-MultiMode'},\n 'Description': {'type': 'string',\n 'readOnly': True,\n 'default': 'Demo Camera Device Adapter'},\n 'DisplayImageNumber': {'type': 'boolean'},\n 'DropPixels': {'type': 'boolean'},\n 'Exposure': {'type': 'number', 'minimum': 0.0, 'maximum': 10000.0},\n 'FastImage': {'type': 'boolean'},\n 'FractionOfPixelsToDropOrSaturate': {'type': 'number',\n 'minimum': 0.0,\n 'maximum': 0.1},\n 'Gain': {'type': 'integer', 'minimum': -5.0, 'maximum': 8.0},\n 'HubID': {'type': 'string', 'readOnly': True, 'default': ''},\n 'MaximumExposureMs': {'type': 'number', 'preInit': True},\n 'Mode': {'type': 'string',\n 'enum': ['Artificial Waves', 'Color Test Pattern', 'Noise']},\n 'MultiROIFillValue': {'type': 'integer', 'minimum': 0.0, 'maximum': 65536.0},\n 'Name': {'type': 'string', 'readOnly': True, 'default': 'DCam'},\n 'Offset': {'type': 'integer'},\n 'OnCameraCCDXSize': {'type': 'integer'},\n 'OnCameraCCDYSize': {'type': 'integer'},\n 'Photon Conversion Factor': {'type': 'number',\n 'minimum': 0.01,\n 'maximum': 10.0},\n 'Photon Flux': {'type': 'number', 'minimum': 2.0, 'maximum': 5000.0},\n 'PixelType': {'type': 'string',\n 'enum': ['16bit', '32bit', '32bitRGB', '64bitRGB', '8bit']},\n 'ReadNoise (electrons)': {'type': 'number',\n 'minimum': 0.25,\n 'maximum': 50.0},\n 'ReadoutTime': {'type': 'number'},\n 'RotateImages': {'type': 'boolean'},\n 'SaturatePixels': {'type': 'boolean'},\n 'ScanMode': {'type': 'integer', 'enum': [1, 2, 3]},\n 'SimulateCrash': {'type': 'string',\n 'enum': ['', 'Dereference Null Pointer', 'Divide by Zero']},\n 'StripeWidth': {'type': 'number', 'minimum': 0.0, 'maximum': 10.0},\n 'TestProperty1': {'type': 'number', 'minimum': -0.1, 'maximum': 0.1},\n 'TestProperty2': {'type': 'number', 'minimum': -200.0, 'maximum': 200.0},\n 'TestProperty3': {'type': 'number', 'minimum': 0.0, 'maximum': 0.003},\n 'TestProperty4': {'type': 'number', 'minimum': -40000.0, 'maximum': 40000.0},\n 'TestProperty5': {'type': 'number'},\n 'TestProperty6': {'type': 'number', 'minimum': 0.0, 'maximum': 6000000.0},\n 'TransposeCorrection': {'type': 'boolean'},\n 'TransposeMirrorX': {'type': 'boolean'},\n 'TransposeMirrorY': {'type': 'boolean'},\n 'TransposeXY': {'type': 'boolean'},\n 'TriggerDevice': {'type': 'string'},\n 'UseExposureSequences': {'type': 'string', 'enum': ['No', 'Yes']}}}" + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_device.schema()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-09-15T12:17:05.570690Z", + "start_time": "2023-09-15T12:17:05.558125Z" + } + }, + "id": "596ceb3ef629bec4" + }, + { + "cell_type": "code", + "execution_count": 10, + "outputs": [ + { + "data": { + "text/plain": "512" + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_device.getPropertyObject('OnCameraCCDXSize').value" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-09-15T12:04:05.503197Z", + "start_time": "2023-09-15T12:04:05.489392Z" + } + }, + "id": "8bc0a058adb9328b" + }, + { + "cell_type": "code", + "execution_count": 11, + "outputs": [ + { + "data": { + "text/plain": "CameraSettings(pixel_size_um=1.0, width_pixels=512, height_pixels=512, exposure_time_ms=10.0, gain=0.0)" + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera_settings = CameraSettings(\n", + " pixel_size_um=microscope_handler.getPixelSizeUm(),\n", + " width_pixels=camera_device.getPropertyObject(\n", + " 'OnCameraCCDXSize').value,\n", + " height_pixels=camera_device.getPropertyObject(\n", + " 'OnCameraCCDYSize').value,\n", + " exposure_time_ms=camera_device.getPropertyObject(\n", + " 'Exposure' ).value,\n", + " gain=camera_device.getPropertyObject(\n", + " 'Gain').value\n", + " )\n", + "camera_settings" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-09-15T12:04:05.503351Z", + "start_time": "2023-09-15T12:04:05.492518Z" + } + }, + "id": "5a30f421a1c92d41" + }, + { + "cell_type": "code", + "execution_count": 12, + "outputs": [ + { + "data": { + "text/plain": "1.0" + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "microscope_handler.getPixelSizeUm()" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-09-15T12:04:05.503478Z", + "start_time": "2023-09-15T12:04:05.495162Z" + } + }, + "id": "14e83c05b2e4d112" + }, + { + "cell_type": "code", + "execution_count": 13, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/Users/jwhite/Library/Mobile Documents/com~apple~CloudDocs/Science/Grill_Lab/Projects/microscope-gym/microscope_gym/microscope_adapters/micromanager.py:103: UserWarning: Pixel size is set to 1.0; it may not be set or calibrated.\n", + " warn(f'Pixel size is set to {self._settings.pixel_size_um}; it may not be set or calibrated.')\n" + ] + }, + { + "data": { + "text/plain": "" + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera = Camera(microscope_handler)\n", + "camera" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-09-15T12:04:05.538321Z", + "start_time": "2023-09-15T12:04:05.498903Z" + } + }, + "id": "3db228c9878c2aa9" + }, + { + "cell_type": "code", + "execution_count": 14, + "outputs": [ + { + "data": { + "text/plain": "array([[3276, 3339, 3402, ..., 3087, 3150, 3213],\n [3284, 3347, 3410, ..., 3095, 3158, 3221],\n [3292, 3355, 3418, ..., 3103, 3166, 3229],\n ...,\n [5846, 5846, 5844, ..., 5837, 5842, 5845],\n [5846, 5846, 5844, ..., 5838, 5842, 5845],\n [5846, 5846, 5843, ..., 5839, 5843, 5845]], dtype=uint16)" + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "image = camera.capture_image()\n", + "image" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-09-15T12:04:05.538671Z", + "start_time": "2023-09-15T12:04:05.506837Z" + } + }, + "id": "dd97e516890d7c7f" + }, + { + "cell_type": "code", + "execution_count": 15, + "outputs": [ + { + "data": { + "text/plain": "numpy.ndarray" + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "type(image)" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-09-15T12:04:05.538775Z", + "start_time": "2023-09-15T12:04:05.521031Z" + } + }, + "id": "367c87b5812e61f2" + }, + { + "cell_type": "code", + "execution_count": 16, + "outputs": [], + "source": [ + "# some problems viewingin pycharm, fix later\n", + "# stackview.insight(image)\n", + "# skimage.io.imshow(image)" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-09-15T12:04:05.578150Z", + "start_time": "2023-09-15T12:04:05.523286Z" + } + }, + "id": "d679235b037dbff3" + }, + { + "cell_type": "code", + "execution_count": 17, + "outputs": [], + "source": [ + "# try to set some camera properties\n", + "settings = camera.settings.model_copy() # model_copy is pydantic\n", + "settings.width_pixels = 888 # try a new value\n", + "camera.configure_camera(settings) #set the new value" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-09-15T12:04:05.582674Z", + "start_time": "2023-09-15T12:04:05.524936Z" + } + }, + "id": "1be86921d2752f33" + }, + { + "cell_type": "code", + "execution_count": 19, + "outputs": [ + { + "data": { + "text/plain": "CameraSettings(pixel_size_um=1.0, width_pixels=888, height_pixels=512, exposure_time_ms=10.0, gain=0.0)" + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "camera.settings" + ], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-09-15T12:04:05.582974Z", + "start_time": "2023-09-15T12:04:05.530862Z" + } + }, + "id": "a2e9e266ccd78772" + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [], + "metadata": { + "collapsed": false + }, + "id": "a20b208fff1c96e" + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [], + "metadata": { + "collapsed": false + }, + "id": "88ed28594a32c2aa" + }, + { + "cell_type": "code", + "execution_count": 21, + "outputs": [], + "source": [], + "metadata": { + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-09-15T12:04:05.602218Z", + "start_time": "2023-09-15T12:04:05.538226Z" + } + }, + "id": "8ee9a4dc904380ee" + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/docs/micromanager_testing.ipynb b/docs/micromanager_testing.ipynb index 2cc4ef1..ff2fcb1 100644 --- a/docs/micromanager_testing.ipynb +++ b/docs/micromanager_testing.ipynb @@ -28,13 +28,13 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 2, "id": "initial_id", "metadata": { "collapsed": true, "ExecuteTime": { - "end_time": "2023-08-17T11:49:13.837707Z", - "start_time": "2023-08-17T11:49:13.488699Z" + "end_time": "2023-09-15T09:05:41.661546Z", + "start_time": "2023-09-15T09:05:40.208473Z" } }, "outputs": [], @@ -50,7 +50,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 3, "outputs": [], "source": [ "import json\n", @@ -60,21 +60,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.023282Z", - "start_time": "2023-08-17T11:49:13.492272Z" + "end_time": "2023-09-15T09:05:44.024079Z", + "start_time": "2023-09-15T09:05:44.008724Z" } }, "id": "9fad950cc2c5ebfa" }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 4, "outputs": [ { "data": { "text/plain": "'/Applications/Micro-Manager'" }, - "execution_count": 39, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -86,15 +86,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.023937Z", - "start_time": "2023-08-17T11:49:13.497269Z" + "end_time": "2023-09-15T09:05:45.572756Z", + "start_time": "2023-09-15T09:05:45.556580Z" } }, "id": "ecad81c4c22e42f6" }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 5, "outputs": [], "source": [ "# finding my way around a bit.\n", @@ -109,15 +109,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.072258Z", - "start_time": "2023-08-17T11:49:13.498508Z" + "end_time": "2023-09-15T09:05:50.726489Z", + "start_time": "2023-09-15T09:05:50.691327Z" } }, "id": "67b2bb34999df469" }, { "cell_type": "code", - "execution_count": 41, + "execution_count": 6, "outputs": [], "source": [ "mmc.snapImage??" @@ -125,21 +125,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.073310Z", - "start_time": "2023-08-17T11:49:13.513972Z" + "end_time": "2023-09-15T09:05:52.543159Z", + "start_time": "2023-09-15T09:05:52.513734Z" } }, "id": "db5e8c91fd6ae8f1" }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 7, "outputs": [ { "data": { "text/plain": "numpy.ndarray" }, - "execution_count": 42, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -154,8 +154,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.073453Z", - "start_time": "2023-08-17T11:49:13.518129Z" + "end_time": "2023-09-15T09:06:00.375286Z", + "start_time": "2023-09-15T09:06:00.357545Z" } }, "id": "d900a080024977cd" @@ -187,7 +187,7 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 8, "outputs": [], "source": [ "mmc.snap??" @@ -195,8 +195,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.073910Z", - "start_time": "2023-08-17T11:49:13.532794Z" + "end_time": "2023-09-15T09:06:12.015777Z", + "start_time": "2023-09-15T09:06:11.998193Z" } }, "id": "5122b34bc0288bb3" @@ -228,13 +228,13 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 9, "outputs": [ { "data": { "text/plain": "('Res10x', 'Res20x', 'Res40x')" }, - "execution_count": 46, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -245,21 +245,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.086837Z", - "start_time": "2023-08-17T11:49:13.549499Z" + "end_time": "2023-09-15T09:06:17.907184Z", + "start_time": "2023-09-15T09:06:17.885031Z" } }, "id": "a33bb7ac60b1b4c6" }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 10, "outputs": [ { "data": { "text/plain": "dict_keys(['Camera', 'Dichroic', 'Emission', 'Excitation', 'Objective', 'Z', 'Path', 'XY', 'White Light Shutter', 'Autofocus', 'LED', 'LED Shutter', 'Core'])" }, - "execution_count": 47, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -270,21 +270,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.086929Z", - "start_time": "2023-08-17T11:49:13.551444Z" + "end_time": "2023-09-15T09:06:18.752271Z", + "start_time": "2023-09-15T09:06:18.736966Z" } }, "id": "516a7cc646a0750b" }, { "cell_type": "code", - "execution_count": 48, + "execution_count": 11, "outputs": [ { "data": { "text/plain": "'Camera'" }, - "execution_count": 48, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -295,15 +295,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.087004Z", - "start_time": "2023-08-17T11:49:13.554361Z" + "end_time": "2023-09-15T09:06:20.587866Z", + "start_time": "2023-09-15T09:06:20.570434Z" } }, "id": "bb46170fa723fb5e" }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 12, "outputs": [], "source": [ "camera_name = mmc.getCameraDevice()" @@ -311,21 +311,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.087039Z", - "start_time": "2023-08-17T11:49:13.556382Z" + "end_time": "2023-09-15T09:06:21.272684Z", + "start_time": "2023-09-15T09:06:21.255849Z" } }, "id": "43a5a3f62fe4cb37" }, { "cell_type": "code", - "execution_count": 50, + "execution_count": 13, "outputs": [ { "data": { "text/plain": "('AllowMultiROI',\n 'AsyncPropertyDelayMS',\n 'AsyncPropertyFollower',\n 'AsyncPropertyLeader',\n 'Binning',\n 'BitDepth',\n 'CCDTemperature',\n 'CCDTemperature RO',\n 'CameraID',\n 'CameraName',\n 'Description',\n 'DisplayImageNumber',\n 'DropPixels',\n 'Exposure',\n 'FastImage',\n 'FractionOfPixelsToDropOrSaturate',\n 'Gain',\n 'HubID',\n 'MaximumExposureMs',\n 'Mode',\n 'MultiROIFillValue',\n 'Name',\n 'Offset',\n 'OnCameraCCDXSize',\n 'OnCameraCCDYSize',\n 'Photon Conversion Factor',\n 'Photon Flux',\n 'PixelType',\n 'ReadNoise (electrons)',\n 'ReadoutTime',\n 'RotateImages',\n 'SaturatePixels',\n 'ScanMode',\n 'SimulateCrash',\n 'StripeWidth',\n 'TestProperty1',\n 'TestProperty2',\n 'TestProperty3',\n 'TestProperty4',\n 'TestProperty5',\n 'TestProperty6',\n 'TransposeCorrection',\n 'TransposeMirrorX',\n 'TransposeMirrorY',\n 'TransposeXY',\n 'TriggerDevice',\n 'UseExposureSequences')" }, - "execution_count": 50, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } @@ -337,21 +337,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.087125Z", - "start_time": "2023-08-17T11:49:13.561088Z" + "end_time": "2023-09-15T09:06:26.368142Z", + "start_time": "2023-09-15T09:06:26.350518Z" } }, "id": "ba615747b5cf6fd" }, { "cell_type": "code", - "execution_count": 51, + "execution_count": 14, "outputs": [ { "data": { "text/plain": "'512'" }, - "execution_count": 51, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } @@ -362,15 +362,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.087192Z", - "start_time": "2023-08-17T11:49:13.563380Z" + "end_time": "2023-09-15T09:06:39.062276Z", + "start_time": "2023-09-15T09:06:39.046197Z" } }, "id": "4340d42a9dabdbb6" }, { "cell_type": "code", - "execution_count": 52, + "execution_count": 15, "outputs": [ { "name": "stdout", @@ -433,21 +433,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.087271Z", - "start_time": "2023-08-17T11:49:13.565565Z" + "end_time": "2023-09-15T09:06:53.533930Z", + "start_time": "2023-09-15T09:06:53.509070Z" } }, "id": "565b340440042438" }, { "cell_type": "code", - "execution_count": 53, + "execution_count": 16, "outputs": [ { "data": { "text/plain": "1.0" }, - "execution_count": 53, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } @@ -458,15 +458,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.087367Z", - "start_time": "2023-08-17T11:49:13.567432Z" + "end_time": "2023-09-15T09:06:54.924615Z", + "start_time": "2023-09-15T09:06:54.905344Z" } }, "id": "a993661bfe90bb28" }, { "cell_type": "code", - "execution_count": 54, + "execution_count": 17, "outputs": [], "source": [ "# mmc.getProperty(camera_name, \"Width\")" @@ -474,15 +474,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.087400Z", - "start_time": "2023-08-17T11:49:13.569614Z" + "end_time": "2023-09-15T09:06:56.405537Z", + "start_time": "2023-09-15T09:06:56.388160Z" } }, "id": "24452e3bde009055" }, { "cell_type": "code", - "execution_count": 55, + "execution_count": 18, "outputs": [ { "name": "stdout", @@ -545,24 +545,33 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.087474Z", - "start_time": "2023-08-17T11:49:13.571913Z" + "end_time": "2023-09-15T09:06:58.627837Z", + "start_time": "2023-09-15T09:06:58.611250Z" } }, "id": "cb9a11166a6d3633" }, { "cell_type": "code", - "execution_count": 56, - "outputs": [], + "execution_count": 29, + "outputs": [ + { + "data": { + "text/plain": "'Demo Camera Device Adapter'" + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "camera_props = DeviceProperty" ], "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.087511Z", - "start_time": "2023-08-17T11:49:13.573656Z" + "end_time": "2023-09-15T09:09:59.478447Z", + "start_time": "2023-09-15T09:09:59.448809Z" } }, "id": "c2f078fb9bef433a" @@ -602,7 +611,7 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 30, "outputs": [], "source": [ "device = Device('Stage', mmc)" @@ -610,21 +619,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.087773Z", - "start_time": "2023-08-17T11:49:13.581042Z" + "end_time": "2023-09-15T09:10:23.978322Z", + "start_time": "2023-09-15T09:10:23.953966Z" } }, "id": "cf1b058d0c36dd7" }, { "cell_type": "code", - "execution_count": 60, + "execution_count": 31, "outputs": [ { "data": { "text/plain": "False" }, - "execution_count": 60, + "execution_count": 31, "metadata": {}, "output_type": "execute_result" } @@ -635,8 +644,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.088109Z", - "start_time": "2023-08-17T11:49:13.583224Z" + "end_time": "2023-09-15T09:10:24.652460Z", + "start_time": "2023-09-15T09:10:24.629532Z" } }, "id": "210bfdaae941348f" @@ -902,7 +911,7 @@ }, { "cell_type": "code", - "execution_count": 65, + "execution_count": 32, "outputs": [], "source": [ "device.load('DemoCamera', 'DCam')\n" @@ -910,15 +919,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.088721Z", - "start_time": "2023-08-17T11:49:13.718633Z" + "end_time": "2023-09-15T09:10:54.735565Z", + "start_time": "2023-09-15T09:10:54.716195Z" } }, "id": "b7d56d2ac5fa1e9c" }, { "cell_type": "code", - "execution_count": 66, + "execution_count": 33, "outputs": [], "source": [ "device.unload()" @@ -926,15 +935,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.088759Z", - "start_time": "2023-08-17T11:49:13.720543Z" + "end_time": "2023-09-15T09:10:55.484139Z", + "start_time": "2023-09-15T09:10:55.466713Z" } }, "id": "44bdf47bec31f28e" }, { "cell_type": "code", - "execution_count": 67, + "execution_count": 34, "outputs": [], "source": [ "device.load('DemoCamera', 'DCam')\n" @@ -942,21 +951,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.088799Z", - "start_time": "2023-08-17T11:49:13.722334Z" + "end_time": "2023-09-15T09:10:56.183633Z", + "start_time": "2023-09-15T09:10:56.165824Z" } }, "id": "890186e3e95f9875" }, { "cell_type": "code", - "execution_count": 68, + "execution_count": 35, "outputs": [ { "data": { - "text/plain": "(,\n ,\n ,\n ,\n ,\n )" + "text/plain": "(,\n ,\n ,\n ,\n ,\n )" }, - "execution_count": 68, + "execution_count": 35, "metadata": {}, "output_type": "execute_result" } @@ -967,8 +976,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.088881Z", - "start_time": "2023-08-17T11:49:13.724505Z" + "end_time": "2023-09-15T09:10:57.529560Z", + "start_time": "2023-09-15T09:10:57.498348Z" } }, "id": "149caa3e057fe921" @@ -1001,7 +1010,7 @@ }, { "cell_type": "code", - "execution_count": 69, + "execution_count": 36, "outputs": [], "source": [ "camera_device = Device('Camera', mmc)" @@ -1009,21 +1018,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.088916Z", - "start_time": "2023-08-17T11:49:13.727173Z" + "end_time": "2023-09-15T09:10:59.746601Z", + "start_time": "2023-09-15T09:10:59.721842Z" } }, "id": "45ddd8148f41b907" }, { "cell_type": "code", - "execution_count": 70, + "execution_count": 37, "outputs": [ { "data": { - "text/plain": "(,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n )" + "text/plain": "(,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n )" }, - "execution_count": 70, + "execution_count": 37, "metadata": {}, "output_type": "execute_result" } @@ -1035,15 +1044,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.089056Z", - "start_time": "2023-08-17T11:49:13.729023Z" + "end_time": "2023-09-15T09:11:00.280695Z", + "start_time": "2023-09-15T09:11:00.260519Z" } }, "id": "3c14f3076b49b2f8" }, { "cell_type": "code", - "execution_count": 71, + "execution_count": 38, "outputs": [], "source": [ "# camera_props.hasLimits()" @@ -1051,21 +1060,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.089091Z", - "start_time": "2023-08-17T11:49:13.731700Z" + "end_time": "2023-09-15T09:11:00.816039Z", + "start_time": "2023-09-15T09:11:00.799154Z" } }, "id": "f447c4a15741f10d" }, { "cell_type": "code", - "execution_count": 72, + "execution_count": 39, "outputs": [ { "data": { "text/plain": "True" }, - "execution_count": 72, + "execution_count": 39, "metadata": {}, "output_type": "execute_result" } @@ -1076,15 +1085,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.089166Z", - "start_time": "2023-08-17T11:49:13.733033Z" + "end_time": "2023-09-15T09:11:01.399976Z", + "start_time": "2023-09-15T09:11:01.382646Z" } }, "id": "b931ba85a6681219" }, { "cell_type": "code", - "execution_count": 73, + "execution_count": 40, "outputs": [ { "name": "stderr", @@ -1101,21 +1110,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.089236Z", - "start_time": "2023-08-17T11:49:13.735935Z" + "end_time": "2023-09-15T09:11:01.991110Z", + "start_time": "2023-09-15T09:11:01.974203Z" } }, "id": "ecea844baae82596" }, { "cell_type": "code", - "execution_count": 106, + "execution_count": 41, "outputs": [ { "data": { "text/plain": "True" }, - "execution_count": 106, + "execution_count": 41, "metadata": {}, "output_type": "execute_result" } @@ -1126,15 +1135,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:52.427596Z", - "start_time": "2023-08-17T11:49:52.413916Z" + "end_time": "2023-09-15T09:11:02.193659Z", + "start_time": "2023-09-15T09:11:02.176576Z" } }, "id": "a7031d29791f6d67" }, { "cell_type": "code", - "execution_count": 75, + "execution_count": 42, "outputs": [], "source": [ "camera_device.initialize()" @@ -1142,21 +1151,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.089336Z", - "start_time": "2023-08-17T11:49:13.740774Z" + "end_time": "2023-09-15T09:11:02.368668Z", + "start_time": "2023-09-15T09:11:02.352146Z" } }, "id": "10a69dc6e76b8afe" }, { "cell_type": "code", - "execution_count": 76, + "execution_count": 43, "outputs": [ { "data": { "text/plain": "True" }, - "execution_count": 76, + "execution_count": 43, "metadata": {}, "output_type": "execute_result" } @@ -1167,21 +1176,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.089405Z", - "start_time": "2023-08-17T11:49:13.742826Z" + "end_time": "2023-09-15T09:11:02.526124Z", + "start_time": "2023-09-15T09:11:02.509894Z" } }, "id": "c1d358eaf11f411b" }, { "cell_type": "code", - "execution_count": 77, + "execution_count": 44, "outputs": [ { "data": { "text/plain": "False" }, - "execution_count": 77, + "execution_count": 44, "metadata": {}, "output_type": "execute_result" } @@ -1192,21 +1201,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.089476Z", - "start_time": "2023-08-17T11:49:13.749115Z" + "end_time": "2023-09-15T09:11:02.703792Z", + "start_time": "2023-09-15T09:11:02.687138Z" } }, "id": "699cb1d8426e7d47" }, { "cell_type": "code", - "execution_count": 78, + "execution_count": 45, "outputs": [ { "data": { - "text/plain": "(,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n )" + "text/plain": "(,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n )" }, - "execution_count": 78, + "execution_count": 45, "metadata": {}, "output_type": "execute_result" } @@ -1217,21 +1226,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.089613Z", - "start_time": "2023-08-17T11:49:13.751353Z" + "end_time": "2023-09-15T09:11:03.386882Z", + "start_time": "2023-09-15T09:11:03.368357Z" } }, "id": "86243e58047181e5" }, { "cell_type": "code", - "execution_count": 79, + "execution_count": 46, "outputs": [ { "data": { "text/plain": "{'title': 'DCam',\n 'description': 'Demo camera',\n 'type': 'object',\n 'properties': {'AllowMultiROI': {'type': 'boolean'},\n 'AsyncPropertyDelayMS': {'type': 'integer'},\n 'AsyncPropertyFollower': {'type': 'string', 'readOnly': True, 'default': ''},\n 'AsyncPropertyLeader': {'type': 'string'},\n 'Binning': {'type': 'integer', 'enum': [1, 2, 4, 8]},\n 'BitDepth': {'type': 'integer', 'enum': [10, 11, 12, 14, 16, 32, 8]},\n 'CCDTemperature': {'type': 'number', 'minimum': -100.0, 'maximum': 10.0},\n 'CCDTemperature RO': {'type': 'number', 'readOnly': True, 'default': 0.0},\n 'CameraID': {'type': 'string', 'readOnly': True, 'default': 'V1.0'},\n 'CameraName': {'type': 'string',\n 'readOnly': True,\n 'default': 'DemoCamera-MultiMode'},\n 'Description': {'type': 'string',\n 'readOnly': True,\n 'default': 'Demo Camera Device Adapter'},\n 'DisplayImageNumber': {'type': 'boolean'},\n 'DropPixels': {'type': 'boolean'},\n 'Exposure': {'type': 'number', 'minimum': 0.0, 'maximum': 10000.0},\n 'FastImage': {'type': 'boolean'},\n 'FractionOfPixelsToDropOrSaturate': {'type': 'number',\n 'minimum': 0.0,\n 'maximum': 0.1},\n 'Gain': {'type': 'integer', 'minimum': -5.0, 'maximum': 8.0},\n 'HubID': {'type': 'string', 'readOnly': True, 'default': ''},\n 'MaximumExposureMs': {'type': 'number', 'preInit': True},\n 'Mode': {'type': 'string',\n 'enum': ['Artificial Waves', 'Color Test Pattern', 'Noise']},\n 'MultiROIFillValue': {'type': 'integer', 'minimum': 0.0, 'maximum': 65536.0},\n 'Name': {'type': 'string', 'readOnly': True, 'default': 'DCam'},\n 'Offset': {'type': 'integer'},\n 'OnCameraCCDXSize': {'type': 'integer'},\n 'OnCameraCCDYSize': {'type': 'integer'},\n 'Photon Conversion Factor': {'type': 'number',\n 'minimum': 0.01,\n 'maximum': 10.0},\n 'Photon Flux': {'type': 'number', 'minimum': 2.0, 'maximum': 5000.0},\n 'PixelType': {'type': 'string',\n 'enum': ['16bit', '32bit', '32bitRGB', '64bitRGB', '8bit']},\n 'ReadNoise (electrons)': {'type': 'number',\n 'minimum': 0.25,\n 'maximum': 50.0},\n 'ReadoutTime': {'type': 'number'},\n 'RotateImages': {'type': 'boolean'},\n 'SaturatePixels': {'type': 'boolean'},\n 'ScanMode': {'type': 'integer', 'enum': [1, 2, 3]},\n 'SimulateCrash': {'type': 'string',\n 'enum': ['', 'Dereference Null Pointer', 'Divide by Zero']},\n 'StripeWidth': {'type': 'number', 'minimum': 0.0, 'maximum': 10.0},\n 'TestProperty1': {'type': 'number', 'minimum': -0.1, 'maximum': 0.1},\n 'TestProperty2': {'type': 'number', 'minimum': -200.0, 'maximum': 200.0},\n 'TestProperty3': {'type': 'number', 'minimum': 0.0, 'maximum': 0.003},\n 'TestProperty4': {'type': 'number', 'minimum': -40000.0, 'maximum': 40000.0},\n 'TestProperty5': {'type': 'number'},\n 'TestProperty6': {'type': 'number', 'minimum': 0.0, 'maximum': 6000000.0},\n 'TransposeCorrection': {'type': 'boolean'},\n 'TransposeMirrorX': {'type': 'boolean'},\n 'TransposeMirrorY': {'type': 'boolean'},\n 'TransposeXY': {'type': 'boolean'},\n 'TriggerDevice': {'type': 'string'},\n 'UseExposureSequences': {'type': 'string', 'enum': ['No', 'Yes']}}}" }, - "execution_count": 79, + "execution_count": 46, "metadata": {}, "output_type": "execute_result" } @@ -1242,21 +1251,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.089748Z", - "start_time": "2023-08-17T11:49:13.754237Z" + "end_time": "2023-09-15T09:11:04.431722Z", + "start_time": "2023-09-15T09:11:04.411817Z" } }, "id": "f2ecca8d84b6c54d" }, { "cell_type": "code", - "execution_count": 80, + "execution_count": 47, "outputs": [ { "data": { - "text/plain": "" + "text/plain": "" }, - "execution_count": 80, + "execution_count": 47, "metadata": {}, "output_type": "execute_result" } @@ -1268,21 +1277,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.089819Z", - "start_time": "2023-08-17T11:49:13.758497Z" + "end_time": "2023-09-15T09:11:27.450508Z", + "start_time": "2023-09-15T09:11:27.430730Z" } }, "id": "22a53df9f31735c0" }, { "cell_type": "code", - "execution_count": 81, + "execution_count": 48, "outputs": [ { "data": { "text/plain": "False" }, - "execution_count": 81, + "execution_count": 48, "metadata": {}, "output_type": "execute_result" } @@ -1293,21 +1302,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.089891Z", - "start_time": "2023-08-17T11:49:13.760852Z" + "end_time": "2023-09-15T09:11:28.636709Z", + "start_time": "2023-09-15T09:11:28.619037Z" } }, "id": "25af53a41eea593" }, { "cell_type": "code", - "execution_count": 82, + "execution_count": 49, "outputs": [ { "data": { - "text/plain": ">" + "text/plain": ">" }, - "execution_count": 82, + "execution_count": 49, "metadata": {}, "output_type": "execute_result" } @@ -1318,21 +1327,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.089963Z", - "start_time": "2023-08-17T11:49:13.762942Z" + "end_time": "2023-09-15T09:11:32.087651Z", + "start_time": "2023-09-15T09:11:32.062437Z" } }, "id": "70ad7c58d44dfe5a" }, { "cell_type": "code", - "execution_count": 83, + "execution_count": 50, "outputs": [ { "data": { "text/plain": "'Demo camera'" }, - "execution_count": 83, + "execution_count": 50, "metadata": {}, "output_type": "execute_result" } @@ -1343,21 +1352,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.090033Z", - "start_time": "2023-08-17T11:49:13.765280Z" + "end_time": "2023-09-15T09:11:34.335016Z", + "start_time": "2023-09-15T09:11:34.315381Z" } }, "id": "6045e0c3b4f1919e" }, { "cell_type": "code", - "execution_count": 84, + "execution_count": 51, "outputs": [ { "data": { "text/plain": "'Camera'" }, - "execution_count": 84, + "execution_count": 51, "metadata": {}, "output_type": "execute_result" } @@ -1368,21 +1377,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.090103Z", - "start_time": "2023-08-17T11:49:13.767503Z" + "end_time": "2023-09-15T09:11:34.973479Z", + "start_time": "2023-09-15T09:11:34.955450Z" } }, "id": "302ed27c95db1a0f" }, { "cell_type": "code", - "execution_count": 85, + "execution_count": 52, "outputs": [ { "data": { "text/plain": "{'valid': True,\n 'value': '',\n 'type': 'string',\n 'device_type': 'CameraDevice',\n 'read_only': False,\n 'sequenceable': False,\n 'sequence_max_length': None,\n 'pre_init': False,\n 'range': None,\n 'allowed_values': ()}" }, - "execution_count": 85, + "execution_count": 52, "metadata": {}, "output_type": "execute_result" } @@ -1393,21 +1402,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.090177Z", - "start_time": "2023-08-17T11:49:13.769514Z" + "end_time": "2023-09-15T09:11:40.296086Z", + "start_time": "2023-09-15T09:11:40.276501Z" } }, "id": "9cd0c3ad934ab9d2" }, { "cell_type": "code", - "execution_count": 86, + "execution_count": 53, "outputs": [ { "data": { "text/plain": "{'valid': True,\n 'value': 'Artificial Waves',\n 'type': 'string',\n 'device_type': 'CameraDevice',\n 'read_only': False,\n 'sequenceable': False,\n 'sequence_max_length': None,\n 'pre_init': False,\n 'range': None,\n 'allowed_values': ('Artificial Waves', 'Color Test Pattern', 'Noise')}" }, - "execution_count": 86, + "execution_count": 53, "metadata": {}, "output_type": "execute_result" } @@ -1418,21 +1427,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.090249Z", - "start_time": "2023-08-17T11:49:13.771994Z" + "end_time": "2023-09-15T09:11:41.848538Z", + "start_time": "2023-09-15T09:11:41.829964Z" } }, "id": "31e4f673864666fa" }, { "cell_type": "code", - "execution_count": 87, + "execution_count": 54, "outputs": [ { "data": { "text/plain": "{'valid': True,\n 'value': 0.0,\n 'type': 'number',\n 'device_type': 'CameraDevice',\n 'read_only': False,\n 'sequenceable': False,\n 'sequence_max_length': None,\n 'pre_init': False,\n 'range': (-0.1, 0.1),\n 'allowed_values': ()}" }, - "execution_count": 87, + "execution_count": 54, "metadata": {}, "output_type": "execute_result" } @@ -1443,21 +1452,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.090330Z", - "start_time": "2023-08-17T11:49:13.774998Z" + "end_time": "2023-09-15T09:11:42.807466Z", + "start_time": "2023-09-15T09:11:42.789939Z" } }, "id": "4544054ba5ae3ddc" }, { "cell_type": "code", - "execution_count": 88, + "execution_count": 55, "outputs": [ { "data": { "text/plain": "" }, - "execution_count": 88, + "execution_count": 55, "metadata": {}, "output_type": "execute_result" } @@ -1468,21 +1477,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.090401Z", - "start_time": "2023-08-17T11:49:13.776153Z" + "end_time": "2023-09-15T09:11:44.650878Z", + "start_time": "2023-09-15T09:11:44.633896Z" } }, "id": "90acd36aa3d225cc" }, { "cell_type": "code", - "execution_count": 89, + "execution_count": 56, "outputs": [ { "data": { "text/plain": "" }, - "execution_count": 89, + "execution_count": 56, "metadata": {}, "output_type": "execute_result" } @@ -1493,21 +1502,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.090467Z", - "start_time": "2023-08-17T11:49:13.778331Z" + "end_time": "2023-09-15T09:11:45.351813Z", + "start_time": "2023-09-15T09:11:45.333229Z" } }, "id": "bd00c76e673bcb23" }, { "cell_type": "code", - "execution_count": 90, + "execution_count": 57, "outputs": [ { "data": { "text/plain": "" }, - "execution_count": 90, + "execution_count": 57, "metadata": {}, "output_type": "execute_result" } @@ -1518,21 +1527,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.091066Z", - "start_time": "2023-08-17T11:49:13.780662Z" + "end_time": "2023-09-15T09:11:47.972094Z", + "start_time": "2023-09-15T09:11:47.947160Z" } }, "id": "ef70b4cd04cfbf46" }, { "cell_type": "code", - "execution_count": 91, + "execution_count": 58, "outputs": [ { "data": { "text/plain": "{'AllowMultiROI': '0',\n 'AsyncPropertyDelayMS': '2000',\n 'AsyncPropertyFollower': '',\n 'AsyncPropertyLeader': '',\n 'Binning': '1',\n 'BitDepth': '16',\n 'CCDTemperature': '0.0000',\n 'CCDTemperature RO': '0.0000',\n 'CameraID': 'V1.0',\n 'CameraName': 'DemoCamera-MultiMode',\n 'Description': 'Demo Camera Device Adapter',\n 'DisplayImageNumber': '0',\n 'DropPixels': '0',\n 'Exposure': '10.0000',\n 'FastImage': '0',\n 'FractionOfPixelsToDropOrSaturate': '0.0020',\n 'Gain': '0',\n 'HubID': '',\n 'MaximumExposureMs': '10000.0000',\n 'Mode': 'Artificial Waves',\n 'MultiROIFillValue': '0',\n 'Name': 'DCam',\n 'Offset': '0',\n 'OnCameraCCDXSize': '512',\n 'OnCameraCCDYSize': '512',\n 'Photon Conversion Factor': '1.0000',\n 'Photon Flux': '50.0000',\n 'PixelType': '16bit',\n 'ReadNoise (electrons)': '2.5000',\n 'ReadoutTime': '0.0000',\n 'RotateImages': '0',\n 'SaturatePixels': '0',\n 'ScanMode': '1',\n 'SimulateCrash': '',\n 'StripeWidth': '1.0000',\n 'TestProperty1': '0.0000',\n 'TestProperty2': '0.0000',\n 'TestProperty3': '0.0000',\n 'TestProperty4': '0.0000',\n 'TestProperty5': '0.0000',\n 'TestProperty6': '0.0000',\n 'TransposeCorrection': '0',\n 'TransposeMirrorX': '0',\n 'TransposeMirrorY': '0',\n 'TransposeXY': '0',\n 'TriggerDevice': '',\n 'UseExposureSequences': 'No'}" }, - "execution_count": 91, + "execution_count": 58, "metadata": {}, "output_type": "execute_result" } @@ -1543,21 +1552,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.091184Z", - "start_time": "2023-08-17T11:49:13.782536Z" + "end_time": "2023-09-15T09:11:50.153708Z", + "start_time": "2023-09-15T09:11:50.127929Z" } }, "id": "9c7893c1fd5b86af" }, { "cell_type": "code", - "execution_count": 92, + "execution_count": 59, "outputs": [ { "data": { - "text/plain": "" + "text/plain": "" }, - "execution_count": 92, + "execution_count": 59, "metadata": {}, "output_type": "execute_result" } @@ -1568,21 +1577,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.091260Z", - "start_time": "2023-08-17T11:49:13.785733Z" + "end_time": "2023-09-15T09:11:52.876672Z", + "start_time": "2023-09-15T09:11:52.856468Z" } }, "id": "74a0da3eb1a2a6ac" }, { "cell_type": "code", - "execution_count": 93, + "execution_count": 60, "outputs": [ { "data": { "text/plain": "('Camera', 'Stage')" }, - "execution_count": 93, + "execution_count": 60, "metadata": {}, "output_type": "execute_result" } @@ -1593,15 +1602,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.091347Z", - "start_time": "2023-08-17T11:49:13.787801Z" + "end_time": "2023-09-15T09:11:56.702730Z", + "start_time": "2023-09-15T09:11:56.684894Z" } }, "id": "ea5b4c5d7afd1f68" }, { "cell_type": "code", - "execution_count": 94, + "execution_count": 61, "outputs": [], "source": [ "# DeviceProperty('Camera',)" @@ -1609,21 +1618,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.091384Z", - "start_time": "2023-08-17T11:49:13.789664Z" + "end_time": "2023-09-15T09:11:59.106092Z", + "start_time": "2023-09-15T09:11:59.085230Z" } }, "id": "7b0488e677f88af1" }, { "cell_type": "code", - "execution_count": 95, + "execution_count": 62, "outputs": [ { "data": { "text/plain": "'Camera'" }, - "execution_count": 95, + "execution_count": 62, "metadata": {}, "output_type": "execute_result" } @@ -1634,15 +1643,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.091463Z", - "start_time": "2023-08-17T11:49:13.791824Z" + "end_time": "2023-09-15T09:12:00.211328Z", + "start_time": "2023-09-15T09:12:00.193061Z" } }, "id": "3bff169e5fe7e900" }, { "cell_type": "code", - "execution_count": 96, + "execution_count": 63, "outputs": [], "source": [ "camera_device = Device(mmc.getCameraDevice(), mmc)" @@ -1650,21 +1659,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.091504Z", - "start_time": "2023-08-17T11:49:13.793658Z" + "end_time": "2023-09-15T09:12:00.938581Z", + "start_time": "2023-09-15T09:12:00.920934Z" } }, "id": "55025f655d7db8ae" }, { "cell_type": "code", - "execution_count": 97, + "execution_count": 64, "outputs": [ { "data": { - "text/plain": "" + "text/plain": "" }, - "execution_count": 97, + "execution_count": 64, "metadata": {}, "output_type": "execute_result" } @@ -1675,15 +1684,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.091585Z", - "start_time": "2023-08-17T11:49:13.795692Z" + "end_time": "2023-09-15T09:12:01.416277Z", + "start_time": "2023-09-15T09:12:01.398245Z" } }, "id": "f71c54d23462bf" }, { "cell_type": "code", - "execution_count": 98, + "execution_count": 65, "outputs": [ { "name": "stdout", @@ -1930,8 +1939,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.091668Z", - "start_time": "2023-08-17T11:49:13.797823Z" + "end_time": "2023-09-15T09:12:04.010345Z", + "start_time": "2023-09-15T09:12:03.991529Z" } }, "id": "fad00fea11de84bf" @@ -2113,7 +2122,7 @@ }, { "cell_type": "code", - "execution_count": 135, + "execution_count": 70, "outputs": [], "source": [ "mmc.setProperty(\n", @@ -2125,21 +2134,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T12:18:11.015697Z", - "start_time": "2023-08-17T12:18:11.002650Z" + "end_time": "2023-09-15T09:13:19.095921Z", + "start_time": "2023-09-15T09:13:19.078129Z" } }, "id": "de3df31a8bbd37e8" }, { "cell_type": "code", - "execution_count": 136, + "execution_count": 71, "outputs": [ { "data": { - "text/plain": "0" + "text/plain": "2" }, - "execution_count": 136, + "execution_count": 71, "metadata": {}, "output_type": "execute_result" } @@ -2150,15 +2159,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T12:18:11.673622Z", - "start_time": "2023-08-17T12:18:11.639727Z" + "end_time": "2023-09-15T09:13:19.496034Z", + "start_time": "2023-09-15T09:13:19.475559Z" } }, "id": "ad51eb7303a7df62" }, { "cell_type": "code", - "execution_count": 137, + "execution_count": 72, "outputs": [], "source": [ "mmc.setProperty(\n", @@ -2170,21 +2179,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T12:18:12.250523Z", - "start_time": "2023-08-17T12:18:12.237831Z" + "end_time": "2023-09-15T09:13:22.004335Z", + "start_time": "2023-09-15T09:13:21.978732Z" } }, "id": "dd61fe65bdac5d5a" }, { "cell_type": "code", - "execution_count": 138, + "execution_count": 73, "outputs": [ { "data": { "text/plain": "4" }, - "execution_count": 138, + "execution_count": 73, "metadata": {}, "output_type": "execute_result" } @@ -2195,15 +2204,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T12:18:12.936112Z", - "start_time": "2023-08-17T12:18:12.924398Z" + "end_time": "2023-09-15T09:13:22.478365Z", + "start_time": "2023-09-15T09:13:22.455871Z" } }, "id": "36c00b27c00029eb" }, { "cell_type": "code", - "execution_count": 117, + "execution_count": 74, "outputs": [], "source": [ "mmc.setProperty(\n", @@ -2215,15 +2224,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T12:14:59.825378Z", - "start_time": "2023-08-17T12:14:59.788909Z" + "end_time": "2023-09-15T09:13:23.236234Z", + "start_time": "2023-09-15T09:13:23.216181Z" } }, "id": "5fb5c85b4d7f6cef" }, { "cell_type": "code", - "execution_count": 151, + "execution_count": 75, "outputs": [], "source": [ "mmc.setPixelSizeUm(resolutionID='Res10x', pixSize=2)" @@ -2231,21 +2240,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T13:37:32.979081Z", - "start_time": "2023-08-17T13:37:32.896325Z" + "end_time": "2023-09-15T09:13:23.896621Z", + "start_time": "2023-09-15T09:13:23.879496Z" } }, "id": "84287fed4c005b37" }, { "cell_type": "code", - "execution_count": 143, + "execution_count": 76, "outputs": [ { "data": { "text/plain": "('Camera', 'Channel', 'Channel-Multiband', 'LightPath', 'Objective', 'System')" }, - "execution_count": 143, + "execution_count": 76, "metadata": {}, "output_type": "execute_result" } @@ -2256,21 +2265,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T13:30:29.152145Z", - "start_time": "2023-08-17T13:30:29.073187Z" + "end_time": "2023-09-15T09:13:24.435995Z", + "start_time": "2023-09-15T09:13:24.418726Z" } }, "id": "684e6960676667df" }, { "cell_type": "code", - "execution_count": 150, + "execution_count": 77, "outputs": [ { "data": { "text/plain": "'Res10x'" }, - "execution_count": 150, + "execution_count": 77, "metadata": {}, "output_type": "execute_result" } @@ -2281,15 +2290,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T13:37:16.202450Z", - "start_time": "2023-08-17T13:37:16.167207Z" + "end_time": "2023-09-15T09:13:24.936497Z", + "start_time": "2023-09-15T09:13:24.918Z" } }, "id": "bda1f6bd0f9a1ad2" }, { "cell_type": "code", - "execution_count": 153, + "execution_count": 78, "outputs": [], "source": [ "mmc.setPixelSizeUm(resolutionID=mmc.getCurrentPixelSizeConfig(), pixSize=mmc.getPixelSizeUm())" @@ -2297,21 +2306,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T13:49:56.418276Z", - "start_time": "2023-08-17T13:49:56.404561Z" + "end_time": "2023-09-15T09:13:25.764464Z", + "start_time": "2023-09-15T09:13:25.746894Z" } }, "id": "42f86413ad2ded10" }, { "cell_type": "code", - "execution_count": 154, + "execution_count": 79, "outputs": [ { "data": { "text/plain": "2.0" }, - "execution_count": 154, + "execution_count": 79, "metadata": {}, "output_type": "execute_result" } @@ -2322,48 +2331,42 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T13:50:00.460011Z", - "start_time": "2023-08-17T13:50:00.420256Z" + "end_time": "2023-09-15T09:13:26.914876Z", + "start_time": "2023-09-15T09:13:26.896589Z" } }, "id": "9b4fd804edc9583e" }, { "cell_type": "code", - "execution_count": 159, - "outputs": [ - { - "data": { - "text/plain": "'Demo camera'" - }, - "execution_count": 159, - "metadata": {}, - "output_type": "execute_result" - } - ], + "execution_count": 81, + "outputs": [], "source": [ "camera_device." ], "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T14:34:12.953390Z", - "start_time": "2023-08-17T14:34:12.937088Z" + "end_time": "2023-09-15T09:13:35.085470Z", + "start_time": "2023-09-15T09:13:35.067475Z" } }, "id": "55f5f90aa35b07fe" }, { "cell_type": "code", - "execution_count": 160, + "execution_count": 82, "outputs": [ { - "data": { - "text/plain": "'/Applications/Micro-Managerlibmmgr_dal_ASIStage'" - }, - "execution_count": 160, - "metadata": {}, - "output_type": "execute_result" + "ename": "NameError", + "evalue": "name 'asi_stage_adapter' is not defined", + "output_type": "error", + "traceback": [ + "\u001B[0;31m---------------------------------------------------------------------------\u001B[0m", + "\u001B[0;31mNameError\u001B[0m Traceback (most recent call last)", + "Cell \u001B[0;32mIn[82], line 1\u001B[0m\n\u001B[0;32m----> 1\u001B[0m \u001B[43masi_stage_adapter\u001B[49m\n", + "\u001B[0;31mNameError\u001B[0m: name 'asi_stage_adapter' is not defined" + ] } ], "source": [ @@ -2372,15 +2375,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-18T16:40:59.195971Z", - "start_time": "2023-08-18T16:40:59.151153Z" + "end_time": "2023-09-15T09:13:36.163202Z", + "start_time": "2023-09-15T09:13:36.141549Z" } }, "id": "423f2869ab4006e4" }, { "cell_type": "code", - "execution_count": 170, + "execution_count": 83, "outputs": [], "source": [ "stage_device = Device(mmc.getXYStageDevice(), mmc)" @@ -2388,21 +2391,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-18T16:53:43.163642Z", - "start_time": "2023-08-18T16:53:43.147572Z" + "end_time": "2023-09-15T09:13:36.982618Z", + "start_time": "2023-09-15T09:13:36.962158Z" } }, "id": "a9ed7469c07a4067" }, { "cell_type": "code", - "execution_count": 192, + "execution_count": 84, "outputs": [ { "data": { - "text/plain": "(,\n ,\n ,\n ,\n )" + "text/plain": "(,\n ,\n ,\n ,\n )" }, - "execution_count": 192, + "execution_count": 84, "metadata": {}, "output_type": "execute_result" } @@ -2413,21 +2416,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-18T17:21:46.493548Z", - "start_time": "2023-08-18T17:21:46.442919Z" + "end_time": "2023-09-15T09:13:37.507853Z", + "start_time": "2023-09-15T09:13:37.490744Z" } }, "id": "a9802baaf9783234" }, { "cell_type": "code", - "execution_count": 193, + "execution_count": 85, "outputs": [ { "data": { "text/plain": "'DXYStage'" }, - "execution_count": 193, + "execution_count": 85, "metadata": {}, "output_type": "execute_result" } @@ -2438,25 +2441,29 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-18T17:21:54.581199Z", - "start_time": "2023-08-18T17:21:54.563206Z" + "end_time": "2023-09-15T09:13:37.713021Z", + "start_time": "2023-09-15T09:13:37.694489Z" } }, "id": "5ac5e9941efc81b9" }, { "cell_type": "code", - "execution_count": null, + "execution_count": 85, "outputs": [], "source": [], "metadata": { - "collapsed": false + "collapsed": false, + "ExecuteTime": { + "end_time": "2023-09-15T09:13:38.055262Z", + "start_time": "2023-09-15T09:13:38.036841Z" + } }, "id": "8eb54bb7594b2701" }, { "cell_type": "code", - "execution_count": 172, + "execution_count": 86, "outputs": [ { "name": "stdout", @@ -2499,21 +2506,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-18T16:53:45.135284Z", - "start_time": "2023-08-18T16:53:45.123114Z" + "end_time": "2023-09-15T09:13:38.702964Z", + "start_time": "2023-09-15T09:13:38.686432Z" } }, "id": "f1311bca201d635b" }, { "cell_type": "code", - "execution_count": 173, + "execution_count": 87, "outputs": [ { "data": { "text/plain": "0.0" }, - "execution_count": 173, + "execution_count": 87, "metadata": {}, "output_type": "execute_result" } @@ -2524,15 +2531,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-18T16:54:30.568407Z", - "start_time": "2023-08-18T16:54:30.533323Z" + "end_time": "2023-09-15T09:13:39.528510Z", + "start_time": "2023-09-15T09:13:39.506439Z" } }, "id": "57aa776adf116a70" }, { "cell_type": "code", - "execution_count": 174, + "execution_count": 88, "outputs": [], "source": [ "mmc.setZPosition(2)" @@ -2540,21 +2547,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-18T16:54:42.323154Z", - "start_time": "2023-08-18T16:54:42.270412Z" + "end_time": "2023-09-15T09:13:39.712800Z", + "start_time": "2023-09-15T09:13:39.695972Z" } }, "id": "b46e4cd75ca62035" }, { "cell_type": "code", - "execution_count": 175, + "execution_count": 89, "outputs": [ { "data": { "text/plain": "2.0" }, - "execution_count": 175, + "execution_count": 89, "metadata": {}, "output_type": "execute_result" } @@ -2565,21 +2572,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-18T16:54:48.003358Z", - "start_time": "2023-08-18T16:54:47.951151Z" + "end_time": "2023-09-15T09:13:39.869831Z", + "start_time": "2023-09-15T09:13:39.853120Z" } }, "id": "63e00ac6afbe07bf" }, { "cell_type": "code", - "execution_count": 189, + "execution_count": 90, "outputs": [ { "data": { "text/plain": "('HubID',\n 'MaximumExposureMs',\n 'TransposeCorrection',\n 'TransposeMirrorX',\n 'TransposeMirrorY',\n 'TransposeXY')" }, - "execution_count": 189, + "execution_count": 90, "metadata": {}, "output_type": "execute_result" } @@ -2590,21 +2597,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-18T17:02:48.345007Z", - "start_time": "2023-08-18T17:02:48.319548Z" + "end_time": "2023-09-15T09:13:40.056333Z", + "start_time": "2023-09-15T09:13:40.032124Z" } }, "id": "c685f737fa355047" }, { "cell_type": "code", - "execution_count": 184, + "execution_count": 91, "outputs": [ { "data": { - "text/plain": "" + "text/plain": "" }, - "execution_count": 184, + "execution_count": 91, "metadata": {}, "output_type": "execute_result" } @@ -2615,21 +2622,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-18T17:01:24.880120Z", - "start_time": "2023-08-18T17:01:24.834185Z" + "end_time": "2023-09-15T09:13:40.208717Z", + "start_time": "2023-09-15T09:13:40.191194Z" } }, "id": "cbb2822500cd7007" }, { "cell_type": "code", - "execution_count": 191, + "execution_count": 92, "outputs": [ { "data": { "text/plain": "0.0" }, - "execution_count": 191, + "execution_count": 92, "metadata": {}, "output_type": "execute_result" } @@ -2640,8 +2647,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-18T17:04:02.619581Z", - "start_time": "2023-08-18T17:04:02.594320Z" + "end_time": "2023-09-15T09:13:40.366043Z", + "start_time": "2023-09-15T09:13:40.348978Z" } }, "id": "8af142d0f73e55c2" @@ -2673,17 +2680,17 @@ }, { "cell_type": "code", - "execution_count": 188, + "execution_count": 94, "outputs": [ { - "ename": "RuntimeError", - "evalue": "Error in device \"Stage\": Invalid property name encountered: Position (2)", + "ename": "TypeError", + "evalue": "in method 'CMMCore_getPropertyLowerLimit', argument 3 of type 'char const *'", "output_type": "error", "traceback": [ "\u001B[0;31m---------------------------------------------------------------------------\u001B[0m", - "\u001B[0;31mRuntimeError\u001B[0m Traceback (most recent call last)", - "Cell \u001B[0;32mIn[188], line 1\u001B[0m\n\u001B[0;32m----> 1\u001B[0m \u001B[43mmmc\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mgetPropertyLowerLimit\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;124;43m'\u001B[39;49m\u001B[38;5;124;43mStage\u001B[39;49m\u001B[38;5;124;43m'\u001B[39;49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;124;43m\"\u001B[39;49m\u001B[38;5;124;43mPosition\u001B[39;49m\u001B[38;5;124;43m\"\u001B[39;49m\u001B[43m)\u001B[49m\n", - "\u001B[0;31mRuntimeError\u001B[0m: Error in device \"Stage\": Invalid property name encountered: Position (2)" + "\u001B[0;31mTypeError\u001B[0m Traceback (most recent call last)", + "Cell \u001B[0;32mIn[94], line 1\u001B[0m\n\u001B[0;32m----> 1\u001B[0m \u001B[43mmmc\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mgetPropertyLowerLimit\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;124;43m'\u001B[39;49m\u001B[38;5;124;43mStage\u001B[39;49m\u001B[38;5;124;43m'\u001B[39;49m\u001B[43m,\u001B[49m\u001B[43mmmc\u001B[49m\u001B[43m)\u001B[49m\n", + "\u001B[0;31mTypeError\u001B[0m: in method 'CMMCore_getPropertyLowerLimit', argument 3 of type 'char const *'" ] } ], @@ -2693,8 +2700,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-18T17:02:34.358611Z", - "start_time": "2023-08-18T17:02:34.338823Z" + "end_time": "2023-09-15T09:14:15.554779Z", + "start_time": "2023-09-15T09:14:15.536054Z" } }, "id": "a7442dc420009ca3" diff --git a/microscope_gym/microscope_adapters/micromanager.py b/microscope_gym/microscope_adapters/micromanager.py index 2a12ae6..a34f575 100644 --- a/microscope_gym/microscope_adapters/micromanager.py +++ b/microscope_gym/microscope_adapters/micromanager.py @@ -60,27 +60,31 @@ def _update_axes_positions(self, axis_names: List[str], positions: List[float]): self.microscope_handler.set_xy_position(self.axes['x'].position_um, self.axes['y'].position_um) self.microscope_handler.set_position(self.axes['z'].position_um) + # assume only one camera per microscope for now class Camera(interface.Camera): - def __init__(self, mm_core: CMMCorePlus, save_path: str = '', micromanager_path: str = '/Applications/Micro-Manager', config_file: str = 'MMConfig_demo.cfg', + def __init__(self, mm_core: CMMCorePlus, save_path: str = '', + micromanager_path: str = '/Applications/Micro-Manager', config_file: str = 'MMConfig_demo.cfg', pixel_size_um=None) -> None: self.microscope_handler = mm_core - if save_path == '': - import tempfile - self.save_path = Path(tempfile.mkdtemp) - else: - self.save_path = Path(save_path) - self.save_path.mkdir(exist_ok=True, parents=True) - if find_micromanager() == '': - raise Exception('Micro-manager installation not found or environment variable not set.') - else: - self.micromanager_path = find_micromanager() - config_path = os.path.join(mm_dir, config_file) - if not Path(config_path): - raise Exception(f'Configuration file {config_file} not found in folder {micromanager_path}.') - else: - print(f'Loading configuration file {config_path}.') - self.microscope_handler.loadSystemConfiguration() + # if save_path == '': + # import tempfile + # self.save_path = Path(tempfile.mkdtemp) + # else: + # self.save_path = Path(save_path) + # self.save_path.mkdir(exist_ok=True, parents=True) + # self.micromanager_path = find_micromanager() + # # use assertion? + # # why would we not? There was a reason. What was it?? + # if self.micromanager_path == '': + # raise Exception('Micro-manager installation not found or environment variable not set.') + # config_path = os.path.join(mm_dir, config_file) + # if not Path(config_path): + # raise Exception(f'Configuration file {config_file} not found in folder {self.micromanager_path}.') + # else: + # print(f'Loading configuration file {config_path}.') + # self.microscope_handler.loadSystemConfiguration() + self.microscope_handler.loadSystemConfiguration() self.camera_device = Device( self.microscope_handler.getCameraDevice(), @@ -89,21 +93,19 @@ def __init__(self, mm_core: CMMCorePlus, save_path: str = '', micromanager_path: self._settings = CameraSettings( pixel_size_um=self.microscope_handler.getPixelSizeUm(), width_pixels=self.camera_device.getPropertyObject( - 'OnCameraCCDXsize').value, + 'OnCameraCCDXSize').value, height_pixels=self.camera_device.getPropertyObject( - 'OnCameraCCDYsize').value, + 'OnCameraCCDYSize').value, exposure_time_ms=self.camera_device.getPropertyObject( - 'Exposure' ).value, + 'Exposure').value, gain=self.camera_device.getPropertyObject( - 'Gain').value + 'Gain').value ) # assert self.settings.pixel_size_um !=0 and self.settings.pixel_size_um !=1, f"Pixel size is set to {pixel_size}; it is likely not set or calibrated." - if (pixel_size_um == 0 | pixel_size_um == 1): - warn(f'Pixel size is set to {pixel_size_um}; it is may not set or calibrated.') - + if self._settings.pixel_size_um == 0 or self._settings.pixel_size_um == 1: + warn(f'Pixel size is set to {self._settings.pixel_size_um}; it may not be set or calibrated.') def capture_image(self) -> "numpy.ndarray": - # mmc.snap can take a channel as a parameter (for multi-channel cameras) """ @@ -161,33 +163,36 @@ def setProperty(self, propValue: bool | float | int | str) -> None ''' - - # Micromanager sets different pixel sizes for a configuration using a resolutionID # set the current pixel size (they should all be set in the MM configuration file) - self.microscope_handler.setPixelSizeUm( - resolutionID=self.microscope_handler.getCurrentPixelSizeConfig(), - pixSize=settings.pixel_size_um - ), - # using luxendo code as a hint... + # self.microscope_handler.setPixelSizeUm( + # resolutionID=self.microscope_handler.getCurrentPixelSizeConfig(), + # pixSize=settings.pixel_size_um + # ), + # # using luxendo code as a hint... + # self.microscope_handler.setProperty( + # self.camera_device.label, + # 'OnCameraCCDXSize', + # settings.width_pixels + # ) + # self.microscope_handler.setProperty( + # self.camera_device.label, + # 'OnCameraCCDYSize', + # settings.height_pixels + # ) self.microscope_handler.setProperty( - self.camera_device, - 'OnCameraCCDXsize', - settings.width_pixels - ) - self.microscope_handler.setProperty( - self.camera_device, - 'OnCameraCCDYsize', - settings.height_pixels - ) - self.microscope_handler.setProperty( - self.camera_device, + self.camera_device.label, 'Exposure', settings.exposure_time_ms ) self.microscope_handler.setProperty( - self.camera_device, + self.camera_device.label, 'Gain', settings.gain ) + # save the settings in the Camera object + # self._settings = settings + self._settings.exposure_time_ms = settings.gain + self._settings.gain = settings.gain + return From 57e82be2fd1f1b7b284a26e55fb90b815ba636cc Mon Sep 17 00:00:00 2001 From: thawn Date: Fri, 15 Sep 2023 17:00:26 +0200 Subject: [PATCH 13/16] made stage work with pymmcore-plus we still don't know how to get the stage limits from micromanager. for now we force the user to set them manually during stage initialization. check at a real stage if that has stage limits in pymmcore email the pymmcore developers about stage limits --- docs/micromanager_stage.ipynb | 568 ++++++++++++++++++ .../microscope_adapters/micromanager.py | 32 +- 2 files changed, 586 insertions(+), 14 deletions(-) create mode 100644 docs/micromanager_stage.ipynb diff --git a/docs/micromanager_stage.ipynb b/docs/micromanager_stage.ipynb new file mode 100644 index 0000000..e6ad887 --- /dev/null +++ b/docs/micromanager_stage.ipynb @@ -0,0 +1,568 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "from microscope_gym.microscope_adapters.micromanager import Stage\n", + "from pymmcore_plus import CMMCorePlus, Device, find_micromanager\n", + "from pathlib import Path" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "PosixPath('/Applications/Micro-Manager')" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "micromanager_path = Path(find_micromanager())\n", + "micromanager_path" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "config_file = 'MMConfig_demo.cfg'" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "microscope_handler = CMMCorePlus().instance()\n", + "microscope_handler" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "microscope_handler.loadSystemConfiguration((micromanager_path / config_file))\n" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'Camera': {'AllowMultiROI': '0',\n", + " 'AsyncPropertyDelayMS': '2000',\n", + " 'AsyncPropertyFollower': '',\n", + " 'AsyncPropertyLeader': '',\n", + " 'Binning': '1',\n", + " 'BitDepth': '16',\n", + " 'CCDTemperature': '0.0000',\n", + " 'CCDTemperature RO': '0.0000',\n", + " 'CameraID': 'V1.0',\n", + " 'CameraName': 'DemoCamera-MultiMode',\n", + " 'Description': 'Demo Camera Device Adapter',\n", + " 'DisplayImageNumber': '0',\n", + " 'DropPixels': '0',\n", + " 'Exposure': '10.0000',\n", + " 'FastImage': '0',\n", + " 'FractionOfPixelsToDropOrSaturate': '0.0020',\n", + " 'Gain': '0',\n", + " 'HubID': '',\n", + " 'MaximumExposureMs': '10000.0000',\n", + " 'Mode': 'Artificial Waves',\n", + " 'MultiROIFillValue': '0',\n", + " 'Name': 'DCam',\n", + " 'Offset': '0',\n", + " 'OnCameraCCDXSize': '512',\n", + " 'OnCameraCCDYSize': '512',\n", + " 'Photon Conversion Factor': '1.0000',\n", + " 'Photon Flux': '50.0000',\n", + " 'PixelType': '16bit',\n", + " 'ReadNoise (electrons)': '2.5000',\n", + " 'ReadoutTime': '0.0000',\n", + " 'RotateImages': '0',\n", + " 'SaturatePixels': '0',\n", + " 'ScanMode': '1',\n", + " 'SimulateCrash': '',\n", + " 'StripeWidth': '1.0000',\n", + " 'TestProperty1': '0.0000',\n", + " 'TestProperty2': '0.0000',\n", + " 'TestProperty3': '0.0000',\n", + " 'TestProperty4': '0.0000',\n", + " 'TestProperty5': '0.0000',\n", + " 'TestProperty6': '0.0000',\n", + " 'TransposeCorrection': '0',\n", + " 'TransposeMirrorX': '0',\n", + " 'TransposeMirrorY': '0',\n", + " 'TransposeXY': '0',\n", + " 'TriggerDevice': '',\n", + " 'UseExposureSequences': 'No'},\n", + " 'Dichroic': {'ClosedPosition': '0',\n", + " 'Description': 'Demo filter wheel driver',\n", + " 'HubID': '',\n", + " 'Label': '400DCLP',\n", + " 'Name': 'DWheel',\n", + " 'State': '0'},\n", + " 'Emission': {'ClosedPosition': '0',\n", + " 'Description': 'Demo filter wheel driver',\n", + " 'HubID': '',\n", + " 'Label': 'Chroma-HQ620',\n", + " 'Name': 'DWheel',\n", + " 'State': '0'},\n", + " 'Excitation': {'ClosedPosition': '0',\n", + " 'Description': 'Demo filter wheel driver',\n", + " 'HubID': '',\n", + " 'Label': 'Chroma-D360',\n", + " 'Name': 'DWheel',\n", + " 'State': '0'},\n", + " 'Objective': {'Description': 'Demo objective turret driver',\n", + " 'HubID': '',\n", + " 'Label': 'Nikon 10X S Fluor',\n", + " 'Name': 'DObjective',\n", + " 'State': '1',\n", + " 'Trigger': '-'},\n", + " 'Z': {'Description': 'Demo stage driver',\n", + " 'HubID': '',\n", + " 'Name': 'DStage',\n", + " 'Position': '0.0000',\n", + " 'UseSequences': 'No'},\n", + " 'Path': {'Description': 'Demo light-path driver',\n", + " 'HubID': '',\n", + " 'Label': 'State-0',\n", + " 'Name': 'DLightPath',\n", + " 'State': '0'},\n", + " 'XY': {'Description': 'Demo XY stage driver',\n", + " 'HubID': '',\n", + " 'Name': 'DXYStage',\n", + " 'TransposeMirrorX': '0',\n", + " 'TransposeMirrorY': '0'},\n", + " 'White Light Shutter': {'Description': 'Demo shutter driver',\n", + " 'HubID': '',\n", + " 'Name': 'DShutter',\n", + " 'State': '1'},\n", + " 'Autofocus': {'Description': 'Demo auto-focus adapter',\n", + " 'HubID': '',\n", + " 'Name': 'DAutoFocus'},\n", + " 'LED': {'ClosedPosition': '0',\n", + " 'Description': 'Demo state device driver',\n", + " 'HubID': '',\n", + " 'Label': 'Closed',\n", + " 'Name': 'DStateDevice',\n", + " 'Number of positions': '10',\n", + " 'Sequence': 'Off',\n", + " 'State': '0'},\n", + " 'LED Shutter': {'Description': 'State device that is used as a shutter',\n", + " 'Name': 'State Device Shutter',\n", + " 'State Device': 'LED'},\n", + " 'Core': {'AutoFocus': 'Autofocus',\n", + " 'AutoShutter': '1',\n", + " 'Camera': 'Camera',\n", + " 'ChannelGroup': 'Channel',\n", + " 'Focus': 'Z',\n", + " 'Galvo': '',\n", + " 'ImageProcessor': '',\n", + " 'Initialize': '1',\n", + " 'SLM': '',\n", + " 'Shutter': 'White Light Shutter',\n", + " 'TimeoutMs': '5000',\n", + " 'XYStage': 'XY'}}" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "configuration = microscope_handler.getSystemState()\n", + "configuration.dict()" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'XY'" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "microscope_handler.getXYStageDevice()" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "stage_device = Device(microscope_handler.getXYStageDevice(), microscope_handler)\n", + "stage_device" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "focus_device = Device(microscope_handler.getFocusDevice(), microscope_handler) # Z stage in microscope gym, we don't care about the difference between XY and Z\n", + "focus_device" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'title': 'DXYStage',\n", + " 'description': 'Demo XY stage',\n", + " 'type': 'object',\n", + " 'properties': {'Description': {'type': 'string',\n", + " 'readOnly': True,\n", + " 'default': 'Demo XY stage driver'},\n", + " 'HubID': {'type': 'string', 'readOnly': True, 'default': ''},\n", + " 'Name': {'type': 'string', 'readOnly': True, 'default': 'DXYStage'},\n", + " 'TransposeMirrorX': {'type': 'boolean'},\n", + " 'TransposeMirrorY': {'type': 'boolean'}}}" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "stage_device.schema()" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'title': 'DStage',\n", + " 'description': 'Demo stage',\n", + " 'type': 'object',\n", + " 'properties': {'Description': {'type': 'string',\n", + " 'readOnly': True,\n", + " 'default': 'Demo stage driver'},\n", + " 'HubID': {'type': 'string', 'readOnly': True, 'default': ''},\n", + " 'Name': {'type': 'string', 'readOnly': True, 'default': 'DStage'},\n", + " 'Position': {'type': 'number'},\n", + " 'UseSequences': {'type': 'string', 'enum': ['No', 'Yes']}}}" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "focus_device.schema()" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[-0.0, -0.0]" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "microscope_handler.getXYPosition()" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [], + "source": [ + "microscope_handler.setXYPosition(1, 1)" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[1.005, 1.005]" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "microscope_handler.getXYPosition()" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0.0" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "microscope_handler.getZPosition()" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [], + "source": [ + "microscope_handler.setZPosition(5)" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "5.0" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "microscope_handler.getZPosition()" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1.005" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "microscope_handler.getXPosition()" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "microscope_handler.deviceBusy('XY')" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [], + "source": [ + "stage = Stage(microscope_handler, z_limits=(-10, 10), x_limits=(-10, 10), y_limits=(-10, 10))" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "stage.is_moving()" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "stage.x_position_um -= 5\n", + "stage.is_moving()" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "-3.995" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "stage.x_position_um" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "mic-gym-env", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.16" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/microscope_gym/microscope_adapters/micromanager.py b/microscope_gym/microscope_adapters/micromanager.py index a34f575..f92a914 100644 --- a/microscope_gym/microscope_adapters/micromanager.py +++ b/microscope_gym/microscope_adapters/micromanager.py @@ -14,11 +14,19 @@ from pymmcore_plus import CMMCorePlus, Device, find_micromanager from microscope_gym import interface from microscope_gym.interface import Objective, Microscope, Axis, Camera, CameraSettings +from typing import Tuple class Stage(interface.Stage): - def __init__(self, mm_core: CMMCorePlus) -> None: + def __init__(self, mm_core: CMMCorePlus, z_limits: Tuple[int], y_limits: Tuple[int], x_limits: Tuple[int]): + self.z_min, self.z_max = z_limits + self.y_min, self.y_max = y_limits + self.x_min, self.x_max = x_limits self.microscope_handler = mm_core + focus_device_name = self.microscope_handler.getFocusDevice() + self.focus_device = Device(focus_device_name, self.microscope_handler) + stage_device_name = self.microscope_handler.getXYStageDevice() + self.stage_device = Device(stage_device_name, self.microscope_handler) self.axes = OrderedDict() self._get_axes_positions_from_microscope() @@ -26,23 +34,19 @@ def _get_axes_positions_from_microscope(self): # Todo: limits. There is no general way to get the X and Y limits for a particular stage from mmcore. self.axes["z"] = Axis(name='z', position_um=self.microscope_handler.getZPosition(), - min=-10, # TODO Figure out how to get this from MMCore - max=10) # TODO Figure out how to get this from MMCore + min=self.z_min, # TODO Figure out how to get this from MMCore + max=self.z_max) # TODO Figure out how to get this from MMCore self.axes["y"] = Axis(name='y', position_um=self.microscope_handler.getYPosition(), - min=-10, # TODO Figure out how to get this from MMCore - max=10) # TODO Figure out how to get this from MMCore + min=self.y_min, # TODO Figure out how to get this from MMCore + max=self.y_max) # TODO Figure out how to get this from MMCore self.axes["x"] = Axis(name='x', position_um=self.microscope_handler.getXPosition(), - min=-10, # TODO Figure out how to get this from MMCore - max=10) # TODO Figure out how to get this from MMCore + min=self.x_min, # TODO Figure out how to get this from MMCore + max=self.x_max) # TODO Figure out how to get this from MMCore def is_moving(self): - focus_device_name = self.microscope_handler.get_focus_device() - stage_device_name = self.microscope_handler.get_xy_stage_device() - - return self.microscope_handler.device_busy( - focus_device_name) or self.microscope_handler.device_busy(stage_device_name) + return self.stage_device.isBusy() or self.focus_device.isBusy() def _update_axes_positions(self, axis_names: List[str], positions: List[float]): '''Write new positions to axes. @@ -57,8 +61,8 @@ def _update_axes_positions(self, axis_names: List[str], positions: List[float]): ''' for name, position in zip(axis_names, positions): self.axes[name].position_um = position - self.microscope_handler.set_xy_position(self.axes['x'].position_um, self.axes['y'].position_um) - self.microscope_handler.set_position(self.axes['z'].position_um) + self.microscope_handler.setXYPosition(self.axes['x'].position_um, self.axes['y'].position_um) + self.microscope_handler.setZPosition(self.axes['z'].position_um) # assume only one camera per microscope for now From b6ce486a1f1f64c56fe66b165ed106a2628ee754 Mon Sep 17 00:00:00 2001 From: Jamie White <74255929+jqwhite@users.noreply.github.com> Date: Fri, 15 Sep 2023 17:04:19 +0200 Subject: [PATCH 14/16] Updating micromanager_testing.ipynb Co-coding with Till and Hamdaan. --- docs/micromanager_testing.ipynb | 782 +++++++++++++++----------------- 1 file changed, 375 insertions(+), 407 deletions(-) diff --git a/docs/micromanager_testing.ipynb b/docs/micromanager_testing.ipynb index ff2fcb1..6db63fa 100644 --- a/docs/micromanager_testing.ipynb +++ b/docs/micromanager_testing.ipynb @@ -28,13 +28,13 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "id": "initial_id", "metadata": { "collapsed": true, "ExecuteTime": { - "end_time": "2023-09-15T09:05:41.661546Z", - "start_time": "2023-09-15T09:05:40.208473Z" + "end_time": "2023-09-15T14:52:06.412895Z", + "start_time": "2023-09-15T14:52:04.921716Z" } }, "outputs": [], @@ -50,31 +50,33 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 2, "outputs": [], "source": [ "import json\n", + "\n", + "\n", "def pretty(d):\n", " print(json.dumps(d, indent=4))" ], "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:05:44.024079Z", - "start_time": "2023-09-15T09:05:44.008724Z" + "end_time": "2023-09-15T14:52:06.413367Z", + "start_time": "2023-09-15T14:52:05.162154Z" } }, "id": "9fad950cc2c5ebfa" }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "outputs": [ { "data": { "text/plain": "'/Applications/Micro-Manager'" }, - "execution_count": 4, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -86,15 +88,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:05:45.572756Z", - "start_time": "2023-09-15T09:05:45.556580Z" + "end_time": "2023-09-15T14:52:06.450017Z", + "start_time": "2023-09-15T14:52:05.164658Z" } }, "id": "ecad81c4c22e42f6" }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "outputs": [], "source": [ "# finding my way around a bit.\n", @@ -109,15 +111,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:05:50.726489Z", - "start_time": "2023-09-15T09:05:50.691327Z" + "end_time": "2023-09-15T14:52:06.450291Z", + "start_time": "2023-09-15T14:52:05.170624Z" } }, "id": "67b2bb34999df469" }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "outputs": [], "source": [ "mmc.snapImage??" @@ -125,21 +127,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:05:52.543159Z", - "start_time": "2023-09-15T09:05:52.513734Z" + "end_time": "2023-09-15T14:52:06.484393Z", + "start_time": "2023-09-15T14:52:05.204181Z" } }, "id": "db5e8c91fd6ae8f1" }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 6, "outputs": [ { "data": { "text/plain": "numpy.ndarray" }, - "execution_count": 7, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -154,21 +156,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:06:00.375286Z", - "start_time": "2023-09-15T09:06:00.357545Z" + "end_time": "2023-09-15T14:52:06.511552Z", + "start_time": "2023-09-15T14:52:05.231147Z" } }, "id": "d900a080024977cd" }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 7, "outputs": [ { "data": { "text/plain": "array([[3276, 3339, 3402, ..., 3087, 3150, 3213],\n [3284, 3347, 3410, ..., 3095, 3158, 3221],\n [3292, 3355, 3418, ..., 3103, 3166, 3229],\n ...,\n [5846, 5846, 5844, ..., 5837, 5842, 5845],\n [5846, 5846, 5844, ..., 5838, 5842, 5845],\n [5846, 5846, 5843, ..., 5839, 5843, 5845]], dtype=uint16)" }, - "execution_count": 43, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -179,8 +181,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.073553Z", - "start_time": "2023-08-17T11:49:13.530877Z" + "end_time": "2023-09-15T14:52:06.512342Z", + "start_time": "2023-09-15T14:52:05.245650Z" } }, "id": "a857247e33a72859" @@ -195,21 +197,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:06:12.015777Z", - "start_time": "2023-09-15T09:06:11.998193Z" + "end_time": "2023-09-15T14:52:06.513975Z", + "start_time": "2023-09-15T14:52:05.248885Z" } }, "id": "5122b34bc0288bb3" }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 9, "outputs": [ { "data": { "text/plain": "array([[5093, 5138, 5180, ..., 4955, 5002, 5048],\n [5099, 5143, 5186, ..., 4961, 5008, 5054],\n [5105, 5148, 5191, ..., 4967, 5014, 5060],\n ...,\n [5110, 5065, 5020, ..., 5238, 5196, 5154],\n [5105, 5060, 5014, ..., 5232, 5191, 5148],\n [5099, 5054, 5008, ..., 5227, 5186, 5143]], dtype=uint16)" }, - "execution_count": 45, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -220,21 +222,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.086635Z", - "start_time": "2023-08-17T11:49:13.536726Z" + "end_time": "2023-09-15T14:52:06.514354Z", + "start_time": "2023-09-15T14:52:05.253908Z" } }, "id": "ec2bd2d092f73425" }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 10, "outputs": [ { "data": { "text/plain": "('Res10x', 'Res20x', 'Res40x')" }, - "execution_count": 9, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -245,21 +247,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:06:17.907184Z", - "start_time": "2023-09-15T09:06:17.885031Z" + "end_time": "2023-09-15T14:52:06.514975Z", + "start_time": "2023-09-15T14:52:05.270013Z" } }, "id": "a33bb7ac60b1b4c6" }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 11, "outputs": [ { "data": { "text/plain": "dict_keys(['Camera', 'Dichroic', 'Emission', 'Excitation', 'Objective', 'Z', 'Path', 'XY', 'White Light Shutter', 'Autofocus', 'LED', 'LED Shutter', 'Core'])" }, - "execution_count": 10, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -270,21 +272,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:06:18.752271Z", - "start_time": "2023-09-15T09:06:18.736966Z" + "end_time": "2023-09-15T14:52:06.515425Z", + "start_time": "2023-09-15T14:52:05.272219Z" } }, "id": "516a7cc646a0750b" }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 12, "outputs": [ { "data": { "text/plain": "'Camera'" }, - "execution_count": 11, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -295,15 +297,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:06:20.587866Z", - "start_time": "2023-09-15T09:06:20.570434Z" + "end_time": "2023-09-15T14:52:06.515741Z", + "start_time": "2023-09-15T14:52:05.276224Z" } }, "id": "bb46170fa723fb5e" }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 13, "outputs": [], "source": [ "camera_name = mmc.getCameraDevice()" @@ -311,21 +313,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:06:21.272684Z", - "start_time": "2023-09-15T09:06:21.255849Z" + "end_time": "2023-09-15T14:52:06.515888Z", + "start_time": "2023-09-15T14:52:05.279311Z" } }, "id": "43a5a3f62fe4cb37" }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 14, "outputs": [ { "data": { "text/plain": "('AllowMultiROI',\n 'AsyncPropertyDelayMS',\n 'AsyncPropertyFollower',\n 'AsyncPropertyLeader',\n 'Binning',\n 'BitDepth',\n 'CCDTemperature',\n 'CCDTemperature RO',\n 'CameraID',\n 'CameraName',\n 'Description',\n 'DisplayImageNumber',\n 'DropPixels',\n 'Exposure',\n 'FastImage',\n 'FractionOfPixelsToDropOrSaturate',\n 'Gain',\n 'HubID',\n 'MaximumExposureMs',\n 'Mode',\n 'MultiROIFillValue',\n 'Name',\n 'Offset',\n 'OnCameraCCDXSize',\n 'OnCameraCCDYSize',\n 'Photon Conversion Factor',\n 'Photon Flux',\n 'PixelType',\n 'ReadNoise (electrons)',\n 'ReadoutTime',\n 'RotateImages',\n 'SaturatePixels',\n 'ScanMode',\n 'SimulateCrash',\n 'StripeWidth',\n 'TestProperty1',\n 'TestProperty2',\n 'TestProperty3',\n 'TestProperty4',\n 'TestProperty5',\n 'TestProperty6',\n 'TransposeCorrection',\n 'TransposeMirrorX',\n 'TransposeMirrorY',\n 'TransposeXY',\n 'TriggerDevice',\n 'UseExposureSequences')" }, - "execution_count": 13, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } @@ -337,40 +339,40 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:06:26.368142Z", - "start_time": "2023-09-15T09:06:26.350518Z" + "end_time": "2023-09-15T14:52:06.516217Z", + "start_time": "2023-09-15T14:52:05.281860Z" } }, "id": "ba615747b5cf6fd" }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 15, "outputs": [ { "data": { "text/plain": "'512'" }, - "execution_count": 14, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "mmc.getProperty(camera_name,'OnCameraCCDXSize')" + "mmc.getProperty(camera_name, 'OnCameraCCDXSize')" ], "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:06:39.062276Z", - "start_time": "2023-09-15T09:06:39.046197Z" + "end_time": "2023-09-15T14:52:06.516518Z", + "start_time": "2023-09-15T14:52:05.284583Z" } }, "id": "4340d42a9dabdbb6" }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 16, "outputs": [ { "name": "stdout", @@ -433,21 +435,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:06:53.533930Z", - "start_time": "2023-09-15T09:06:53.509070Z" + "end_time": "2023-09-15T14:52:06.530811Z", + "start_time": "2023-09-15T14:52:05.286806Z" } }, "id": "565b340440042438" }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 17, "outputs": [ { "data": { "text/plain": "1.0" }, - "execution_count": 16, + "execution_count": 17, "metadata": {}, "output_type": "execute_result" } @@ -458,15 +460,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:06:54.924615Z", - "start_time": "2023-09-15T09:06:54.905344Z" + "end_time": "2023-09-15T14:52:06.531680Z", + "start_time": "2023-09-15T14:52:05.290206Z" } }, "id": "a993661bfe90bb28" }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 18, "outputs": [], "source": [ "# mmc.getProperty(camera_name, \"Width\")" @@ -474,15 +476,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:06:56.405537Z", - "start_time": "2023-09-15T09:06:56.388160Z" + "end_time": "2023-09-15T14:52:06.531859Z", + "start_time": "2023-09-15T14:52:05.293455Z" } }, "id": "24452e3bde009055" }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 19, "outputs": [ { "name": "stdout", @@ -545,40 +547,31 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:06:58.627837Z", - "start_time": "2023-09-15T09:06:58.611250Z" + "end_time": "2023-09-15T14:52:06.532188Z", + "start_time": "2023-09-15T14:52:05.296122Z" } }, "id": "cb9a11166a6d3633" }, { "cell_type": "code", - "execution_count": 29, - "outputs": [ - { - "data": { - "text/plain": "'Demo Camera Device Adapter'" - }, - "execution_count": 29, - "metadata": {}, - "output_type": "execute_result" - } - ], + "execution_count": 20, + "outputs": [], "source": [ "camera_props = DeviceProperty" ], "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:09:59.478447Z", - "start_time": "2023-09-15T09:09:59.448809Z" + "end_time": "2023-09-15T14:52:06.532322Z", + "start_time": "2023-09-15T14:52:05.298411Z" } }, "id": "c2f078fb9bef433a" }, { "cell_type": "code", - "execution_count": 57, + "execution_count": 21, "outputs": [], "source": [ "# core = pymmcore_plus.CMMCorePlus().instance()\n", @@ -587,15 +580,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.087648Z", - "start_time": "2023-08-17T11:49:13.575591Z" + "end_time": "2023-09-15T14:52:06.532458Z", + "start_time": "2023-09-15T14:52:05.300478Z" } }, "id": "4574c4cbcfaf3d3" }, { "cell_type": "code", - "execution_count": 58, + "execution_count": 22, "outputs": [], "source": [ "mmc.loadSystemConfiguration()" @@ -603,15 +596,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.087724Z", - "start_time": "2023-08-17T11:49:13.577264Z" + "end_time": "2023-09-15T14:52:06.532579Z", + "start_time": "2023-09-15T14:52:05.302989Z" } }, "id": "ccbe1d7bbbeed9ad" }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 23, "outputs": [], "source": [ "device = Device('Stage', mmc)" @@ -619,21 +612,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:10:23.978322Z", - "start_time": "2023-09-15T09:10:23.953966Z" + "end_time": "2023-09-15T14:52:06.532698Z", + "start_time": "2023-09-15T14:52:05.307862Z" } }, "id": "cf1b058d0c36dd7" }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 24, "outputs": [ { "data": { "text/plain": "False" }, - "execution_count": 31, + "execution_count": 24, "metadata": {}, "output_type": "execute_result" } @@ -644,21 +637,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:10:24.652460Z", - "start_time": "2023-09-15T09:10:24.629532Z" + "end_time": "2023-09-15T14:52:06.532982Z", + "start_time": "2023-09-15T14:52:05.310108Z" } }, "id": "210bfdaae941348f" }, { "cell_type": "code", - "execution_count": 61, + "execution_count": 25, "outputs": [ { "data": { "text/plain": "'\\ndevice.load(\\'XY\\', \\'Stage\\')\\nRuntimeError: Failed to load device \"Stage\" from adapter module \"XY\". Adapter name \\'XY\\' not in list of known adapter names: (\\'LightSheetManager\\', \\'ASITiger\\', \\'LeicaDMR\\', \\'XLightV3\\', \\'HamiltonMVP\\', \\'SutterLambda\\', \\'LudlLow\\', \\'LeicaDMI\\', \\'CoolLEDpE4000\\', \\'CoherentOBIS\\', \\'XLight\\', \\'ImageProcessorChain\\', \\'SutterMPC\\', \\'SerialManager\\', \\'PIEZOCONCEPT\\', \\'MicroPoint\\', \\'CSUX\\', \\'MaestroServo\\', \\'CoherentCube\\', \\'LaserQuantumLaser\\', \\'CoolLEDpE300\\', \\'ThorLabs\\', \\'VariLC\\', \\'Nikon\\', \\'SequenceTester\\', \\'SpectralLMM5\\', \\'MicroFPGA\\', \\'MoticUCam\\', \\'MarzhauserLStep\\', \\'IsmatecMCP\\', \\'StarlightXpress\\', \\'PI\\', \\'XCiteXT600\\', \\'NewportCONEX\\', \\'SutterLambdaParallelArduino\\', \\'PriorLegacy\\', \\'BlueboxOptics_niji\\', \\'XCite120PCExacte\\', \\'ThorlabsElliptecSlider\\', \\'ArduinoNeoPixel\\', \\'ChuoSeikiMD5000\\', \\'NikonAZ100\\', \\'SmarActHCU3D\\', \\'Piezosystem_NV40_1\\', \\'Aquinas\\', \\'ChuoSeikiQT\\', \\'PIGCS2\\', \\'OxxiusCombiner\\', \\'OpenCVgrabber\\', \\'MP285\\', \\'TriggerScopeMM\\', \\'Utilities.la\\', \\'ThorLabsSC10\\', \\'CARVII\\', \\'KDV\\', \\'Xcite\\', \\'Cobolt\\', \\'Arduino\\', \\'pgFocus\\', \\'FreeSerialPort\\', \\'K8055\\', \\'Stradus\\', \\'Vincent\\', \\'ASIWPTR\\', \\'Piezosystem_NV120_1\\', \\'GPhoto\\', \\'ESImagingIOControllers\\', \\'nPoint\\', \\'Piezosystem_dDrive\\', \\'DemoCamera\\', \\'ThorlabsFilterWheel\\', \\'NewportSMC\\', \\'LumencorSpectra\\', \\'FakeCamera\\', \\'LeicaDMSTC\\', \\'MarzhauserLStepOld\\', \\'HIDManager\\', \\'OVP_ECS2\\', \\'Prior\\', \\'YodnE600\\', \\'Diskovery\\', \\'NNLC\\', \\'CSUW1\\', \\'VarispecLCTF\\', \\'Aladdin\\', \\'TriggerScope\\', \\'FocalPoint\\', \\'SutterStage\\', \\'ZeissCAN\\', \\'CSU22\\', \\'Thorlabs_ELL14\\', \\'NikonTE2000\\', \\'AAAOTF\\', \\'SouthPort\\', \\'ThorlabsDCxxxx\\', \\'Toptica_iBeamSmartCW\\', \\'Skyra\\', \\'CoherentScientificRemote\\', \\'VersaLase\\', \\'Arduino32bitBoards\\', \\'RAMPS\\', \\'dc1394\\', \\'Polychrome5000\\', \\'ZeissCAN29\\', \\'UserDefinedSerial\\', \\'DemoCamera.la\\', \\'Oxxius\\', \\'ASIFW1000\\', \\'Utilities\\', \\'Scientifica\\', \\'WieneckeSinske\\', \\'Conix\\', \\'Neos\\', \\'SutterLambda2\\', \\'Piezosystem_30DV50\\', \\'Omicron\\', \\'Olympus\\', \\'XCiteLed\\', \\'IIDC\\', \\'Ludl\\', \\'Piezosystem_NV40_3\\', \\'PrecisExcite\\', \\'Marzhauser\\', \\'NikonEclipse90i\\', \\'Hydra\\', \\'ASIStage\\', \\'Sapphire\\', \\'USBManager\\', \\'Tofra\\', \\'Pecon\\', \\'Zaber\\', \\'Corvus\\', \\'PIGCS\\', \\'K8061\\', \\'MPBLaser\\').\\n\\n'" }, - "execution_count": 61, + "execution_count": 25, "metadata": {}, "output_type": "execute_result" } @@ -673,50 +666,70 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.088233Z", - "start_time": "2023-08-17T11:49:13.585912Z" + "end_time": "2023-09-15T14:52:06.533346Z", + "start_time": "2023-09-15T14:52:05.313737Z" } }, "id": "521a0002b343b233" }, { "cell_type": "code", - "execution_count": 62, + "execution_count": 26, "outputs": [ { "data": { "text/plain": "['LightSheetManager',\n 'ASITiger',\n 'LeicaDMR',\n 'XLightV3',\n 'HamiltonMVP',\n 'SutterLambda',\n 'LudlLow',\n 'LeicaDMI',\n 'CoolLEDpE4000',\n 'CoherentOBIS',\n 'XLight',\n 'ImageProcessorChain',\n 'SutterMPC',\n 'SerialManager',\n 'PIEZOCONCEPT',\n 'MicroPoint',\n 'CSUX',\n 'MaestroServo',\n 'CoherentCube',\n 'LaserQuantumLaser',\n 'CoolLEDpE300',\n 'ThorLabs',\n 'VariLC',\n 'Nikon',\n 'SequenceTester',\n 'SpectralLMM5',\n 'MicroFPGA',\n 'MoticUCam',\n 'MarzhauserLStep',\n 'IsmatecMCP',\n 'StarlightXpress',\n 'PI',\n 'XCiteXT600',\n 'NewportCONEX',\n 'SutterLambdaParallelArduino',\n 'PriorLegacy',\n 'BlueboxOptics_niji',\n 'XCite120PCExacte',\n 'ThorlabsElliptecSlider',\n 'ArduinoNeoPixel',\n 'ChuoSeikiMD5000',\n 'NikonAZ100',\n 'SmarActHCU3D',\n 'Piezosystem_NV40_1',\n 'Aquinas',\n 'ChuoSeikiQT',\n 'PIGCS2',\n 'OxxiusCombiner',\n 'OpenCVgrabber',\n 'MP285',\n 'TriggerScopeMM',\n 'Utilities.la',\n 'ThorLabsSC10',\n 'CARVII',\n 'KDV',\n 'Xcite',\n 'Cobolt',\n 'Arduino',\n 'pgFocus',\n 'FreeSerialPort',\n 'K8055',\n 'Stradus',\n 'Vincent',\n 'ASIWPTR',\n 'Piezosystem_NV120_1',\n 'GPhoto',\n 'ESImagingIOControllers',\n 'nPoint',\n 'Piezosystem_dDrive',\n 'DemoCamera',\n 'ThorlabsFilterWheel',\n 'NewportSMC',\n 'LumencorSpectra',\n 'FakeCamera',\n 'LeicaDMSTC',\n 'MarzhauserLStepOld',\n 'HIDManager',\n 'OVP_ECS2',\n 'Prior',\n 'YodnE600',\n 'Diskovery',\n 'NNLC',\n 'CSUW1',\n 'VarispecLCTF',\n 'Aladdin',\n 'TriggerScope',\n 'FocalPoint',\n 'SutterStage',\n 'ZeissCAN',\n 'CSU22',\n 'Thorlabs_ELL14',\n 'NikonTE2000',\n 'AAAOTF',\n 'SouthPort',\n 'ThorlabsDCxxxx',\n 'Toptica_iBeamSmartCW',\n 'Skyra',\n 'CoherentScientificRemote',\n 'VersaLase',\n 'Arduino32bitBoards',\n 'RAMPS',\n 'dc1394',\n 'Polychrome5000',\n 'ZeissCAN29',\n 'UserDefinedSerial',\n 'DemoCamera.la',\n 'Oxxius',\n 'ASIFW1000',\n 'Utilities',\n 'Scientifica',\n 'WieneckeSinske',\n 'Conix',\n 'Neos',\n 'SutterLambda2',\n 'Piezosystem_30DV50',\n 'Omicron',\n 'Olympus',\n 'XCiteLed',\n 'IIDC',\n 'Ludl',\n 'Piezosystem_NV40_3',\n 'PrecisExcite',\n 'Marzhauser',\n 'NikonEclipse90i',\n 'Hydra',\n 'ASIStage',\n 'Sapphire',\n 'USBManager',\n 'Tofra',\n 'Pecon',\n 'Zaber',\n 'Corvus',\n 'PIGCS',\n 'K8061',\n 'MPBLaser']" }, - "execution_count": 62, + "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "device_list = list(('LightSheetManager', 'ASITiger', 'LeicaDMR', 'XLightV3', 'HamiltonMVP', 'SutterLambda', 'LudlLow', 'LeicaDMI', 'CoolLEDpE4000', 'CoherentOBIS', 'XLight', 'ImageProcessorChain', 'SutterMPC', 'SerialManager', 'PIEZOCONCEPT', 'MicroPoint', 'CSUX', 'MaestroServo', 'CoherentCube', 'LaserQuantumLaser', 'CoolLEDpE300', 'ThorLabs', 'VariLC', 'Nikon', 'SequenceTester', 'SpectralLMM5', 'MicroFPGA', 'MoticUCam', 'MarzhauserLStep', 'IsmatecMCP', 'StarlightXpress', 'PI', 'XCiteXT600', 'NewportCONEX', 'SutterLambdaParallelArduino', 'PriorLegacy', 'BlueboxOptics_niji', 'XCite120PCExacte', 'ThorlabsElliptecSlider', 'ArduinoNeoPixel', 'ChuoSeikiMD5000', 'NikonAZ100', 'SmarActHCU3D', 'Piezosystem_NV40_1', 'Aquinas', 'ChuoSeikiQT', 'PIGCS2', 'OxxiusCombiner', 'OpenCVgrabber', 'MP285', 'TriggerScopeMM', 'Utilities.la', 'ThorLabsSC10', 'CARVII', 'KDV', 'Xcite', 'Cobolt', 'Arduino', 'pgFocus', 'FreeSerialPort', 'K8055', 'Stradus', 'Vincent', 'ASIWPTR', 'Piezosystem_NV120_1', 'GPhoto', 'ESImagingIOControllers', 'nPoint', 'Piezosystem_dDrive', 'DemoCamera', 'ThorlabsFilterWheel', 'NewportSMC', 'LumencorSpectra', 'FakeCamera', 'LeicaDMSTC', 'MarzhauserLStepOld', 'HIDManager', 'OVP_ECS2', 'Prior', 'YodnE600', 'Diskovery', 'NNLC', 'CSUW1', 'VarispecLCTF', 'Aladdin', 'TriggerScope', 'FocalPoint', 'SutterStage', 'ZeissCAN', 'CSU22', 'Thorlabs_ELL14', 'NikonTE2000', 'AAAOTF', 'SouthPort', 'ThorlabsDCxxxx', 'Toptica_iBeamSmartCW', 'Skyra', 'CoherentScientificRemote', 'VersaLase', 'Arduino32bitBoards', 'RAMPS', 'dc1394', 'Polychrome5000', 'ZeissCAN29', 'UserDefinedSerial', 'DemoCamera.la', 'Oxxius', 'ASIFW1000', 'Utilities', 'Scientifica', 'WieneckeSinske', 'Conix', 'Neos', 'SutterLambda2', 'Piezosystem_30DV50', 'Omicron', 'Olympus', 'XCiteLed', 'IIDC', 'Ludl', 'Piezosystem_NV40_3', 'PrecisExcite', 'Marzhauser', 'NikonEclipse90i', 'Hydra', 'ASIStage', 'Sapphire', 'USBManager', 'Tofra', 'Pecon', 'Zaber', 'Corvus', 'PIGCS', 'K8061', 'MPBLaser'))\n", + "device_list = list(('LightSheetManager', 'ASITiger', 'LeicaDMR', 'XLightV3', 'HamiltonMVP', 'SutterLambda', 'LudlLow',\n", + " 'LeicaDMI', 'CoolLEDpE4000', 'CoherentOBIS', 'XLight', 'ImageProcessorChain', 'SutterMPC',\n", + " 'SerialManager', 'PIEZOCONCEPT', 'MicroPoint', 'CSUX', 'MaestroServo', 'CoherentCube',\n", + " 'LaserQuantumLaser', 'CoolLEDpE300', 'ThorLabs', 'VariLC', 'Nikon', 'SequenceTester',\n", + " 'SpectralLMM5', 'MicroFPGA', 'MoticUCam', 'MarzhauserLStep', 'IsmatecMCP', 'StarlightXpress', 'PI',\n", + " 'XCiteXT600', 'NewportCONEX', 'SutterLambdaParallelArduino', 'PriorLegacy', 'BlueboxOptics_niji',\n", + " 'XCite120PCExacte', 'ThorlabsElliptecSlider', 'ArduinoNeoPixel', 'ChuoSeikiMD5000', 'NikonAZ100',\n", + " 'SmarActHCU3D', 'Piezosystem_NV40_1', 'Aquinas', 'ChuoSeikiQT', 'PIGCS2', 'OxxiusCombiner',\n", + " 'OpenCVgrabber', 'MP285', 'TriggerScopeMM', 'Utilities.la', 'ThorLabsSC10', 'CARVII', 'KDV',\n", + " 'Xcite', 'Cobolt', 'Arduino', 'pgFocus', 'FreeSerialPort', 'K8055', 'Stradus', 'Vincent', 'ASIWPTR',\n", + " 'Piezosystem_NV120_1', 'GPhoto', 'ESImagingIOControllers', 'nPoint', 'Piezosystem_dDrive',\n", + " 'DemoCamera', 'ThorlabsFilterWheel', 'NewportSMC', 'LumencorSpectra', 'FakeCamera', 'LeicaDMSTC',\n", + " 'MarzhauserLStepOld', 'HIDManager', 'OVP_ECS2', 'Prior', 'YodnE600', 'Diskovery', 'NNLC', 'CSUW1',\n", + " 'VarispecLCTF', 'Aladdin', 'TriggerScope', 'FocalPoint', 'SutterStage', 'ZeissCAN', 'CSU22',\n", + " 'Thorlabs_ELL14', 'NikonTE2000', 'AAAOTF', 'SouthPort', 'ThorlabsDCxxxx', 'Toptica_iBeamSmartCW',\n", + " 'Skyra', 'CoherentScientificRemote', 'VersaLase', 'Arduino32bitBoards', 'RAMPS', 'dc1394',\n", + " 'Polychrome5000', 'ZeissCAN29', 'UserDefinedSerial', 'DemoCamera.la', 'Oxxius', 'ASIFW1000',\n", + " 'Utilities', 'Scientifica', 'WieneckeSinske', 'Conix', 'Neos', 'SutterLambda2',\n", + " 'Piezosystem_30DV50', 'Omicron', 'Olympus', 'XCiteLed', 'IIDC', 'Ludl', 'Piezosystem_NV40_3',\n", + " 'PrecisExcite', 'Marzhauser', 'NikonEclipse90i', 'Hydra', 'ASIStage', 'Sapphire', 'USBManager',\n", + " 'Tofra', 'Pecon', 'Zaber', 'Corvus', 'PIGCS', 'K8061', 'MPBLaser'))\n", "device_list" ], "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.088478Z", - "start_time": "2023-08-17T11:49:13.590376Z" + "end_time": "2023-09-15T14:52:06.534015Z", + "start_time": "2023-09-15T14:52:05.319547Z" } }, "id": "b9e3ed5c86f459a2" }, { "cell_type": "code", - "execution_count": 63, + "execution_count": 27, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "total 105288\r\n", - "drwxr-xr-x@ 153 admin 4896 Aug 7 17:24 \u001B[1m\u001B[36m.\u001B[m\u001B[m\r\n", - "drwxrwxr-x 36 admin 1152 Aug 16 11:29 \u001B[1m\u001B[36m..\u001B[m\u001B[m\r\n", - "-rw-r--r--@ 1 admin 6148 Aug 4 20:23 .DS_Store\r\n", + "drwxr-xr-x@ 153 admin 4896 Sep 13 14:24 \u001B[1m\u001B[36m.\u001B[m\u001B[m\r\n", + "drwxrwxr-x 38 admin 1216 Sep 15 15:33 \u001B[1m\u001B[36m..\u001B[m\u001B[m\r\n", + "-rw-r--r--@ 1 admin 6148 Sep 13 14:24 .DS_Store\r\n", "-rw-r--r-- 1 admin 462 Aug 4 08:11 IJ_Prefs.txt\r\n", "-rw-r--r--@ 1 admin 0 Nov 15 2009 Icon?\r\n", "drwxr-xr-x@ 3 admin 96 Aug 4 08:11 \u001B[1m\u001B[36mImageJ.app\u001B[m\u001B[m\r\n", @@ -871,26 +884,26 @@ } ], "source": [ - "! ls -lga '{micromanager_path}' " + "! ls -lga '{micromanager_path}'" ], "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.088609Z", - "start_time": "2023-08-17T11:49:13.592907Z" + "end_time": "2023-09-15T14:52:06.535069Z", + "start_time": "2023-09-15T14:52:05.322398Z" } }, "id": "e5ff699a3f9d9d09" }, { "cell_type": "code", - "execution_count": 64, + "execution_count": 28, "outputs": [ { "data": { "text/plain": "'/Applications/Micro-Managerlibmmgr_dal_ASIStage'" }, - "execution_count": 64, + "execution_count": 28, "metadata": {}, "output_type": "execute_result" } @@ -903,15 +916,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.088684Z", - "start_time": "2023-08-17T11:49:13.716190Z" + "end_time": "2023-09-15T14:52:06.535323Z", + "start_time": "2023-09-15T14:52:05.460052Z" } }, "id": "131654326058a108" }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 29, "outputs": [], "source": [ "device.load('DemoCamera', 'DCam')\n" @@ -919,15 +932,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:10:54.735565Z", - "start_time": "2023-09-15T09:10:54.716195Z" + "end_time": "2023-09-15T14:52:06.535441Z", + "start_time": "2023-09-15T14:52:05.463082Z" } }, "id": "b7d56d2ac5fa1e9c" }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 30, "outputs": [], "source": [ "device.unload()" @@ -935,15 +948,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:10:55.484139Z", - "start_time": "2023-09-15T09:10:55.466713Z" + "end_time": "2023-09-15T14:52:06.535568Z", + "start_time": "2023-09-15T14:52:05.465174Z" } }, "id": "44bdf47bec31f28e" }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 31, "outputs": [], "source": [ "device.load('DemoCamera', 'DCam')\n" @@ -951,21 +964,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:10:56.183633Z", - "start_time": "2023-09-15T09:10:56.165824Z" + "end_time": "2023-09-15T14:52:06.535709Z", + "start_time": "2023-09-15T14:52:05.467870Z" } }, "id": "890186e3e95f9875" }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 32, "outputs": [ { "data": { - "text/plain": "(,\n ,\n ,\n ,\n ,\n )" + "text/plain": "(,\n ,\n ,\n ,\n ,\n )" }, - "execution_count": 35, + "execution_count": 32, "metadata": {}, "output_type": "execute_result" } @@ -976,8 +989,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:10:57.529560Z", - "start_time": "2023-09-15T09:10:57.498348Z" + "end_time": "2023-09-15T14:52:06.535975Z", + "start_time": "2023-09-15T14:52:05.470057Z" } }, "id": "149caa3e057fe921" @@ -1010,7 +1023,7 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 33, "outputs": [], "source": [ "camera_device = Device('Camera', mmc)" @@ -1018,21 +1031,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:10:59.746601Z", - "start_time": "2023-09-15T09:10:59.721842Z" + "end_time": "2023-09-15T14:52:06.538477Z", + "start_time": "2023-09-15T14:52:05.473259Z" } }, "id": "45ddd8148f41b907" }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 34, "outputs": [ { "data": { - "text/plain": "(,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n )" + "text/plain": "(,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n )" }, - "execution_count": 37, + "execution_count": 34, "metadata": {}, "output_type": "execute_result" } @@ -1044,15 +1057,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:11:00.280695Z", - "start_time": "2023-09-15T09:11:00.260519Z" + "end_time": "2023-09-15T14:52:06.538921Z", + "start_time": "2023-09-15T14:52:05.475652Z" } }, "id": "3c14f3076b49b2f8" }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 35, "outputs": [], "source": [ "# camera_props.hasLimits()" @@ -1060,21 +1073,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:11:00.816039Z", - "start_time": "2023-09-15T09:11:00.799154Z" + "end_time": "2023-09-15T14:52:06.539055Z", + "start_time": "2023-09-15T14:52:05.479252Z" } }, "id": "f447c4a15741f10d" }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 36, "outputs": [ { "data": { "text/plain": "True" }, - "execution_count": 39, + "execution_count": 36, "metadata": {}, "output_type": "execute_result" } @@ -1085,15 +1098,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:11:01.399976Z", - "start_time": "2023-09-15T09:11:01.382646Z" + "end_time": "2023-09-15T14:52:06.539317Z", + "start_time": "2023-09-15T14:52:05.481565Z" } }, "id": "b931ba85a6681219" }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 37, "outputs": [ { "name": "stderr", @@ -1110,21 +1123,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:11:01.991110Z", - "start_time": "2023-09-15T09:11:01.974203Z" + "end_time": "2023-09-15T14:52:06.539551Z", + "start_time": "2023-09-15T14:52:05.484381Z" } }, "id": "ecea844baae82596" }, { "cell_type": "code", - "execution_count": 41, + "execution_count": 38, "outputs": [ { "data": { "text/plain": "True" }, - "execution_count": 41, + "execution_count": 38, "metadata": {}, "output_type": "execute_result" } @@ -1135,15 +1148,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:11:02.193659Z", - "start_time": "2023-09-15T09:11:02.176576Z" + "end_time": "2023-09-15T14:52:06.539794Z", + "start_time": "2023-09-15T14:52:05.487157Z" } }, "id": "a7031d29791f6d67" }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 39, "outputs": [], "source": [ "camera_device.initialize()" @@ -1151,21 +1164,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:11:02.368668Z", - "start_time": "2023-09-15T09:11:02.352146Z" + "end_time": "2023-09-15T14:52:06.539910Z", + "start_time": "2023-09-15T14:52:05.489824Z" } }, "id": "10a69dc6e76b8afe" }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 40, "outputs": [ { "data": { "text/plain": "True" }, - "execution_count": 43, + "execution_count": 40, "metadata": {}, "output_type": "execute_result" } @@ -1176,21 +1189,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:11:02.526124Z", - "start_time": "2023-09-15T09:11:02.509894Z" + "end_time": "2023-09-15T14:52:06.540142Z", + "start_time": "2023-09-15T14:52:05.492400Z" } }, "id": "c1d358eaf11f411b" }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 41, "outputs": [ { "data": { "text/plain": "False" }, - "execution_count": 44, + "execution_count": 41, "metadata": {}, "output_type": "execute_result" } @@ -1201,21 +1214,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:11:02.703792Z", - "start_time": "2023-09-15T09:11:02.687138Z" + "end_time": "2023-09-15T14:52:06.540403Z", + "start_time": "2023-09-15T14:52:05.495409Z" } }, "id": "699cb1d8426e7d47" }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 42, "outputs": [ { "data": { - "text/plain": "(,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n )" + "text/plain": "(,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n )" }, - "execution_count": 45, + "execution_count": 42, "metadata": {}, "output_type": "execute_result" } @@ -1226,21 +1239,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:11:03.386882Z", - "start_time": "2023-09-15T09:11:03.368357Z" + "end_time": "2023-09-15T14:52:06.540759Z", + "start_time": "2023-09-15T14:52:05.497936Z" } }, "id": "86243e58047181e5" }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 43, "outputs": [ { "data": { "text/plain": "{'title': 'DCam',\n 'description': 'Demo camera',\n 'type': 'object',\n 'properties': {'AllowMultiROI': {'type': 'boolean'},\n 'AsyncPropertyDelayMS': {'type': 'integer'},\n 'AsyncPropertyFollower': {'type': 'string', 'readOnly': True, 'default': ''},\n 'AsyncPropertyLeader': {'type': 'string'},\n 'Binning': {'type': 'integer', 'enum': [1, 2, 4, 8]},\n 'BitDepth': {'type': 'integer', 'enum': [10, 11, 12, 14, 16, 32, 8]},\n 'CCDTemperature': {'type': 'number', 'minimum': -100.0, 'maximum': 10.0},\n 'CCDTemperature RO': {'type': 'number', 'readOnly': True, 'default': 0.0},\n 'CameraID': {'type': 'string', 'readOnly': True, 'default': 'V1.0'},\n 'CameraName': {'type': 'string',\n 'readOnly': True,\n 'default': 'DemoCamera-MultiMode'},\n 'Description': {'type': 'string',\n 'readOnly': True,\n 'default': 'Demo Camera Device Adapter'},\n 'DisplayImageNumber': {'type': 'boolean'},\n 'DropPixels': {'type': 'boolean'},\n 'Exposure': {'type': 'number', 'minimum': 0.0, 'maximum': 10000.0},\n 'FastImage': {'type': 'boolean'},\n 'FractionOfPixelsToDropOrSaturate': {'type': 'number',\n 'minimum': 0.0,\n 'maximum': 0.1},\n 'Gain': {'type': 'integer', 'minimum': -5.0, 'maximum': 8.0},\n 'HubID': {'type': 'string', 'readOnly': True, 'default': ''},\n 'MaximumExposureMs': {'type': 'number', 'preInit': True},\n 'Mode': {'type': 'string',\n 'enum': ['Artificial Waves', 'Color Test Pattern', 'Noise']},\n 'MultiROIFillValue': {'type': 'integer', 'minimum': 0.0, 'maximum': 65536.0},\n 'Name': {'type': 'string', 'readOnly': True, 'default': 'DCam'},\n 'Offset': {'type': 'integer'},\n 'OnCameraCCDXSize': {'type': 'integer'},\n 'OnCameraCCDYSize': {'type': 'integer'},\n 'Photon Conversion Factor': {'type': 'number',\n 'minimum': 0.01,\n 'maximum': 10.0},\n 'Photon Flux': {'type': 'number', 'minimum': 2.0, 'maximum': 5000.0},\n 'PixelType': {'type': 'string',\n 'enum': ['16bit', '32bit', '32bitRGB', '64bitRGB', '8bit']},\n 'ReadNoise (electrons)': {'type': 'number',\n 'minimum': 0.25,\n 'maximum': 50.0},\n 'ReadoutTime': {'type': 'number'},\n 'RotateImages': {'type': 'boolean'},\n 'SaturatePixels': {'type': 'boolean'},\n 'ScanMode': {'type': 'integer', 'enum': [1, 2, 3]},\n 'SimulateCrash': {'type': 'string',\n 'enum': ['', 'Dereference Null Pointer', 'Divide by Zero']},\n 'StripeWidth': {'type': 'number', 'minimum': 0.0, 'maximum': 10.0},\n 'TestProperty1': {'type': 'number', 'minimum': -0.1, 'maximum': 0.1},\n 'TestProperty2': {'type': 'number', 'minimum': -200.0, 'maximum': 200.0},\n 'TestProperty3': {'type': 'number', 'minimum': 0.0, 'maximum': 0.003},\n 'TestProperty4': {'type': 'number', 'minimum': -40000.0, 'maximum': 40000.0},\n 'TestProperty5': {'type': 'number'},\n 'TestProperty6': {'type': 'number', 'minimum': 0.0, 'maximum': 6000000.0},\n 'TransposeCorrection': {'type': 'boolean'},\n 'TransposeMirrorX': {'type': 'boolean'},\n 'TransposeMirrorY': {'type': 'boolean'},\n 'TransposeXY': {'type': 'boolean'},\n 'TriggerDevice': {'type': 'string'},\n 'UseExposureSequences': {'type': 'string', 'enum': ['No', 'Yes']}}}" }, - "execution_count": 46, + "execution_count": 43, "metadata": {}, "output_type": "execute_result" } @@ -1251,21 +1264,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:11:04.431722Z", - "start_time": "2023-09-15T09:11:04.411817Z" + "end_time": "2023-09-15T14:52:06.541101Z", + "start_time": "2023-09-15T14:52:05.501555Z" } }, "id": "f2ecca8d84b6c54d" }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 44, "outputs": [ { "data": { - "text/plain": "" + "text/plain": "" }, - "execution_count": 47, + "execution_count": 44, "metadata": {}, "output_type": "execute_result" } @@ -1277,21 +1290,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:11:27.450508Z", - "start_time": "2023-09-15T09:11:27.430730Z" + "end_time": "2023-09-15T14:52:06.541336Z", + "start_time": "2023-09-15T14:52:05.507098Z" } }, "id": "22a53df9f31735c0" }, { "cell_type": "code", - "execution_count": 48, + "execution_count": 45, "outputs": [ { "data": { "text/plain": "False" }, - "execution_count": 48, + "execution_count": 45, "metadata": {}, "output_type": "execute_result" } @@ -1302,21 +1315,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:11:28.636709Z", - "start_time": "2023-09-15T09:11:28.619037Z" + "end_time": "2023-09-15T14:52:06.541558Z", + "start_time": "2023-09-15T14:52:05.510243Z" } }, "id": "25af53a41eea593" }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 46, "outputs": [ { "data": { - "text/plain": ">" + "text/plain": ">" }, - "execution_count": 49, + "execution_count": 46, "metadata": {}, "output_type": "execute_result" } @@ -1327,21 +1340,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:11:32.087651Z", - "start_time": "2023-09-15T09:11:32.062437Z" + "end_time": "2023-09-15T14:52:06.541832Z", + "start_time": "2023-09-15T14:52:05.513072Z" } }, "id": "70ad7c58d44dfe5a" }, { "cell_type": "code", - "execution_count": 50, + "execution_count": 47, "outputs": [ { "data": { "text/plain": "'Demo camera'" }, - "execution_count": 50, + "execution_count": 47, "metadata": {}, "output_type": "execute_result" } @@ -1352,21 +1365,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:11:34.335016Z", - "start_time": "2023-09-15T09:11:34.315381Z" + "end_time": "2023-09-15T14:52:06.542112Z", + "start_time": "2023-09-15T14:52:05.516412Z" } }, "id": "6045e0c3b4f1919e" }, { "cell_type": "code", - "execution_count": 51, + "execution_count": 48, "outputs": [ { "data": { "text/plain": "'Camera'" }, - "execution_count": 51, + "execution_count": 48, "metadata": {}, "output_type": "execute_result" } @@ -1377,21 +1390,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:11:34.973479Z", - "start_time": "2023-09-15T09:11:34.955450Z" + "end_time": "2023-09-15T14:52:06.542345Z", + "start_time": "2023-09-15T14:52:05.519424Z" } }, "id": "302ed27c95db1a0f" }, { "cell_type": "code", - "execution_count": 52, + "execution_count": 49, "outputs": [ { "data": { "text/plain": "{'valid': True,\n 'value': '',\n 'type': 'string',\n 'device_type': 'CameraDevice',\n 'read_only': False,\n 'sequenceable': False,\n 'sequence_max_length': None,\n 'pre_init': False,\n 'range': None,\n 'allowed_values': ()}" }, - "execution_count": 52, + "execution_count": 49, "metadata": {}, "output_type": "execute_result" } @@ -1402,21 +1415,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:11:40.296086Z", - "start_time": "2023-09-15T09:11:40.276501Z" + "end_time": "2023-09-15T14:52:06.542606Z", + "start_time": "2023-09-15T14:52:05.521678Z" } }, "id": "9cd0c3ad934ab9d2" }, { "cell_type": "code", - "execution_count": 53, + "execution_count": 50, "outputs": [ { "data": { "text/plain": "{'valid': True,\n 'value': 'Artificial Waves',\n 'type': 'string',\n 'device_type': 'CameraDevice',\n 'read_only': False,\n 'sequenceable': False,\n 'sequence_max_length': None,\n 'pre_init': False,\n 'range': None,\n 'allowed_values': ('Artificial Waves', 'Color Test Pattern', 'Noise')}" }, - "execution_count": 53, + "execution_count": 50, "metadata": {}, "output_type": "execute_result" } @@ -1427,21 +1440,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:11:41.848538Z", - "start_time": "2023-09-15T09:11:41.829964Z" + "end_time": "2023-09-15T14:52:06.543025Z", + "start_time": "2023-09-15T14:52:05.524678Z" } }, "id": "31e4f673864666fa" }, { "cell_type": "code", - "execution_count": 54, + "execution_count": 51, "outputs": [ { "data": { "text/plain": "{'valid': True,\n 'value': 0.0,\n 'type': 'number',\n 'device_type': 'CameraDevice',\n 'read_only': False,\n 'sequenceable': False,\n 'sequence_max_length': None,\n 'pre_init': False,\n 'range': (-0.1, 0.1),\n 'allowed_values': ()}" }, - "execution_count": 54, + "execution_count": 51, "metadata": {}, "output_type": "execute_result" } @@ -1452,21 +1465,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:11:42.807466Z", - "start_time": "2023-09-15T09:11:42.789939Z" + "end_time": "2023-09-15T14:52:06.543308Z", + "start_time": "2023-09-15T14:52:05.528593Z" } }, "id": "4544054ba5ae3ddc" }, { "cell_type": "code", - "execution_count": 55, + "execution_count": 52, "outputs": [ { "data": { "text/plain": "" }, - "execution_count": 55, + "execution_count": 52, "metadata": {}, "output_type": "execute_result" } @@ -1477,21 +1490,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:11:44.650878Z", - "start_time": "2023-09-15T09:11:44.633896Z" + "end_time": "2023-09-15T14:52:06.543591Z", + "start_time": "2023-09-15T14:52:05.531619Z" } }, "id": "90acd36aa3d225cc" }, { "cell_type": "code", - "execution_count": 56, + "execution_count": 53, "outputs": [ { "data": { "text/plain": "" }, - "execution_count": 56, + "execution_count": 53, "metadata": {}, "output_type": "execute_result" } @@ -1502,21 +1515,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:11:45.351813Z", - "start_time": "2023-09-15T09:11:45.333229Z" + "end_time": "2023-09-15T14:52:06.543840Z", + "start_time": "2023-09-15T14:52:05.534580Z" } }, "id": "bd00c76e673bcb23" }, { "cell_type": "code", - "execution_count": 57, + "execution_count": 54, "outputs": [ { "data": { "text/plain": "" }, - "execution_count": 57, + "execution_count": 54, "metadata": {}, "output_type": "execute_result" } @@ -1527,21 +1540,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:11:47.972094Z", - "start_time": "2023-09-15T09:11:47.947160Z" + "end_time": "2023-09-15T14:52:06.544536Z", + "start_time": "2023-09-15T14:52:05.537506Z" } }, "id": "ef70b4cd04cfbf46" }, { "cell_type": "code", - "execution_count": 58, + "execution_count": 55, "outputs": [ { "data": { "text/plain": "{'AllowMultiROI': '0',\n 'AsyncPropertyDelayMS': '2000',\n 'AsyncPropertyFollower': '',\n 'AsyncPropertyLeader': '',\n 'Binning': '1',\n 'BitDepth': '16',\n 'CCDTemperature': '0.0000',\n 'CCDTemperature RO': '0.0000',\n 'CameraID': 'V1.0',\n 'CameraName': 'DemoCamera-MultiMode',\n 'Description': 'Demo Camera Device Adapter',\n 'DisplayImageNumber': '0',\n 'DropPixels': '0',\n 'Exposure': '10.0000',\n 'FastImage': '0',\n 'FractionOfPixelsToDropOrSaturate': '0.0020',\n 'Gain': '0',\n 'HubID': '',\n 'MaximumExposureMs': '10000.0000',\n 'Mode': 'Artificial Waves',\n 'MultiROIFillValue': '0',\n 'Name': 'DCam',\n 'Offset': '0',\n 'OnCameraCCDXSize': '512',\n 'OnCameraCCDYSize': '512',\n 'Photon Conversion Factor': '1.0000',\n 'Photon Flux': '50.0000',\n 'PixelType': '16bit',\n 'ReadNoise (electrons)': '2.5000',\n 'ReadoutTime': '0.0000',\n 'RotateImages': '0',\n 'SaturatePixels': '0',\n 'ScanMode': '1',\n 'SimulateCrash': '',\n 'StripeWidth': '1.0000',\n 'TestProperty1': '0.0000',\n 'TestProperty2': '0.0000',\n 'TestProperty3': '0.0000',\n 'TestProperty4': '0.0000',\n 'TestProperty5': '0.0000',\n 'TestProperty6': '0.0000',\n 'TransposeCorrection': '0',\n 'TransposeMirrorX': '0',\n 'TransposeMirrorY': '0',\n 'TransposeXY': '0',\n 'TriggerDevice': '',\n 'UseExposureSequences': 'No'}" }, - "execution_count": 58, + "execution_count": 55, "metadata": {}, "output_type": "execute_result" } @@ -1552,21 +1565,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:11:50.153708Z", - "start_time": "2023-09-15T09:11:50.127929Z" + "end_time": "2023-09-15T14:52:06.544852Z", + "start_time": "2023-09-15T14:52:05.540447Z" } }, "id": "9c7893c1fd5b86af" }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 56, "outputs": [ { "data": { - "text/plain": "" + "text/plain": "" }, - "execution_count": 59, + "execution_count": 56, "metadata": {}, "output_type": "execute_result" } @@ -1577,21 +1590,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:11:52.876672Z", - "start_time": "2023-09-15T09:11:52.856468Z" + "end_time": "2023-09-15T14:52:06.545191Z", + "start_time": "2023-09-15T14:52:05.545284Z" } }, "id": "74a0da3eb1a2a6ac" }, { "cell_type": "code", - "execution_count": 60, + "execution_count": 57, "outputs": [ { "data": { "text/plain": "('Camera', 'Stage')" }, - "execution_count": 60, + "execution_count": 57, "metadata": {}, "output_type": "execute_result" } @@ -1602,15 +1615,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:11:56.702730Z", - "start_time": "2023-09-15T09:11:56.684894Z" + "end_time": "2023-09-15T14:52:06.545437Z", + "start_time": "2023-09-15T14:52:05.548256Z" } }, "id": "ea5b4c5d7afd1f68" }, { "cell_type": "code", - "execution_count": 61, + "execution_count": 58, "outputs": [], "source": [ "# DeviceProperty('Camera',)" @@ -1618,21 +1631,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:11:59.106092Z", - "start_time": "2023-09-15T09:11:59.085230Z" + "end_time": "2023-09-15T14:52:06.545543Z", + "start_time": "2023-09-15T14:52:05.550440Z" } }, "id": "7b0488e677f88af1" }, { "cell_type": "code", - "execution_count": 62, + "execution_count": 59, "outputs": [ { "data": { "text/plain": "'Camera'" }, - "execution_count": 62, + "execution_count": 59, "metadata": {}, "output_type": "execute_result" } @@ -1643,15 +1656,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:12:00.211328Z", - "start_time": "2023-09-15T09:12:00.193061Z" + "end_time": "2023-09-15T14:52:06.545760Z", + "start_time": "2023-09-15T14:52:05.552955Z" } }, "id": "3bff169e5fe7e900" }, { "cell_type": "code", - "execution_count": 63, + "execution_count": 60, "outputs": [], "source": [ "camera_device = Device(mmc.getCameraDevice(), mmc)" @@ -1659,21 +1672,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:12:00.938581Z", - "start_time": "2023-09-15T09:12:00.920934Z" + "end_time": "2023-09-15T14:52:06.545887Z", + "start_time": "2023-09-15T14:52:05.555946Z" } }, "id": "55025f655d7db8ae" }, { "cell_type": "code", - "execution_count": 64, + "execution_count": 61, "outputs": [ { "data": { - "text/plain": "" + "text/plain": "" }, - "execution_count": 64, + "execution_count": 61, "metadata": {}, "output_type": "execute_result" } @@ -1684,15 +1697,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:12:01.416277Z", - "start_time": "2023-09-15T09:12:01.398245Z" + "end_time": "2023-09-15T14:52:06.546114Z", + "start_time": "2023-09-15T14:52:05.558527Z" } }, "id": "f71c54d23462bf" }, { "cell_type": "code", - "execution_count": 65, + "execution_count": 62, "outputs": [ { "name": "stdout", @@ -1939,21 +1952,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:12:04.010345Z", - "start_time": "2023-09-15T09:12:03.991529Z" + "end_time": "2023-09-15T14:52:06.546816Z", + "start_time": "2023-09-15T14:52:05.561679Z" } }, "id": "fad00fea11de84bf" }, { "cell_type": "code", - "execution_count": 99, + "execution_count": 63, "outputs": [ { "data": { "text/plain": "'Demo camera'" }, - "execution_count": 99, + "execution_count": 63, "metadata": {}, "output_type": "execute_result" } @@ -1964,21 +1977,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.091749Z", - "start_time": "2023-08-17T11:49:13.800591Z" + "end_time": "2023-09-15T14:52:06.547059Z", + "start_time": "2023-09-15T14:52:05.565473Z" } }, "id": "2d11576aabbc54" }, { "cell_type": "code", - "execution_count": 100, + "execution_count": 64, "outputs": [ { "data": { - "text/plain": "(,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n )" + "text/plain": "(,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n )" }, - "execution_count": 100, + "execution_count": 64, "metadata": {}, "output_type": "execute_result" } @@ -1989,21 +2002,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.091890Z", - "start_time": "2023-08-17T11:49:13.802779Z" + "end_time": "2023-09-15T14:52:06.547410Z", + "start_time": "2023-09-15T14:52:05.567834Z" } }, "id": "faa97b1adfd964cd" }, { "cell_type": "code", - "execution_count": 101, + "execution_count": 65, "outputs": [ { "data": { "text/plain": "512" }, - "execution_count": 101, + "execution_count": 65, "metadata": {}, "output_type": "execute_result" } @@ -2014,21 +2027,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.101370Z", - "start_time": "2023-08-17T11:49:13.805256Z" + "end_time": "2023-09-15T14:52:06.547634Z", + "start_time": "2023-09-15T14:52:05.572996Z" } }, "id": "5ae872c3ee21197c" }, { "cell_type": "code", - "execution_count": 102, + "execution_count": 66, "outputs": [ { "data": { "text/plain": "False" }, - "execution_count": 102, + "execution_count": 66, "metadata": {}, "output_type": "execute_result" } @@ -2039,21 +2052,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.101510Z", - "start_time": "2023-08-17T11:49:13.807880Z" + "end_time": "2023-09-15T14:52:06.547847Z", + "start_time": "2023-09-15T14:52:05.576001Z" } }, "id": "5e0acd96a5a818b6" }, { "cell_type": "code", - "execution_count": 103, + "execution_count": 67, "outputs": [ { "data": { "text/plain": "0.0" }, - "execution_count": 103, + "execution_count": 67, "metadata": {}, "output_type": "execute_result" } @@ -2064,21 +2077,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.101617Z", - "start_time": "2023-08-17T11:49:13.809792Z" + "end_time": "2023-09-15T14:52:06.548069Z", + "start_time": "2023-09-15T14:52:05.578888Z" } }, "id": "52e45a974b1348d4" }, { "cell_type": "code", - "execution_count": 104, + "execution_count": 68, "outputs": [ { "data": { "text/plain": "()" }, - "execution_count": 104, + "execution_count": 68, "metadata": {}, "output_type": "execute_result" } @@ -2089,21 +2102,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:49:14.101695Z", - "start_time": "2023-08-17T11:49:13.811828Z" + "end_time": "2023-09-15T14:52:06.548306Z", + "start_time": "2023-09-15T14:52:05.581908Z" } }, "id": "58660a8306ebd959" }, { "cell_type": "code", - "execution_count": 114, + "execution_count": 69, "outputs": [ { "data": { "text/plain": "1.0" }, - "execution_count": 114, + "execution_count": 69, "metadata": {}, "output_type": "execute_result" } @@ -2114,8 +2127,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-17T11:53:32.942446Z", - "start_time": "2023-08-17T11:53:32.928889Z" + "end_time": "2023-09-15T14:52:06.548552Z", + "start_time": "2023-09-15T14:52:05.585136Z" } }, "id": "bb4191f3a438d45" @@ -2134,8 +2147,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:13:19.095921Z", - "start_time": "2023-09-15T09:13:19.078129Z" + "end_time": "2023-09-15T14:52:06.548647Z", + "start_time": "2023-09-15T14:52:05.588065Z" } }, "id": "de3df31a8bbd37e8" @@ -2146,7 +2159,7 @@ "outputs": [ { "data": { - "text/plain": "2" + "text/plain": "0" }, "execution_count": 71, "metadata": {}, @@ -2159,8 +2172,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:13:19.496034Z", - "start_time": "2023-09-15T09:13:19.475559Z" + "end_time": "2023-09-15T14:52:06.548857Z", + "start_time": "2023-09-15T14:52:05.591100Z" } }, "id": "ad51eb7303a7df62" @@ -2179,8 +2192,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:13:22.004335Z", - "start_time": "2023-09-15T09:13:21.978732Z" + "end_time": "2023-09-15T14:52:06.548954Z", + "start_time": "2023-09-15T14:52:05.594848Z" } }, "id": "dd61fe65bdac5d5a" @@ -2204,8 +2217,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:13:22.478365Z", - "start_time": "2023-09-15T09:13:22.455871Z" + "end_time": "2023-09-15T14:52:06.549218Z", + "start_time": "2023-09-15T14:52:05.597656Z" } }, "id": "36c00b27c00029eb" @@ -2224,8 +2237,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:13:23.236234Z", - "start_time": "2023-09-15T09:13:23.216181Z" + "end_time": "2023-09-15T14:52:06.549414Z", + "start_time": "2023-09-15T14:52:05.600771Z" } }, "id": "5fb5c85b4d7f6cef" @@ -2240,8 +2253,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:13:23.896621Z", - "start_time": "2023-09-15T09:13:23.879496Z" + "end_time": "2023-09-15T14:52:06.549535Z", + "start_time": "2023-09-15T14:52:05.602980Z" } }, "id": "84287fed4c005b37" @@ -2265,8 +2278,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:13:24.435995Z", - "start_time": "2023-09-15T09:13:24.418726Z" + "end_time": "2023-09-15T14:52:06.549803Z", + "start_time": "2023-09-15T14:52:05.605873Z" } }, "id": "684e6960676667df" @@ -2290,8 +2303,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:13:24.936497Z", - "start_time": "2023-09-15T09:13:24.918Z" + "end_time": "2023-09-15T14:52:06.551340Z", + "start_time": "2023-09-15T14:52:05.614508Z" } }, "id": "bda1f6bd0f9a1ad2" @@ -2306,8 +2319,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:13:25.764464Z", - "start_time": "2023-09-15T09:13:25.746894Z" + "end_time": "2023-09-15T14:52:06.555327Z", + "start_time": "2023-09-15T14:52:05.614741Z" } }, "id": "42f86413ad2ded10" @@ -2331,8 +2344,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:13:26.914876Z", - "start_time": "2023-09-15T09:13:26.896589Z" + "end_time": "2023-09-15T14:52:06.555645Z", + "start_time": "2023-09-15T14:52:05.614820Z" } }, "id": "9b4fd804edc9583e" @@ -2340,15 +2353,24 @@ { "cell_type": "code", "execution_count": 81, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": "False" + }, + "execution_count": 81, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "camera_device." + "camera_device.isBusy()" ], "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:13:35.085470Z", - "start_time": "2023-09-15T09:13:35.067475Z" + "end_time": "2023-09-15T14:52:13.284290Z", + "start_time": "2023-09-15T14:52:13.257114Z" } }, "id": "55f5f90aa35b07fe" @@ -2358,15 +2380,12 @@ "execution_count": 82, "outputs": [ { - "ename": "NameError", - "evalue": "name 'asi_stage_adapter' is not defined", - "output_type": "error", - "traceback": [ - "\u001B[0;31m---------------------------------------------------------------------------\u001B[0m", - "\u001B[0;31mNameError\u001B[0m Traceback (most recent call last)", - "Cell \u001B[0;32mIn[82], line 1\u001B[0m\n\u001B[0;32m----> 1\u001B[0m \u001B[43masi_stage_adapter\u001B[49m\n", - "\u001B[0;31mNameError\u001B[0m: name 'asi_stage_adapter' is not defined" - ] + "data": { + "text/plain": "'/Applications/Micro-Managerlibmmgr_dal_ASIStage'" + }, + "execution_count": 82, + "metadata": {}, + "output_type": "execute_result" } ], "source": [ @@ -2375,8 +2394,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:13:36.163202Z", - "start_time": "2023-09-15T09:13:36.141549Z" + "end_time": "2023-09-15T14:52:16.737846Z", + "start_time": "2023-09-15T14:52:16.707215Z" } }, "id": "423f2869ab4006e4" @@ -2391,8 +2410,8 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:13:36.982618Z", - "start_time": "2023-09-15T09:13:36.962158Z" + "end_time": "2023-09-15T14:52:17.689026Z", + "start_time": "2023-09-15T14:52:17.664559Z" } }, "id": "a9ed7469c07a4067" @@ -2403,7 +2422,7 @@ "outputs": [ { "data": { - "text/plain": "(,\n ,\n ,\n ,\n )" + "text/plain": "(,\n ,\n ,\n ,\n )" }, "execution_count": 84, "metadata": {}, @@ -2416,54 +2435,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:13:37.507853Z", - "start_time": "2023-09-15T09:13:37.490744Z" + "end_time": "2023-09-15T14:52:19.312869Z", + "start_time": "2023-09-15T14:52:19.283643Z" } }, "id": "a9802baaf9783234" }, { "cell_type": "code", - "execution_count": 85, - "outputs": [ - { - "data": { - "text/plain": "'DXYStage'" - }, - "execution_count": 85, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "stage_device.name()" - ], - "metadata": { - "collapsed": false, - "ExecuteTime": { - "end_time": "2023-09-15T09:13:37.713021Z", - "start_time": "2023-09-15T09:13:37.694489Z" - } - }, - "id": "5ac5e9941efc81b9" - }, - { - "cell_type": "code", - "execution_count": 85, - "outputs": [], - "source": [], - "metadata": { - "collapsed": false, - "ExecuteTime": { - "end_time": "2023-09-15T09:13:38.055262Z", - "start_time": "2023-09-15T09:13:38.036841Z" - } - }, - "id": "8eb54bb7594b2701" - }, - { - "cell_type": "code", - "execution_count": 86, + "execution_count": 90, "outputs": [ { "name": "stdout", @@ -2506,21 +2486,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:13:38.702964Z", - "start_time": "2023-09-15T09:13:38.686432Z" + "end_time": "2023-09-15T14:53:14.428841Z", + "start_time": "2023-09-15T14:53:14.405998Z" } }, "id": "f1311bca201d635b" }, { "cell_type": "code", - "execution_count": 87, + "execution_count": 91, "outputs": [ { "data": { "text/plain": "0.0" }, - "execution_count": 87, + "execution_count": 91, "metadata": {}, "output_type": "execute_result" } @@ -2531,15 +2511,15 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:13:39.528510Z", - "start_time": "2023-09-15T09:13:39.506439Z" + "end_time": "2023-09-15T14:53:15.184100Z", + "start_time": "2023-09-15T14:53:15.161790Z" } }, "id": "57aa776adf116a70" }, { "cell_type": "code", - "execution_count": 88, + "execution_count": 92, "outputs": [], "source": [ "mmc.setZPosition(2)" @@ -2547,21 +2527,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:13:39.712800Z", - "start_time": "2023-09-15T09:13:39.695972Z" + "end_time": "2023-09-15T14:53:15.859121Z", + "start_time": "2023-09-15T14:53:15.832082Z" } }, "id": "b46e4cd75ca62035" }, { "cell_type": "code", - "execution_count": 89, + "execution_count": 93, "outputs": [ { "data": { "text/plain": "2.0" }, - "execution_count": 89, + "execution_count": 93, "metadata": {}, "output_type": "execute_result" } @@ -2572,21 +2552,21 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:13:39.869831Z", - "start_time": "2023-09-15T09:13:39.853120Z" + "end_time": "2023-09-15T14:53:16.362310Z", + "start_time": "2023-09-15T14:53:16.339571Z" } }, "id": "63e00ac6afbe07bf" }, { "cell_type": "code", - "execution_count": 90, + "execution_count": 94, "outputs": [ { "data": { "text/plain": "('HubID',\n 'MaximumExposureMs',\n 'TransposeCorrection',\n 'TransposeMirrorX',\n 'TransposeMirrorY',\n 'TransposeXY')" }, - "execution_count": 90, + "execution_count": 94, "metadata": {}, "output_type": "execute_result" } @@ -2597,71 +2577,71 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:13:40.056333Z", - "start_time": "2023-09-15T09:13:40.032124Z" + "end_time": "2023-09-15T14:53:17.057950Z", + "start_time": "2023-09-15T14:53:17.035212Z" } }, "id": "c685f737fa355047" }, { "cell_type": "code", - "execution_count": 91, + "execution_count": 95, "outputs": [ { "data": { - "text/plain": "" + "text/plain": "" }, - "execution_count": 91, + "execution_count": 95, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "mmc.getPropertyObject(\"XY\",'Description')" + "mmc.getPropertyObject(\"XY\", 'Description')" ], "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:13:40.208717Z", - "start_time": "2023-09-15T09:13:40.191194Z" + "end_time": "2023-09-15T14:53:18.309815Z", + "start_time": "2023-09-15T14:53:18.284241Z" } }, "id": "cbb2822500cd7007" }, { "cell_type": "code", - "execution_count": 92, + "execution_count": 96, "outputs": [ { "data": { "text/plain": "0.0" }, - "execution_count": 92, + "execution_count": 96, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "mmc.getPropertyUpperLimit('Stage','MaximumExposureMs')" + "mmc.getPropertyUpperLimit('Stage', 'MaximumExposureMs')" ], "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:13:40.366043Z", - "start_time": "2023-09-15T09:13:40.348978Z" + "end_time": "2023-09-15T14:53:18.990244Z", + "start_time": "2023-09-15T14:53:18.969697Z" } }, "id": "8af142d0f73e55c2" }, { "cell_type": "code", - "execution_count": 186, + "execution_count": 97, "outputs": [ { "data": { "text/plain": "('DHub',\n 'Camera',\n 'Dichroic',\n 'Emission',\n 'Excitation',\n 'Objective',\n 'Z',\n 'Path',\n 'XY',\n 'White Light Shutter',\n 'Autofocus',\n 'LED',\n 'LED Shutter',\n 'Stage',\n 'Core')" }, - "execution_count": 186, + "execution_count": 97, "metadata": {}, "output_type": "execute_result" } @@ -2672,39 +2652,27 @@ "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-08-18T17:01:41.845048Z", - "start_time": "2023-08-18T17:01:41.826559Z" + "end_time": "2023-09-15T14:53:19.599208Z", + "start_time": "2023-09-15T14:53:19.578751Z" } }, "id": "cc21ccd465163eda" }, { "cell_type": "code", - "execution_count": 94, - "outputs": [ - { - "ename": "TypeError", - "evalue": "in method 'CMMCore_getPropertyLowerLimit', argument 3 of type 'char const *'", - "output_type": "error", - "traceback": [ - "\u001B[0;31m---------------------------------------------------------------------------\u001B[0m", - "\u001B[0;31mTypeError\u001B[0m Traceback (most recent call last)", - "Cell \u001B[0;32mIn[94], line 1\u001B[0m\n\u001B[0;32m----> 1\u001B[0m \u001B[43mmmc\u001B[49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43mgetPropertyLowerLimit\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;124;43m'\u001B[39;49m\u001B[38;5;124;43mStage\u001B[39;49m\u001B[38;5;124;43m'\u001B[39;49m\u001B[43m,\u001B[49m\u001B[43mmmc\u001B[49m\u001B[43m)\u001B[49m\n", - "\u001B[0;31mTypeError\u001B[0m: in method 'CMMCore_getPropertyLowerLimit', argument 3 of type 'char const *'" - ] - } - ], + "execution_count": 99, + "outputs": [], "source": [ - "mmc.getPropertyLowerLimit('Stage',)" + "mmc.setXYPosition(1, 2)" ], "metadata": { "collapsed": false, "ExecuteTime": { - "end_time": "2023-09-15T09:14:15.554779Z", - "start_time": "2023-09-15T09:14:15.536054Z" + "end_time": "2023-09-15T14:54:53.127082Z", + "start_time": "2023-09-15T14:54:53.069064Z" } }, - "id": "a7442dc420009ca3" + "id": "f5f2751451feee4f" }, { "cell_type": "code", @@ -2714,7 +2682,7 @@ "metadata": { "collapsed": false }, - "id": "c86520952438b92b" + "id": "a7882ecbb71229f1" } ], "metadata": { From 174135a2567fa64e4d419a2351cc2d23c340a99e Mon Sep 17 00:00:00 2001 From: thawn Date: Fri, 15 Sep 2023 17:23:15 +0200 Subject: [PATCH 15/16] added todo --- microscope_gym/microscope_adapters/micromanager.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/microscope_gym/microscope_adapters/micromanager.py b/microscope_gym/microscope_adapters/micromanager.py index f92a914..ab19cd0 100644 --- a/microscope_gym/microscope_adapters/micromanager.py +++ b/microscope_gym/microscope_adapters/micromanager.py @@ -200,3 +200,6 @@ def setProperty(self, self._settings.gain = settings.gain return + + +# TODO: add Microscope class where we can override the abstract methods and the z-stack and tiling methods (to make them more efficient) \ No newline at end of file From 15fc82f8d10cfe472d02d2858a78e17c89a57b0f Mon Sep 17 00:00:00 2001 From: Jamie White Date: Fri, 15 Sep 2023 18:53:17 +0200 Subject: [PATCH 16/16] add StageLimits data class will be used as a data model to store and load stage limits in a config file the config file could be called microscope_gym.json and stored next to the micromanager config file --- microscope_gym/microscope_adapters/micromanager.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/microscope_gym/microscope_adapters/micromanager.py b/microscope_gym/microscope_adapters/micromanager.py index ab19cd0..780a945 100644 --- a/microscope_gym/microscope_adapters/micromanager.py +++ b/microscope_gym/microscope_adapters/micromanager.py @@ -15,6 +15,16 @@ from microscope_gym import interface from microscope_gym.interface import Objective, Microscope, Axis, Camera, CameraSettings from typing import Tuple +from pydantic import BaseModel + + +class StageLimits(BaseModel): + z_min: float + z_max: float + y_min: float + y_max: float + x_min: float + x_max: float class Stage(interface.Stage):