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.
Loading...
Searching...
No Matches
microscope.mirror.mirao52e.Mirao52e Class Reference
Inheritance diagram for microscope.mirror.mirao52e.Mirao52e:
microscope._utils.OnlyTriggersOnceOnSoftwareMixin microscope.abc.DeformableMirror microscope.abc.TriggerTargetMixin microscope.abc.TriggerTargetMixin microscope.abc.Device

Public Member Functions

None __init__ (self, **kwargs)
 
int n_actuators (self)
 
- Public Member Functions inherited from microscope._utils.OnlyTriggersOnceOnSoftwareMixin
microscope.TriggerType trigger_type (self)
 
microscope.TriggerMode trigger_mode (self)
 
None set_trigger (self, microscope.TriggerType ttype, microscope.TriggerMode tmode)
 
- Public Member Functions inherited from microscope.abc.TriggerTargetMixin
- Public Member Functions inherited from microscope.abc.DeformableMirror
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.Device
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)
 

Protected Member Functions

None _do_apply_pattern (self, numpy.ndarray pattern)
 
None _raise_status (self, typing.Callable func)
 
None _do_shutdown (self)
 
- Protected Member Functions inherited from microscope.abc.TriggerTargetMixin
- Protected Member Functions inherited from microscope.abc.DeformableMirror
None _validate_patterns (self, numpy.ndarray patterns)
 
None _do_trigger (self)
 
- Protected Member Functions inherited from microscope.abc.Device
 _do_disable (self)
 
 _do_enable (self)
 

Static Protected Member Functions

numpy.ndarray _normalize_patterns (numpy.ndarray patterns)
 

Protected Attributes

 _status = ctypes.pointer(ctypes.c_int(mro.OK))
 
- Protected Attributes inherited from microscope.abc.DeformableMirror
typing.Optional[numpy.ndarray] _patterns = None
 
int _pattern_idx = -1
 
- Protected Attributes inherited from microscope.abc.Device
dict _settings = {}
 

Additional Inherited Members

- Public Attributes inherited from microscope.abc.DeformableMirror
- Public Attributes inherited from microscope.abc.Device
bool enabled = False
 

Detailed Description

Imagine Optic Mirao 52e deformable mirror.

The Mirao 52e deformable mirrors only support software trigger.

Definition at line 58 of file mirao52e.py.

Constructor & Destructor Documentation

◆ __init__()

None microscope.mirror.mirao52e.Mirao52e.__init__ ( self,
** kwargs )

Reimplemented from microscope.abc.DeformableMirror.

Definition at line 68 of file mirao52e.py.

68 def __init__(self, **kwargs) -> None:
69 super().__init__(**kwargs)
70 # Status is not the return code of the function calls.
71 # Status is where we can find the error code in case a
72 # function call returns false. This _status variable will be
73 # an argument in all function calls.
74 self._status = ctypes.pointer(ctypes.c_int(mro.OK))
75 if not mro.open(self._status):
77 "failed to open mirao mirror (error code %d)"
78 % self._status.contents.value
79 )
80

Member Function Documentation

◆ _do_apply_pattern()

None microscope.mirror.mirao52e.Mirao52e._do_apply_pattern ( self,
numpy.ndarray pattern )
protected

Reimplemented from microscope.abc.DeformableMirror.

Definition at line 94 of file mirao52e.py.

94 def _do_apply_pattern(self, pattern: numpy.ndarray) -> None:
95 pattern = self._normalize_patterns(pattern)
96 command = pattern.ctypes.data_as(mro.Command)
97 if not mro.applyCommand(command, mro.FALSE, self._status):
98 self._raise_status(mro.applyCommand)
99

◆ _do_shutdown()

None microscope.mirror.mirao52e.Mirao52e._do_shutdown ( self)
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 from microscope.abc.Device.

Definition at line 106 of file mirao52e.py.

106 def _do_shutdown(self) -> None:
107 if not mro.close(self._status):
108 self._raise_status(mro.close)

◆ _normalize_patterns()

numpy.ndarray microscope.mirror.mirao52e.Mirao52e._normalize_patterns ( numpy.ndarray patterns)
staticprotected
mirao52e SDK expects values in the [-1 1] range, so we normalize
them from the [0 1] range we expect in our interface.

Definition at line 86 of file mirao52e.py.

86 def _normalize_patterns(patterns: numpy.ndarray) -> numpy.ndarray:
87 """
88 mirao52e SDK expects values in the [-1 1] range, so we normalize
89 them from the [0 1] range we expect in our interface.
90 """
91 patterns = (patterns * 2) - 1
92 return patterns
93

◆ _raise_status()

None microscope.mirror.mirao52e.Mirao52e._raise_status ( self,
typing.Callable func )
protected

Definition at line 100 of file mirao52e.py.

100 def _raise_status(self, func: typing.Callable) -> None:
101 error_code = self._status.contents.value
103 "mro_%s() failed (error code %d)" % (func.__name__, error_code)
104 )
105

◆ n_actuators()

int microscope.mirror.mirao52e.Mirao52e.n_actuators ( self)

Reimplemented from microscope.abc.DeformableMirror.

Definition at line 82 of file mirao52e.py.

82 def n_actuators(self) -> int:
83 return mro.NB_COMMAND_VALUES
84

Member Data Documentation

◆ _status

microscope.mirror.mirao52e.Mirao52e._status = ctypes.pointer(ctypes.c_int(mro.OK))
protected

Definition at line 74 of file mirao52e.py.


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