BioImager  3.9.1
A .NET microscopy imaging library. Supports various microscopes by using imported libraries & GUI automation. Supported libraries include PriorĀ® & ZeissĀ® & all devices supported by Micromanager 2.0 and python-microscope.
Loading...
Searching...
No Matches
microscope.abc.DeformableMirror Class Reference
Inheritance diagram for microscope.abc.DeformableMirror:
microscope.abc.TriggerTargetMixin microscope.abc.Device microscope.mirror.alpao.AlpaoDeformableMirror microscope.mirror.bmc.BMCDeformableMirror microscope.mirror.mirao52e.Mirao52e microscope.simulators.SimulatedDeformableMirror

Public Member Functions

None __init__ (self, **kwargs)
 
int n_actuators (self)
 
None apply_pattern (self, numpy.ndarray pattern)
 
None queue_patterns (self, numpy.ndarray patterns)
 
None next_pattern (self)
 
None trigger (self)
 
- Public Member Functions inherited from microscope.abc.TriggerTargetMixin
microscope.TriggerMode trigger_mode (self)
 
microscope.TriggerType trigger_type (self)
 
None set_trigger (self, microscope.TriggerType ttype, microscope.TriggerMode tmode)
 
None trigger (self)
 
- Public Member Functions inherited from microscope.abc.Device
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)
 
def get_setting (self, str name)
 
def get_all_settings (self)
 
None set_setting (self, str name, value)
 
def describe_setting (self, str name)
 
def describe_settings (self)
 
def update_settings (self, incoming, bool init=False)
 

Additional Inherited Members

- Public Attributes inherited from microscope.abc.Device
 enabled
 

Detailed Description

Base class for Deformable Mirrors.

There is no method to reset or clear a deformable mirror.  While
different vendors provide functions to do that, it is unclear
exactly what it does the actuators.  Does it set all actuators
back to something based on a calibration file?  Does it apply a
voltage of zero to each?  Does it set the values to zero and what
does that mean since different deformable mirrors expect values in
a different range?  For the sake of uniformity, it is better for
python-microscope users to pass the pattern they want, probably a
pattern that flattens the mirror.

It is also unclear what the use case for a reset.  If it just to
set the mirror to an initial state and not a specific shape, then
destroying and re-constructing the DeformableMirror object
provides the most obvious solution.

The private properties `_patterns` and `_pattern_idx` are
initialized to `None` to support the queueing of patterns and
software triggering.

Definition at line 1051 of file abc.py.

Constructor & Destructor Documentation

◆ __init__()

None microscope.abc.DeformableMirror.__init__ (   self,
**  kwargs 
)

Reimplemented from microscope.abc.Device.

Definition at line 1076 of file abc.py.

1076 def __init__(self, **kwargs) -> None:
1077 super().__init__(**kwargs)
1078 self._patterns: typing.Optional[numpy.ndarray] = None
1079 self._pattern_idx: int = -1
1080

Member Function Documentation

◆ apply_pattern()

None microscope.abc.DeformableMirror.apply_pattern (   self,
numpy.ndarray  pattern 
)
Apply this pattern.

Raises:
    microscope.IncompatibleStateError: if device trigger type is
        not set to software.

Definition at line 1113 of file abc.py.

1113 def apply_pattern(self, pattern: numpy.ndarray) -> None:
1114 """Apply this pattern.
1115
1116 Raises:
1117 microscope.IncompatibleStateError: if device trigger type is
1118 not set to software.
1119
1120 """
1121 if self.trigger_type is not microscope.TriggerType.SOFTWARE:
1122 # An alternative to error is to change the trigger type,
1123 # apply the pattern, then restore the trigger type, but
1124 # that would clear the queue on the device. It's better
1125 # to have the user specifically do it. See issue #61.
1127 "apply_pattern requires software trigger type"
1128 )
1129 self._validate_patterns(pattern)
1130 self._do_apply_pattern(pattern)
1131

References microscope.abc.DeformableMirror._do_apply_pattern(), microscope.mirror.alpao.AlpaoDeformableMirror._do_apply_pattern(), microscope.mirror.bmc.BMCDeformableMirror._do_apply_pattern(), microscope.mirror.mirao52e.Mirao52e._do_apply_pattern(), microscope.simulators.SimulatedDeformableMirror._do_apply_pattern(), microscope.abc.DeformableMirror._validate_patterns(), microscope._utils.OnlyTriggersOnceOnSoftwareMixin.trigger_type(), microscope._utils.OnlyTriggersBulbOnSoftwareMixin.trigger_type(), microscope.abc.TriggerTargetMixin.trigger_type(), microscope.cameras.andorsdk3.AndorSDK3.trigger_type(), microscope.cameras.atmcd.AndorAtmcd.trigger_type(), microscope.cameras.picam.PiCamera.trigger_type(), microscope.cameras.pvcam.PVCamera.trigger_type(), microscope.cameras.ximea.XimeaCamera.trigger_type(), microscope.controllers.coolled._CoolLEDChannel.trigger_type(), microscope.controllers.toptica._iChromeLaser.trigger_type(), microscope.lights.deepstar.DeepstarLaser.trigger_type(), microscope.lights.obis.ObisLaser.trigger_type(), and microscope.mirror.alpao.AlpaoDeformableMirror.trigger_type().

Referenced by microscope.abc.DeformableMirror.next_pattern().

◆ n_actuators()

int microscope.abc.DeformableMirror.n_actuators (   self)

Definition at line 1083 of file abc.py.

1083 def n_actuators(self) -> int:
1084 raise NotImplementedError()
1085

◆ next_pattern()

None microscope.abc.DeformableMirror.next_pattern (   self)
Apply the next pattern in the queue.

DEPRECATED: this is the same as calling :meth:`trigger`.

Definition at line 1148 of file abc.py.

1148 def next_pattern(self) -> None:
1149 """Apply the next pattern in the queue.
1150
1151 DEPRECATED: this is the same as calling :meth:`trigger`.
1152
1153 """
1154 self.trigger()
1155

References microscope.abc.DeformableMirror._pattern_idx, microscope.abc.DeformableMirror._patterns, microscope.abc.DeformableMirror.apply_pattern(), microscope.abc.TriggerTargetMixin.trigger(), and microscope.abc.DeformableMirror.trigger().

◆ queue_patterns()

None microscope.abc.DeformableMirror.queue_patterns (   self,
numpy.ndarray  patterns 
)
Send values to the mirror.

Args:
    patterns: An `KxN` elements array of values in the range
        `[0 1]`, where `N` equals the number of actuators, and
        `K` is the number of patterns.

A convenience fallback is provided for software triggering is
provided.

Reimplemented in microscope.mirror.alpao.AlpaoDeformableMirror.

Definition at line 1132 of file abc.py.

1132 def queue_patterns(self, patterns: numpy.ndarray) -> None:
1133 """Send values to the mirror.
1134
1135 Args:
1136 patterns: An `KxN` elements array of values in the range
1137 `[0 1]`, where `N` equals the number of actuators, and
1138 `K` is the number of patterns.
1139
1140 A convenience fallback is provided for software triggering is
1141 provided.
1142
1143 """
1144 self._validate_patterns(patterns)
1145 self._patterns = patterns
1146 self._pattern_idx = -1 # none is applied yet
1147

References microscope.abc.DeformableMirror._pattern_idx, microscope.abc.DeformableMirror._patterns, and microscope.abc.DeformableMirror._validate_patterns().

◆ trigger()

None microscope.abc.DeformableMirror.trigger (   self)
Apply the next pattern in the queue.

Reimplemented from microscope.abc.TriggerTargetMixin.

Definition at line 1178 of file abc.py.

1178 def trigger(self) -> None:
1179 """Apply the next pattern in the queue."""
1180 # This is just a passthrough to the TriggerTargetMixin class
1181 # and only exists for the docstring.
1182 return super().trigger()
1183
1184

References microscope.abc.DeformableMirror.trigger().

Referenced by microscope.clients.DataClient.enable(), microscope.cameras.ximea.XimeaCamera.get_cycle_time(), microscope.simulators.SimulatedCamera.get_cycle_time(), microscope.abc.DataDevice.grab_next_data(), microscope.abc.DeformableMirror.next_pattern(), and microscope.abc.DeformableMirror.trigger().


The documentation for this class was generated from the following file: