![]() |
BioImager
4.9.0
A .NET microscopy imaging application based on Bio library. Supports various microscopes by using imported libraries & GUI automation. Supports XInput game controllers to move stage, take images, run ImageJ macros on images or Bio C# scripts.
|
Public Member Functions | |
| None | __init__ (self) |
| None | __del__ (self) |
| bool | get_is_enabled (self) |
| None | disable (self) |
| None | enable (self) |
| None | initialize (self) |
| None | shutdown (self) |
| None | add_setting (self, name, dtype, get_func, set_func, values, typing.Optional[typing.Callable[[], bool]] readonly=None) |
| get_setting (self, str name) | |
| get_all_settings (self) | |
| None | set_setting (self, str name, value) |
| describe_setting (self, str name) | |
| describe_settings (self) | |
| update_settings (self, incoming, bool init=False) | |
Public Attributes | |
| bool | enabled = False |
Protected Member Functions | |
| _do_disable (self) | |
| _do_enable (self) | |
| None | _do_shutdown (self) |
Protected Attributes | |
| dict | _settings = {} |
| None microscope.abc.Device.__init__ | ( | self | ) |
Reimplemented in microscope.abc.Camera, microscope.abc.DataDevice, microscope.cameras.picam.PiCamera, microscope.cameras.ximea.XimeaCamera, microscope.filterwheels.thorlabs.ThorlabsFilterWheel, microscope.filterwheels.thorlabs.ThorlabsFW102C, microscope.filterwheels.thorlabs.ThorlabsFW212C, microscope.simulators.SimulatedCamera, microscope.simulators.stage_aware_camera.StageAwareCamera, microscope.stages.linkam._LinkamBase, and microscope.testsuite.devices.TestCamera.
Definition at line 288 of file abc.py.
| None microscope.abc.Device.__del__ | ( | self | ) |
Reimplemented in microscope.stages.linkam._LinkamBase.
Definition at line 292 of file abc.py.
|
protected |
Do any device-specific work on disable. Subclasses should override this method rather than modify `disable`.
Reimplemented in microscope.cameras.andorsdk3.AndorSDK3, microscope.cameras.atmcd.AndorAtmcd, microscope.cameras.picam.PiCamera, microscope.cameras.pvcam.PVCamera, microscope.cameras.ximea.XimeaCamera, microscope.controllers.toptica._iChromeLaser, microscope.controllers.zaber._ZaberLED, microscope.lights.deepstar.DeepstarLaser, microscope.lights.obis.ObisLaser, microscope.simulators.SimulatedCamera, and microscope.simulators.SimulatedLightSource.
Definition at line 298 of file abc.py.
|
protected |
Do any device specific work on enable. Subclasses should override this method, rather than modify `enable`.
Reimplemented in microscope.cameras.andorsdk3.AndorSDK3, microscope.cameras.atmcd.AndorAtmcd, microscope.cameras.picam.PiCamera, microscope.cameras.pvcam.PVCamera, microscope.cameras.ximea.XimeaCamera, microscope.controllers.toptica._iChromeLaser, microscope.controllers.zaber._ZaberLED, microscope.controllers.zaber._ZaberStage, microscope.lights.cobolt.CoboltLaser, microscope.lights.deepstar.DeepstarLaser, microscope.lights.obis.ObisLaser, microscope.lights.sapphire.SapphireLaser, microscope.simulators.SimulatedCamera, microscope.simulators.SimulatedLightSource, and microscope.stages.ludl._LudlStage.
Definition at line 312 of file abc.py.
|
protected |
Private method - actual shutdown of the device. Users should be calling :meth:`shutdown` and not this method. Concrete implementations should implement this method instead of `shutdown`.
Reimplemented in microscope.abc.Controller, microscope.cameras.andorsdk3.AndorSDK3, microscope.cameras.atmcd.AndorAtmcd, microscope.cameras.picam.PiCamera, microscope.cameras.pvcam.PVCamera, microscope.cameras.ximea.XimeaCamera, microscope.controllers.coolled._CoolLEDChannel, microscope.controllers.lumencor._SpectraIIILightChannel, microscope.controllers.prior._ProScanIIIFilterWheel, microscope.controllers.toptica._iChromeLaser, microscope.controllers.zaber._ZaberFilterWheel, microscope.controllers.zaber._ZaberLED, microscope.controllers.zaber._ZaberStage, microscope.filterwheels.thorlabs.ThorlabsFilterWheel, microscope.lights.cobolt.CoboltLaser, microscope.lights.deepstar.DeepstarLaser, microscope.lights.obis.ObisLaser, microscope.lights.sapphire.SapphireLaser, microscope.lights.toptica.TopticaiBeam, microscope.mirror.alpao.AlpaoDeformableMirror, microscope.mirror.bmc.BMCDeformableMirror, microscope.mirror.mirao52e.Mirao52e, microscope.simulators.SimulatedCamera, microscope.simulators.SimulatedDeformableMirror, microscope.simulators.SimulatedFilterWheel, microscope.simulators.SimulatedLightSource, microscope.simulators.SimulatedStage, microscope.stages.linkam._LinkamBase, microscope.stages.ludl._LudlStage, microscope.testsuite.devices.DummyDSP, microscope.testsuite.devices.DummySLM, microscope.testsuite.devices.TestFloatingDevice, microscope.testsuite.test_device_server.DeviceWithPort, and microscope.testsuite.test_device_server.ExposePIDDevice.
Definition at line 329 of file abc.py.
| None microscope.abc.Device.add_setting | ( | self, | |
| name, | |||
| dtype, | |||
| get_func, | |||
| set_func, | |||
| values, | |||
| typing.Optional[typing.Callable[[], bool]] | readonly = None ) |
Add a setting definition.
Args:
name: the setting's name.
dtype: a data type from `"int"`, `"float"`, `"bool"`,
`"enum"`, or `"str"` (see `DTYPES`).
get_func: a function to get the current value.
set_func: a function to set the value.
values: a description of allowed values dependent on
dtype, or function that returns a description.
readonly: an optional function to indicate if the setting
is readonly. A setting may be readonly temporarily,
so this function will return `True` or `False` to
indicate its current state. If set to no `None`
(default), then its value will be dependent on the
value of `set_func`.
A client needs some way of knowing a setting name and data
type, retrieving the current value and, if settable, a way to
retrieve allowable values, and set the value. We store this
info in a dictionary. I considered having a `Setting1 class
with getter, setter, etc., and adding `Setting` instances as
device attributes, but Pyro does not support dot notation to
access the functions we need (e.g. `Device.some_setting.set`),
so I'd have to write access functions, anyway.
Definition at line 399 of file abc.py.
| microscope.abc.Device.describe_setting | ( | self, | |
| str | name ) |
| microscope.abc.Device.describe_settings | ( | self | ) |
| None microscope.abc.Device.disable | ( | self | ) |
Disable the device for a short period for inactivity.
Reimplemented in microscope.abc.DataDevice, microscope.controllers.coolled._CoolLEDChannel, microscope.controllers.lumencor._SpectraIIILightChannel, microscope.lights.cobolt.CoboltLaser, microscope.lights.sapphire.SapphireLaser, and microscope.lights.toptica.TopticaiBeam.
Definition at line 307 of file abc.py.
| None microscope.abc.Device.enable | ( | self | ) |
Enable the device.
Reimplemented in microscope.abc.DataDevice, microscope.controllers.coolled._CoolLEDChannel, microscope.controllers.lumencor._SpectraIIILightChannel, and microscope.lights.toptica.TopticaiBeam.
Definition at line 321 of file abc.py.
| microscope.abc.Device.get_all_settings | ( | self | ) |
Return ordered settings as a list of dicts.
Definition at line 455 of file abc.py.
| bool microscope.abc.Device.get_is_enabled | ( | self | ) |
| microscope.abc.Device.get_setting | ( | self, | |
| str | name ) |
Return the current value of a setting.
Definition at line 447 of file abc.py.
| None microscope.abc.Device.initialize | ( | self | ) |
Initialize the device. If devices have this method (not required, and many don't), then they should call it as part of the initialisation, i.e., they should call it on their `__init__` method.
Reimplemented in microscope.cameras.andorsdk3.AndorSDK3, microscope.cameras.atmcd.AndorAtmcd, microscope.cameras.picam.PiCamera, microscope.cameras.pvcam.PVCamera, microscope.cameras.ximea.XimeaCamera, microscope.lights.cobolt.CoboltLaser, microscope.lights.obis.ObisLaser, microscope.lights.sapphire.SapphireLaser, and microscope.testsuite.devices.TestFloatingDevice.
Definition at line 339 of file abc.py.
| None microscope.abc.Device.set_setting | ( | self, | |
| str | name, | ||
| value ) |
| None microscope.abc.Device.shutdown | ( | self | ) |
Shutdown the device.
Disable and disconnect the device. This method should be
called before destructing the device object, to ensure that
the device is actually shutdown.
After `shutdown`, the device object is no longer usable and
calling any other method is undefined behaviour. The only
exception `shutdown` itself which can be called consecutively,
and after the first time will have no effect.
A device object that has been shutdown can't be reinitialised.
Instead of reusing the object, a new one should be created
instead. This means that `shutdown` will leave the device in
a state that it can be reconnected.
.. code-block:: python
device = SomeDevice()
device.shutdown()
# Multiple calls to shutdown are OK
device.shutdown()
device.shutdown()
# After shutdown, everything else is undefined behaviour.
device.enable() # undefined behaviour
device.get_setting("speed") # undefined behaviour
# To reinitialise the device, construct a new instance.
device = SomeDevice()
.. note::
While `__del__` calls `shutdown`, one should not rely on
it. Python does not guarante that `__del__` will be
called when the interpreter exits so if `shutdown` is not
called explicitely, the devices might not be shutdown.
Definition at line 349 of file abc.py.
| microscope.abc.Device.update_settings | ( | self, | |
| incoming, | |||
| bool | init = False ) |
Update settings based on dict of settings and values.
Reimplemented in microscope.abc.DataDevice.
Definition at line 484 of file abc.py.