diff --git a/docs/source/development.rst b/docs/source/development.rst index 8ef1c0a..bf1c5aa 100644 --- a/docs/source/development.rst +++ b/docs/source/development.rst @@ -16,7 +16,7 @@ To download the source code, including tests and examples, clone the repository The examples are located in the ``examples`` directory. Note that a lot of functionality is also demonstrated in the automatic tests located in the ``tests`` directory. As an alternative to downloading the source code, the samples can also be copied directly from the example gallery on the documentation website :cite:`readthedocsOpenWFS`. -By default, this only installs the dependencies for the basic OpenWFS package. To install the dependencies for the other components (the OpenGL, genicam or nidaq), use ``poetry -E opengl -E genicam -E nidaq install`` or ``poetry -E all`. +By default, this only installs the dependencies for the basic OpenWFS package. To install the dependencies for the other components (the OpenGL, genicam or nidaq), use ``poetry -E opengl -E genicam -E nidaq install`` or ``poetry -E all``. Building the documentation -------------------------------------------------- @@ -79,7 +79,7 @@ To implement an actuator, the user should subclass the :class:`~Actuator` base c Implementing new algorithms -------------------------------------------------- The algorithms that are included in OpenWFS are wrapped in classes with two common attribute: ``slm``, ``feedback``, which respectively hold a :class:`~.PhaseSLM` object to control the SLM and a :class:`~Detector` object that returns the feedback signals used in the optimization. For algorithms that support optimizing multiple targets simulaneously, the ``feedback`` detector may return an array of values. -In addition, all algorithms have an ``execute()`` method that executes the algoritm and returns the measured transmission matrix, along with statistics about the measurements in a :class:`WFSResults` structure (see :numref:`section-troubleshooting). +In addition, all algorithms have an ``execute()`` method that executes the algoritm and returns the measured transmission matrix, along with statistics about the measurements in a :class:`WFSResults` structure (see :numref:`section-troubleshooting`). When implementing a new algorithm, it is perfectly acceptable to deviate from this convention. However, if an algorithm follows the convention described above, it can directly be wrapped in a `WFSController` so that it can be used in Micro-Manager (see :numref:`section-micromanager`) As can be seen in the example in :numref:`hello-wfs`, OpenWFS abstracts all hardware interactions in the calls to ``slm.set_phases`` and ``feedback.trigger``. diff --git a/docs/source/micromanager.rst b/docs/source/micromanager.rst index 7d5e169..e4190e8 100644 --- a/docs/source/micromanager.rst +++ b/docs/source/micromanager.rst @@ -6,7 +6,7 @@ OpenWFS in Micro-Manager To smoothly enable end-user interaction with wavefront shaping algorithms, the Micro-Manager device adapter PyDevice was developed :cite:`PyDevice`. Micro-Manager is a widely-used open-source microscopy control software package. In essence, PyDevice is a Micro-Manager adapter that imports objects from a Python script and integrates them as devices, e.g. a camera or stage. OpenWFS was written in compliance with the templates required for PyDevice, which means OpenWFS cameras, scanners and algorithms can be loaded into Micro-Manager as devices. Examples of this are found in the example gallery :cite:`readthedocsOpenWFS`, and a more detailed description of PyDevice can be found in the mmCoreAndDevices source tree :cite:`mmCoreAndDevices`. Simulated microscope in Micro-Manager ------------- +---------------------------------------------------- An example of this integration can be found in :class:`micro_manager_microscope.py`. In this file, a simulated microscope is set up using the tools in :class:`openwfs.simulation`. In order to expose this to PyDevice, a :class:`dict` object is created named :class:`devices` containing the OpenWFS objects from the simulated microscope. These objects can then be manipulated from Micro-Manager, as seen in figure :numref:`micromanagerconnection`. diff --git a/examples/micro_manager_scanning_microscope.py b/examples/micro_manager_scanning_microscope.py index 0a1f3c0..d22dd3c 100644 --- a/examples/micro_manager_scanning_microscope.py +++ b/examples/micro_manager_scanning_microscope.py @@ -1,7 +1,9 @@ """ Micro-Manager simulated scanning microscope ====================================================================== This script simulates a scanning microscope with a pre-set image as a mock specimen. + To use it: + * make sure you have the PyDevice adapter installed in Micro-Manager (install the nightly build if you don't have it). * load the micro_manager_scanning_microscope.cfg hardware configuration in Micro-Manager, * locate the micro_manager_scanning_microscope.py in the file open dialog box that popps up. diff --git a/examples/micro_manager_wfs.py b/examples/micro_manager_wfs.py index d060758..28992d5 100644 --- a/examples/micro_manager_wfs.py +++ b/examples/micro_manager_wfs.py @@ -1,7 +1,9 @@ """ Micro-Manager simulated wavefront shaping ====================================================================== This script simulates a full wavefront shaping experiment in the Micro-Manager GUI. + To use it: + * make sure you have the PyDevice adapter installed in Micro-Manager (install the nightly build if you don't have it). * load the micro_manager_wfs.cfg hardware configuration in Micro-Manager, * locate the micro_manager_wfs.py in the file open dialog box that popps up.