Skip to content

Commit 107ca49

Browse files
committed
Merge branch 'master' into deepsim-ximea
2 parents 6f8fba2 + 7ffac10 commit 107ca49

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2524
-705
lines changed

INSTALL

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
Microscope is available on the Python Package Index (PyPI) and can be
2+
`installed like any other Python package
3+
<https://packaging.python.org/tutorials/installing-packages/>`_. The
4+
short version of it is use pip::
5+
6+
pip install microscope
7+
8+
Note that you need to have Python and pip already installed on your
9+
system.
10+
11+
12+
Requirements
13+
============
14+
15+
Microscope can run in any operating system with Python installed but
16+
individual devices and intended usage may add specific requirements:
17+
18+
- **hardware performance**: control of devices at high speed, namely
19+
image acquisition at very high rates, may require a fast connection
20+
to the camera, high amount of memory, or a disk with fast write
21+
speeds. In such case, it may be advantageous to have a dedicated
22+
machine for the camera.
23+
24+
- **external libraries**: control of many devices is performed via
25+
vendor provided external libraries which are often limited to
26+
specific operating systems. For example, Alpao does not provide a
27+
library for Linux systems so control of Alpao deformable mirrors is
28+
limited to Windows. See the :ref:`Dependencies
29+
<install-dependencies>` sections below.
30+
31+
If there are multiple devices with high resources or incompatible
32+
requirements they can be distributed over multiple computers. For
33+
example, two cameras acquiring images at a high frame rate or a camera
34+
that requires Windows paired with a deformable mirror that requires
35+
Linux. See the :ref:`Examples <examples>` section.
36+
37+
38+
.. _install-dependencies:
39+
40+
Dependencies
41+
============
42+
43+
Microscope has very few dependencies. All are Python packages
44+
available on PyPI and will be automatically resolved if Microscope is
45+
installed with pip. However, the interface to many devices is done
46+
via an external library (or SDK, or driver) that is only provided by
47+
the device vendor.
48+
49+
To identify if an external library is required, check the associated
50+
module documentation. If an external library is required, contact the
51+
device vendor for install instructions. Cameras, deformable mirrors,
52+
and spatial light modulators all require an external library. Filter
53+
wheels, lasers, and stages typically do not but there are exceptions.
54+
55+
56+
Development sources
57+
===================
58+
59+
Microscope development sources are available on github. To install
60+
the current development version of Microscope::
61+
62+
git clone https://github.com/MicronOxford/microscope.git pip
63+
pip install --no-index microscope/
64+
65+
Also consider using editable mode if you plan to make changes to the
66+
project::
67+
68+
pip install --no-index --editable microscope/
69+
70+
Multiple Microscope versions
71+
----------------------------
72+
73+
Python package system will not by default handle multiple versions of
74+
a package. If installing from development, beware to not overwrite a
75+
previous installation. A typical approach to address this issue is to
76+
use `virtual environments
77+
<https://packaging.python.org/tutorials/installing-packages/#creating-and-using-virtual-environments>`_.
78+
79+
Un-merged features
80+
------------------
81+
82+
Many features are still in development and have not been merged in the
83+
master branch. To try such features, you will need to know the branch
84+
name and the repository where such feature is being developed. For
85+
example, to try Toshiki Kubo's implementation of the Mirao52e
86+
deformable mirror::
87+
88+
git remote add toshiki https://github.com/toshikikubo/microscope.git
89+
git fetch toshiki
90+
git checkout toshiki/mirao52e
91+
pip install --no-index ./

NEWS

Lines changed: 113 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,130 @@
11
The following is a summary of the user-visible changes for each of
22
python-microscope releases.
33

4-
Version 0.3.0 (yyyy/mm/dd)
4+
Version 0.4.0 (upcoming)
5+
------------------------
6+
7+
* Selected most important, backwards incompatible, changes:
8+
9+
* The `Setting` class is now private. The only supported method to
10+
add settings to a `Device` is via its `add_setting` method.
11+
12+
* New devices supported:
13+
14+
* Coherent Obis laser
15+
* Lumencor Spectra III light engine
16+
* Prior ProScan III controller
17+
* Prior filter wheels
18+
* Toptica iBeam laser
19+
20+
* Changes to device ABCs:
21+
22+
* Device:
23+
24+
* The `Device._logger` attribute has been removed. It is
25+
recommended to use a logger for the module.
26+
27+
* DeformableMirror:
28+
29+
* Concrete classes must implement the `n_actuators` public
30+
property instead of the private _n_actuators`.
31+
32+
* The device server and clients no longer force pickle protocol
33+
version 2. If the client and server are running different Python
34+
versions it may be necessary to specify a version number. This
35+
should be done on the side with the highest support version number
36+
by setting `Pyro4.config.PICKLE_PROTOCOL_VERSION`.
37+
38+
39+
Version 0.3.0 (2019/11/07)
540
--------------------------
641

7-
* Backwards incompatible changes:
42+
* Selected most important, backwards incompatible, changes:
843

9-
* `microscope.device()`, function used create a device definition,
44+
* `microscope.device`, function used to create a device definition,
1045
changed signature. The arguments to the device constructor must
11-
now be passed as a dict.
46+
now be passed as a dictionary.
47+
48+
* Python 2 is no longer supported.
49+
50+
* New requirements:
51+
52+
* Python >= 3.5
53+
* hidapi
54+
55+
* New devices supported:
56+
57+
* Andor (EM)CCD cameras (requires Andor's atmcd C library)
58+
* Aurox Clarity (requires hidapi Python package)
59+
* Imagine Optic Mirao 52-e deformable mirror (requires mirao52e C library)
60+
* Linkam Correlative Microscopy Stage (requires LinkamSDK C library)
61+
* Ximea cameras (requires Ximea's xiAPI Python package)
62+
63+
* Changes to device ABCs:
64+
65+
* New ABC `ControllerDevice` for controller devices.
66+
67+
* Laser devices:
68+
69+
* New abstract methods:
70+
71+
* `LaserDevice.get_min_power_mw`
72+
* `LaserDevice.is_alive`
73+
74+
* `LaserDevice.set_power_mw` now clips the set value to the device
75+
actual range. Previously, the behaviour was undefined and
76+
device specific.
77+
78+
* Camera devices:
79+
80+
* Added ROIs and binning support.
81+
82+
* New abstract methods:
83+
84+
* `CameraDevice._get_binning`
85+
* `CameraDevice._get_roi`
86+
* `CameraDevice._set_binning`
87+
* `CameraDevice._set_roi`
88+
89+
* DataDevices:
90+
91+
* Data clients are now on a stack to facilitate temporary
92+
redirection of data to some other client.
93+
94+
* Filterwheel devices:
95+
96+
* New method `FilterWheelBase.get_num_positions`
97+
98+
* New abstract methods:
99+
100+
* `FilterWheelBase.get_position`
101+
* `FilterWheelBase.set_position`
102+
103+
* Device specific changes:
104+
105+
* Omicron TA Deepstar laser:
106+
107+
* Now returns actual laser power instead of the set laser power.
108+
Requires device to be fitted with the APC option.
12109

13-
* Python 3.5 or later is now required. Python 2 is no longer
14-
supported. This drops the dependency on the six and enum34.
110+
* Test camera:
15111

16-
* `CoboltLaser` now has a default value for its `baud` argument.
112+
* Added new setting to control created image. In addition of
113+
noise, can also return stripes, spots, or gradients. See
114+
`microscope.testsuite.devices.ImageGenerator`.
17115

18-
* `LaserDevice.set_power_mw` now clips the set value to the device
19-
actual range. Previously, the behaviour was undefined.
116+
* Removed requirements:
20117

21-
* Added Device server support for Windows services.
118+
* enum34
119+
* six
22120

23-
* DataDevices now handle a stack of clients to receive data.
121+
* The `deviceserver` program can now be used as a Windows service.
24122

25-
* New abstract methods:
123+
* Fixed PyPI releases to include the `microscope.mirrorq and
124+
`microscope.filterwheels` subpackages.
26125

27-
* `LaserDevice.get_min_power_mw`
28-
* `LaserDevice.is_alive`
126+
* New `microscope.devices.ROI` and `microscope.devices.Binning`
127+
classes to represent those camera settings.
29128

30129

31130
Version 0.2.0 (2018/06/13)

doc/conf.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
## notice and this notice are preserved. This file is offered as-is,
99
## without any warranty.
1010

11+
import datetime
1112
import sys
1213

1314
sys.path.insert(0, '../microscope')
@@ -17,10 +18,11 @@
1718
## pkg_resources to avoid duplication?
1819
author = 'Micron Oxford'
1920
project = 'Microscope'
20-
copyright = '2017, Micron Oxford'
2121

22+
copyright = '%s, %s' %(datetime.datetime.now().year, author)
2223

2324
master_doc = 'index'
25+
nitpicky = True
2426

2527

2628
extensions = [
@@ -47,3 +49,9 @@
4749

4850
html_theme = 'agogo'
4951
html_static_path = ['_static']
52+
html_title = 'Python Microscope documentation'
53+
html_short_title = 'import microscope'
54+
html_show_copyright = False
55+
html_show_sphinx = False
56+
html_copy_source = False
57+
html_show_sourcelink = False

doc/contributors.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@ Microscope:
1515

1616
- Amy Howard
1717
- David Miguel Susano Pinto
18+
- Ian Dobbie
19+
- Julio Mateos-Langerak
1820
- Mick Phillips
1921
- Tiago Susano Pinto

doc/design.rst

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. Copyright (C) 2017 David Pinto <david.pinto@bioch.ox.ac.uk>
1+
.. Copyright (C) 2019 David Pinto <david.pinto@bioch.ox.ac.uk>
22
33
Permission is granted to copy, distribute and/or modify this
44
document under the terms of the GNU Free Documentation License,
@@ -13,12 +13,16 @@ Design
1313
Problem
1414
=======
1515

16-
Bespoke microscopes are built in research labs by physicists and
17-
biologists that are often not interested in programming. However,
18-
such microscopes are complex systems that rely on the tight
19-
integration between many components and can only be controlled by
20-
custom software. The end result is in-house software that is both
21-
limited in scope and unusable in other projects.
16+
Research laboratories are constantly developing new microscopes that
17+
are are complex systems that rely on the tight integration between
18+
many components. Instead of focusing on the microscopy, these teams
19+
spend substantial time and effort in software development to control
20+
their new microscopes. Such software is limited to the specific
21+
microscope setup and components and becomes unshareable, difficult to
22+
maintain, or incur ongoing licensing costs. A huge amount of time,
23+
effort, and resources is wasted as scientists in different labs, and
24+
even in the same lab, repeatably implement solutions to the same
25+
problems.
2226

2327

2428
Project aims
@@ -43,16 +47,34 @@ Project aims
4347
Choices
4448
=======
4549

46-
µManager
47-
--------
50+
Why not using µManager
51+
----------------------
4852

49-
Why we didn't choose µManager...
53+
`µManager <https://micro-manager.org/>`_ is an existing open source
54+
software for the control of microscopes. It is written in Java and
55+
based on top of ImageJ, an open source image analysis program.
56+
However, µManager design has issues when controlling more complex
57+
microscopes where devices are spread over multiple computers, with
58+
multiple cameras, and devices are synchronised with TTL signals. In
59+
addition, while Java makes it easier to access ImageJ it makes more
60+
difficult to use the whole of numpy and scipy.
5061

5162
Python
5263
------
5364

54-
Python is extensively used for scientific computing, and is the most
55-
likely language the projects users will be familiar with.
65+
Python has multiple features:
66+
67+
#. it is widely used in the scientific community. This increases the
68+
odds that users of Microscope will be capable to participate in its
69+
development.
70+
71+
#. unlike other widespread languages in the scientific community, it
72+
is a general purpose programming language and not mainly for
73+
numerical or symbolic computation.
74+
75+
#. while Python is not firstly a language for numerical computations,
76+
numpy and scipy are the basis for this. Most algorithms for image
77+
analysis are available in Python.
5678

5779

5880
Use cases
@@ -116,3 +138,13 @@ State machine
116138
Devices do not report back their state which prevents from modelling
117139
Microscope as a state machine. For example, users will change
118140
objectives or move the stage.
141+
142+
History
143+
=======
144+
145+
Development of Python Microscope started at `Oxford Micron Bioimaging
146+
Unit <https://www.micron.ox.ac.uk>`_ to provide remote control of
147+
microscope devices independent of hardware specifics. Locally,
148+
development was guided to support development of a new version of
149+
`cockpit <https://www.micron.ox.ac.uk/software/cockpit/>`_, a
150+
graphical user interface for the control of microscopes.

0 commit comments

Comments
 (0)