microeye 2.3.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. microEye/__init__.py +47 -0
  2. microEye/_version.py +2 -0
  3. microEye/analysis/__init__.py +1 -0
  4. microEye/analysis/checklist_dialog.py +143 -0
  5. microEye/analysis/cmosMaps.py +228 -0
  6. microEye/analysis/filters/__init__.py +9 -0
  7. microEye/analysis/filters/base.py +21 -0
  8. microEye/analysis/filters/spatial.py +338 -0
  9. microEye/analysis/filters/temporal.py +76 -0
  10. microEye/analysis/fitting/__init__.py +0 -0
  11. microEye/analysis/fitting/fit.py +680 -0
  12. microEye/analysis/fitting/nena.py +375 -0
  13. microEye/analysis/fitting/phasor_fit.py +90 -0
  14. microEye/analysis/fitting/processing.py +317 -0
  15. microEye/analysis/fitting/psf/__init__.py +6 -0
  16. microEye/analysis/fitting/psf/extract.py +1129 -0
  17. microEye/analysis/fitting/psf/rubost_mean.py +150 -0
  18. microEye/analysis/fitting/psf/spline.py +167 -0
  19. microEye/analysis/fitting/psf/stats/__init__.py +12 -0
  20. microEye/analysis/fitting/psf/stats/core.py +295 -0
  21. microEye/analysis/fitting/psf/stats/curve_fit.py +708 -0
  22. microEye/analysis/fitting/psf/stats/io.py +104 -0
  23. microEye/analysis/fitting/psf/stats/slope_fit.py +171 -0
  24. microEye/analysis/fitting/psf/temp.py +147 -0
  25. microEye/analysis/fitting/psf/test.py +47 -0
  26. microEye/analysis/fitting/pyfit3Dcspline/CPU/CPUfunctions.py +657 -0
  27. microEye/analysis/fitting/pyfit3Dcspline/CPU/CPUmleFit_LM.py +1336 -0
  28. microEye/analysis/fitting/pyfit3Dcspline/CPU/CPUsplineLib.py +270 -0
  29. microEye/analysis/fitting/pyfit3Dcspline/CPU/__init__.py +1 -0
  30. microEye/analysis/fitting/pyfit3Dcspline/GPU/GPUfunctions.py +609 -0
  31. microEye/analysis/fitting/pyfit3Dcspline/GPU/GPUmleFit_LM_EMCCD.py +1396 -0
  32. microEye/analysis/fitting/pyfit3Dcspline/GPU/GPUmleFit_LM_sCMOS.py +1426 -0
  33. microEye/analysis/fitting/pyfit3Dcspline/GPU/GPUsplineLib.py +231 -0
  34. microEye/analysis/fitting/pyfit3Dcspline/GPU/__init__.py +2 -0
  35. microEye/analysis/fitting/pyfit3Dcspline/__init__.py +10 -0
  36. microEye/analysis/fitting/pyfit3Dcspline/constants.py +27 -0
  37. microEye/analysis/fitting/pyfit3Dcspline/mainfunctions.py +903 -0
  38. microEye/analysis/fitting/results.py +917 -0
  39. microEye/analysis/fitting/results_stats.py +251 -0
  40. microEye/analysis/fitting/tardis.py +209 -0
  41. microEye/analysis/multi_viewer.py +568 -0
  42. microEye/analysis/processing/__init__.py +1 -0
  43. microEye/analysis/processing/frc.py +120 -0
  44. microEye/analysis/rendering/__init__.py +3 -0
  45. microEye/analysis/rendering/base.py +452 -0
  46. microEye/analysis/rendering/cloud.py +215 -0
  47. microEye/analysis/rendering/core.py +47 -0
  48. microEye/analysis/rendering/volumetric.py +198 -0
  49. microEye/analysis/tools/__init__.py +0 -0
  50. microEye/analysis/tools/kymograms.py +1079 -0
  51. microEye/analysis/tools/roi_selectors.py +556 -0
  52. microEye/analysis/utils/__init__.py +3 -0
  53. microEye/analysis/utils/coordinates.py +18 -0
  54. microEye/analysis/utils/images.py +68 -0
  55. microEye/analysis/utils/windows.py +19 -0
  56. microEye/analysis/viewer/__init__.py +3 -0
  57. microEye/analysis/viewer/image_options_widget.py +615 -0
  58. microEye/analysis/viewer/images.py +1225 -0
  59. microEye/analysis/viewer/layers_widget.py +415 -0
  60. microEye/analysis/viewer/localizations.py +1304 -0
  61. microEye/analysis/viewer/psf.py +1003 -0
  62. microEye/analysis/viewer/volume.py +456 -0
  63. microEye/hardware/__init__.py +3 -0
  64. microEye/hardware/cams/__init__.py +29 -0
  65. microEye/hardware/cams/camera_calibration.py +99 -0
  66. microEye/hardware/cams/camera_list.py +528 -0
  67. microEye/hardware/cams/camera_options.py +694 -0
  68. microEye/hardware/cams/camera_panel.py +941 -0
  69. microEye/hardware/cams/dummy/__init__.py +1 -0
  70. microEye/hardware/cams/dummy/dummy_panel.py +759 -0
  71. microEye/hardware/cams/jobs.py +497 -0
  72. microEye/hardware/cams/line_profiler.py +99 -0
  73. microEye/hardware/cams/linescan/IR_Cam.py +474 -0
  74. microEye/hardware/cams/linescan/__init__.py +1 -0
  75. microEye/hardware/cams/micam.py +524 -0
  76. microEye/hardware/cams/pco/__init__.py +58 -0
  77. microEye/hardware/cams/pco/enums.py +382 -0
  78. microEye/hardware/cams/pco/pco_cam.py +761 -0
  79. microEye/hardware/cams/pco/pco_panel.py +477 -0
  80. microEye/hardware/cams/shortcuts.py +312 -0
  81. microEye/hardware/cams/thorlabs/__init__.py +1 -0
  82. microEye/hardware/cams/thorlabs/thorlabs.py +1508 -0
  83. microEye/hardware/cams/thorlabs/thorlabs_panel.py +850 -0
  84. microEye/hardware/cams/ueye/__init__.py +1 -0
  85. microEye/hardware/cams/ueye/ueye_camera.py +1023 -0
  86. microEye/hardware/cams/ueye/ueye_panel.py +861 -0
  87. microEye/hardware/cams/vimba/__init__.py +1 -0
  88. microEye/hardware/cams/vimba/vimba_cam.py +1000 -0
  89. microEye/hardware/cams/vimba/vimba_panel.py +813 -0
  90. microEye/hardware/device.py +60 -0
  91. microEye/hardware/lasers/__init__.py +13 -0
  92. microEye/hardware/lasers/io_matchbox.py +791 -0
  93. microEye/hardware/lasers/io_params.py +85 -0
  94. microEye/hardware/lasers/io_single_laser.py +742 -0
  95. microEye/hardware/lasers/laser_relay.py +594 -0
  96. microEye/hardware/mieye/__init__.py +1 -0
  97. microEye/hardware/mieye/acquisition_manager.py +467 -0
  98. microEye/hardware/mieye/devices_manager.py +533 -0
  99. microEye/hardware/mieye/miEye.py +659 -0
  100. microEye/hardware/misc/__init__.py +0 -0
  101. microEye/hardware/misc/acquisition_view.py +71 -0
  102. microEye/hardware/misc/reglo.py +761 -0
  103. microEye/hardware/misc/temp.py +188 -0
  104. microEye/hardware/port_config.py +59 -0
  105. microEye/hardware/protocols/__init__.py +2 -0
  106. microEye/hardware/protocols/actions.py +402 -0
  107. microEye/hardware/protocols/actions_items.py +703 -0
  108. microEye/hardware/protocols/designer.py +244 -0
  109. microEye/hardware/protocols/scene_manager.py +191 -0
  110. microEye/hardware/protocols/serialization.py +97 -0
  111. microEye/hardware/pycromanager/__init__.py +16 -0
  112. microEye/hardware/pycromanager/core.py +1433 -0
  113. microEye/hardware/pycromanager/devices.py +461 -0
  114. microEye/hardware/pycromanager/enums.py +107 -0
  115. microEye/hardware/pycromanager/headless.py +153 -0
  116. microEye/hardware/pycromanager/utils.py +34 -0
  117. microEye/hardware/pycromanager/widgets/__init__.py +5 -0
  118. microEye/hardware/pycromanager/widgets/bridges.py +407 -0
  119. microEye/hardware/pycromanager/widgets/headless_manager.py +258 -0
  120. microEye/hardware/pycromanager/widgets/headless_options.py +224 -0
  121. microEye/hardware/pycromanager/widgets/pycro_panel.py +455 -0
  122. microEye/hardware/stages/__init__.py +18 -0
  123. microEye/hardware/stages/elliptec/__init__.py +5 -0
  124. microEye/hardware/stages/elliptec/baseDevice.py +314 -0
  125. microEye/hardware/stages/elliptec/device.py +384 -0
  126. microEye/hardware/stages/elliptec/deviceID.py +212 -0
  127. microEye/hardware/stages/elliptec/devicePort.py +379 -0
  128. microEye/hardware/stages/elliptec/deviceStatus.py +65 -0
  129. microEye/hardware/stages/elliptec/devicesView.py +706 -0
  130. microEye/hardware/stages/elliptec/ellDevices.py +134 -0
  131. microEye/hardware/stages/elliptec/messageUpdater.py +34 -0
  132. microEye/hardware/stages/elliptec/motorInfo.py +153 -0
  133. microEye/hardware/stages/elliptec/stage.py +62 -0
  134. microEye/hardware/stages/elliptec/test.py +139 -0
  135. microEye/hardware/stages/kinesis/__init__.py +1 -0
  136. microEye/hardware/stages/kinesis/kdc101/__init__.py +1 -0
  137. microEye/hardware/stages/kinesis/kdc101/enums.py +1002 -0
  138. microEye/hardware/stages/kinesis/kdc101/factory.py +171 -0
  139. microEye/hardware/stages/kinesis/kdc101/kdc101.py +718 -0
  140. microEye/hardware/stages/kinesis/kinesis.py +776 -0
  141. microEye/hardware/stages/piezo_concept.py +607 -0
  142. microEye/hardware/stages/stabilizer.py +785 -0
  143. microEye/hardware/stages/stage.py +89 -0
  144. microEye/hardware/widgets/__init__.py +10 -0
  145. microEye/hardware/widgets/controller.py +246 -0
  146. microEye/hardware/widgets/devices.py +133 -0
  147. microEye/hardware/widgets/focusWidget.py +264 -0
  148. microEye/hardware/widgets/qlist_slider.py +113 -0
  149. microEye/hardware/widgets/scan_acquisition.py +424 -0
  150. microEye/icons/1024.png +0 -0
  151. microEye/icons/128.png +0 -0
  152. microEye/icons/16.png +0 -0
  153. microEye/icons/24.png +0 -0
  154. microEye/icons/256.png +0 -0
  155. microEye/icons/32.png +0 -0
  156. microEye/icons/48.png +0 -0
  157. microEye/icons/512.png +0 -0
  158. microEye/icons/64.png +0 -0
  159. microEye/icons/__init__.py +0 -0
  160. microEye/icons/close.svg +88 -0
  161. microEye/icons/mieye.png +0 -0
  162. microEye/icons/min.svg +83 -0
  163. microEye/icons/viewer.png +0 -0
  164. microEye/launcher.py +42 -0
  165. microEye/qt.py +181 -0
  166. microEye/utils/__init__.py +2 -0
  167. microEye/utils/enum_encoder.py +10 -0
  168. microEye/utils/expandable_groupbox.py +93 -0
  169. microEye/utils/gui_helper.py +457 -0
  170. microEye/utils/hid/__init__.py +8 -0
  171. microEye/utils/hid/controller.py +153 -0
  172. microEye/utils/hid/device.py +63 -0
  173. microEye/utils/hid/enums.py +140 -0
  174. microEye/utils/hid/utils.py +58 -0
  175. microEye/utils/labelled_slider.py +134 -0
  176. microEye/utils/metadata.py +599 -0
  177. microEye/utils/metadata_tree.py +718 -0
  178. microEye/utils/micro_launcher.py +245 -0
  179. microEye/utils/parameter_tree.py +325 -0
  180. microEye/utils/pyscripting.py +444 -0
  181. microEye/utils/retry_exec.py +35 -0
  182. microEye/utils/start_gui.py +112 -0
  183. microEye/utils/thread_worker.py +115 -0
  184. microEye/utils/uImage.py +1512 -0
  185. microeye-2.3.2.dist-info/METADATA +401 -0
  186. microeye-2.3.2.dist-info/RECORD +190 -0
  187. microeye-2.3.2.dist-info/WHEEL +5 -0
  188. microeye-2.3.2.dist-info/entry_points.txt +2 -0
  189. microeye-2.3.2.dist-info/licenses/LICENSE +674 -0
  190. microeye-2.3.2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1433 @@
1
+ import time
2
+ from typing import Any, Optional, Union
3
+
4
+ from pycromanager import Core
5
+ from pycromanager.mm_java_classes import DEFAULT_BRIDGE_PORT
6
+
7
+ from microEye.hardware.pycromanager.enums import *
8
+ from microEye.hardware.pycromanager.utils import *
9
+
10
+ DEFAULT_TIMEOUT = 30 # Default timeout in seconds
11
+ MAX_RECONNECT_ATTEMPTS = 3
12
+ RECONNECT_DELAY = 5 # seconds
13
+
14
+ # def add_timeout_to_all_methods(cls):
15
+ # for attr_name, attr_value in cls.__dict__.items():
16
+ # if callable(attr_value) and not attr_name.startswith('__'):
17
+ # setattr(cls, attr_name, timeout(DEFAULT_TIMEOUT)(attr_value))
18
+ # return cls
19
+
20
+
21
+ # @add_timeout_to_all_methods
22
+ class PycroCore:
23
+ _CORE: Core = None
24
+ _instances: dict[int, 'PycroCore'] = {}
25
+ _LOADED_DEVICES = {}
26
+
27
+ def __new__(cls, *args, **kwargs):
28
+ port = kwargs.get('port', DEFAULT_BRIDGE_PORT)
29
+ # If the single instance doesn't exist, create a new one
30
+ if not cls._instances.get(port):
31
+ cls._instances[port] = super().__new__(cls)
32
+ # Return the single instance
33
+ return cls._instances.get(port)
34
+
35
+ @classmethod
36
+ def instance(cls, port: int = DEFAULT_BRIDGE_PORT) -> 'PycroCore':
37
+ if cls._instances.get(port) is None:
38
+ return PycroCore(port=port)
39
+
40
+ return cls._instances.get(port)
41
+
42
+ @classmethod
43
+ def get_camera_list(cls) -> list[dict]:
44
+ cams = []
45
+
46
+ for idx, (port, instance) in enumerate(cls._instances.items()):
47
+ cams.append(
48
+ {
49
+ 'Camera ID': instance.get_camera_device(),
50
+ 'Device ID': f'{port}-{idx}',
51
+ 'Sensor ID': 'NA',
52
+ 'Status': 'NA',
53
+ 'InUse': 0,
54
+ 'Model': 'PycroCamera',
55
+ 'Serial': 'NA',
56
+ 'Driver': 'PycroCore',
57
+ 'Name': instance.get_device_name(instance.get_camera_device()),
58
+ }
59
+ )
60
+
61
+ return cams
62
+
63
+ def __init__(self, **kwargs):
64
+ self.port = kwargs.get('port', DEFAULT_BRIDGE_PORT)
65
+ self.connect()
66
+
67
+ if not self.is_connected():
68
+ raise ConnectionError('Failed to connect to Micro-Manager')
69
+
70
+ self._LOADED_DEVICES = {}
71
+ # print(self.get_loaded_devices())
72
+ for type in DeviceType:
73
+ for label in self.get_loaded_devices():
74
+ if type == self.get_device_type(label):
75
+ self._LOADED_DEVICES[type] = label
76
+ # print(self._LOADED_DEVICES)
77
+
78
+ def connect(self):
79
+ if self.is_connected():
80
+ return
81
+
82
+ for attempt in range(MAX_RECONNECT_ATTEMPTS):
83
+ try:
84
+ self._CORE = Core(timeout=5000, port=self.port, convert_camel_case=True)
85
+ print(f'Successfully connected on attempt {attempt + 1}')
86
+ return
87
+ except Exception as e:
88
+ self._CORE = None
89
+ print(f'Connection attempt {attempt + 1} failed: {str(e)}')
90
+ if attempt < MAX_RECONNECT_ATTEMPTS - 1:
91
+ print(f'Retrying in {RECONNECT_DELAY} seconds...')
92
+ time.sleep(RECONNECT_DELAY)
93
+ raise ConnectionError('Failed to connect after maximum attempts')
94
+
95
+ def close(self):
96
+ if hasattr(self._CORE, '_close'):
97
+ self._CORE._close()
98
+ self._CORE = None
99
+ del PycroCore._instances[self.port]
100
+
101
+ def reconnect(self):
102
+ print('Attempting to reconnect...')
103
+ self.connect()
104
+
105
+ def is_connected(self):
106
+ # This is a simple check. You might want to implement a more robust check
107
+ return self._CORE is not None and bool(self.get_version_info())
108
+
109
+ def add_galvo_polygon_vertex(
110
+ self, galvo_label: str, polygon_index: int, x: float, y: float
111
+ ) -> None:
112
+ '''TODO: Test this'''
113
+ self._CORE.add_galvo_polygon_vertex(galvo_label, polygon_index, x, y)
114
+
115
+ @staticmethod
116
+ def add_search_path(path: str) -> None:
117
+ '''TODO: Test this'''
118
+ Core.add_search_path(path)
119
+
120
+ # def assign_image_synchro(self, device_label: str) -> None:
121
+ # '''TODO: Test this'''
122
+ # self._CORE.assign_image_synchro(device_label)
123
+
124
+ def clear_circular_buffer(self) -> None:
125
+ self._CORE.clear_circular_buffer()
126
+
127
+ def clear_roi(self) -> None:
128
+ self._CORE.clear_roi()
129
+
130
+ def debug_log_enabled(self) -> bool:
131
+ return self._CORE.debug_log_enabled()
132
+
133
+ def define_config(
134
+ self,
135
+ group_name: str,
136
+ config_name: str,
137
+ device_label: Optional[str] = None,
138
+ prop_name: Optional[str] = None,
139
+ value: Optional[str] = None,
140
+ ) -> None:
141
+ '''TODO: Test this'''
142
+ if device_label is None and prop_name is None and value is None:
143
+ self._CORE.define_config(group_name, config_name)
144
+ else:
145
+ self._CORE.define_config(
146
+ group_name, config_name, device_label, prop_name, value
147
+ )
148
+
149
+ def define_config_group(self, group_name: str) -> None:
150
+ '''TODO: Test this'''
151
+ self._CORE.define_config_group(group_name)
152
+
153
+ def define_pixel_size_config(
154
+ self,
155
+ resolution_id: str,
156
+ device_label: Optional[str] = None,
157
+ prop_name: Optional[str] = None,
158
+ value: Optional[str] = None,
159
+ ) -> None:
160
+ '''TODO: Test this'''
161
+ if device_label is None and prop_name is None and value is None:
162
+ self._CORE.define_pixel_size_config(resolution_id)
163
+ else:
164
+ self._CORE.define_pixel_size_config(
165
+ resolution_id, device_label, prop_name, value
166
+ )
167
+
168
+ def define_property_block(
169
+ self, block_name: str, property_name: str, property_value: str
170
+ ) -> None:
171
+ '''TODO: Test this'''
172
+ self._CORE.define_property_block(block_name, property_name, property_value)
173
+
174
+ def define_state_label(
175
+ self, state_device_label: str, state: int, state_label: str
176
+ ) -> None:
177
+ '''TODO: Test this'''
178
+ self._CORE.define_state_label(state_device_label, state, state_label)
179
+
180
+ def delete(self) -> None:
181
+ self._CORE.delete()
182
+
183
+ def delete_config(
184
+ self,
185
+ group_name: str,
186
+ config_name: str,
187
+ device_label: Optional[str] = None,
188
+ prop_name: Optional[str] = None,
189
+ ) -> None:
190
+ '''TODO: Test this'''
191
+ if device_label is None and prop_name is None:
192
+ self._CORE.delete_config(group_name, config_name)
193
+ else:
194
+ self._CORE.delete_config(group_name, config_name, device_label, prop_name)
195
+
196
+ def delete_config_group(self, group_name: str) -> None:
197
+ '''TODO: Test this'''
198
+ self._CORE.delete_config_group(group_name)
199
+
200
+ def delete_galvo_polygons(self, galvo_label: str) -> None:
201
+ '''TODO: Test this'''
202
+ self._CORE.delete_galvo_polygons(galvo_label)
203
+
204
+ def delete_pixel_size_config(self, config_name: str) -> None:
205
+ self._CORE.delete_pixel_size_config(config_name)
206
+
207
+ def detect_device(self, device_label: str) -> DeviceDetectionStatus:
208
+ res = self._CORE.detect_device(device_label)
209
+ if hasattr(res, 'swig_value'):
210
+ return DeviceDetectionStatus(res.swig_value())
211
+ elif isinstance(res, int):
212
+ return DeviceDetectionStatus(res)
213
+
214
+ return None
215
+
216
+ def device_busy(self, label: str) -> bool:
217
+ return self._CORE.device_busy(label)
218
+
219
+ def device_type_busy(self, dev_type: Any) -> bool:
220
+ '''TODO: dev_type should be of type mmcorej.DeviceType'''
221
+ return self._CORE.device_type_busy(dev_type)
222
+
223
+ def display_slm_image(self, slm_label: str) -> None:
224
+ '''TODO: Test this'''
225
+ self._CORE.display_slm_image(slm_label)
226
+
227
+ def enable_continuous_focus(self, enable: bool) -> None:
228
+ '''TODO: Test this'''
229
+ self._CORE.enable_continuous_focus(enable)
230
+
231
+ def enable_debug_log(self, enable: bool) -> None:
232
+ self._CORE.enable_debug_log(enable)
233
+
234
+ def enable_stderr_log(self, enable: bool) -> None:
235
+ self._CORE.enable_stderr_log(enable)
236
+
237
+ def full_focus(self) -> None:
238
+ self._CORE.full_focus()
239
+
240
+ def get_allowed_property_values(self, label: str, prop_name: str) -> list[str]:
241
+ '''
242
+ Get the allowed property values for a given device.
243
+
244
+ Parameters:
245
+ ----------
246
+ label : str
247
+ The label of the device.
248
+ prop_name : str
249
+ The name of the property.
250
+
251
+ Returns:
252
+ -------
253
+ list[str]
254
+ A list of allowed property values.
255
+
256
+ '''
257
+ return vec_to_list(self._CORE.get_allowed_property_values(label, prop_name))
258
+
259
+ def get_api_version_info(self) -> str:
260
+ return self._CORE.get_api_version_info()
261
+
262
+ def get_auto_focus_device(self) -> str:
263
+ return self._CORE.get_auto_focus_device()
264
+
265
+ def get_auto_focus_offset(self) -> float:
266
+ '''TODO: remove or fix freezing'''
267
+ return self._CORE.get_auto_focus_offset()
268
+
269
+ def get_auto_shutter(self) -> bool:
270
+ return self._CORE.get_auto_shutter()
271
+
272
+ def get_available_config_groups(self) -> list[str]:
273
+ return vec_to_list(self._CORE.get_available_config_groups())
274
+
275
+ def get_available_configs(self, config_group: str) -> list[str]:
276
+ return vec_to_list(self._CORE.get_available_configs(config_group))
277
+
278
+ def get_available_device_descriptions(self, library: str) -> list[str]:
279
+ '''TODO: Test this'''
280
+ '''TODO: remove or fix freezing'''
281
+ return vec_to_list(self._CORE.get_available_device_descriptions(library))
282
+
283
+ def get_available_devices(self, library: str) -> list[str]:
284
+ '''TODO: Test this'''
285
+ return vec_to_list(self._CORE.get_available_devices(library))
286
+
287
+ def get_available_device_types(self, library: str) -> list[int]:
288
+ '''TODO: Test this'''
289
+ return self._CORE.get_available_device_types(library)
290
+
291
+ def get_available_pixel_size_configs(self) -> list[str]:
292
+ return vec_to_list(self._CORE.get_available_pixel_size_configs())
293
+
294
+ # def get_available_property_blocks(self) -> list[str]:
295
+ # return vec_to_list(self._core.get_available_property_blocks())
296
+
297
+ def get_buffer_free_capacity(self) -> int:
298
+ return self._CORE.get_buffer_free_capacity()
299
+
300
+ def get_buffer_total_capacity(self) -> int:
301
+ return self._CORE.get_buffer_total_capacity()
302
+
303
+ def get_bytes_per_pixel(self) -> int:
304
+ return self._CORE.get_bytes_per_pixel()
305
+
306
+ def get_camera_channel_name(self, channel_nr: int) -> str:
307
+ return self._CORE.get_camera_channel_name(channel_nr)
308
+
309
+ def get_camera_device(self) -> str:
310
+ return self._CORE.get_camera_device()
311
+
312
+ def get_channel_group(self) -> str:
313
+ return self._CORE.get_channel_group()
314
+
315
+ def get_circular_buffer_memory_footprint(self) -> int:
316
+ return self._CORE.get_circular_buffer_memory_footprint()
317
+
318
+ def get_config_data(self, config_group: str, config_name: str) -> Any:
319
+ '''TODO: remove or fix freezing'''
320
+ return self._CORE.get_config_data(config_group, config_name)
321
+
322
+ def get_config_group_state(self, group: str) -> Any:
323
+ return self._CORE.get_config_group_state(group)
324
+
325
+ def get_config_group_state_from_cache(self, group: str) -> Any:
326
+ return self._CORE.get_config_group_state_from_cache(group)
327
+
328
+ def get_config_state(self, group: str, config: str) -> Any:
329
+ '''TODO: remove or fix freezing'''
330
+ return self._CORE.get_config_state(group, config)
331
+
332
+ def get_core_error_text(self, code: int) -> str:
333
+ return self._CORE.get_core_error_text(code)
334
+
335
+ def get_current_config(self, group_name: str) -> str:
336
+ return self._CORE.get_current_config(group_name)
337
+
338
+ def get_current_config_from_cache(self, group_name: str) -> str:
339
+ return self._CORE.get_current_config_from_cache(group_name)
340
+
341
+ def get_current_focus_score(self) -> float:
342
+ return self._CORE.get_current_focus_score()
343
+
344
+ def get_current_pixel_size_config(self, cached: bool = False) -> str:
345
+ return self._CORE.get_current_pixel_size_config(cached)
346
+
347
+ def get_data(self, state_device_label: str) -> Any:
348
+ return self._CORE.get_data(state_device_label)
349
+
350
+ def get_device_adapter_names(self) -> list[str]:
351
+ return vec_to_list(self._CORE.get_device_adapter_names())
352
+
353
+ def get_device_adapter_search_paths(self) -> list[str]:
354
+ return vec_to_list(self._CORE.get_device_adapter_search_paths())
355
+
356
+ def get_device_delay_ms(self, label: str) -> float:
357
+ return self._CORE.get_device_delay_ms(label)
358
+
359
+ def get_device_description(self, label: str) -> str:
360
+ return self._CORE.get_device_description(label)
361
+
362
+ # @staticmethod
363
+ # def get_device_libraries() -> list[str]:
364
+ # return vec_to_list(Core.get_device_libraries())
365
+
366
+ # def get_device_library(self, label: str) -> str:
367
+ # return self._core.get_device_library(label)
368
+
369
+ def get_device_name(self, label: str) -> str:
370
+ return self._CORE.get_device_name(label)
371
+
372
+ def get_device_property_names(self, label: str) -> list[str]:
373
+ return vec_to_list(self._CORE.get_device_property_names(label))
374
+
375
+ def get_device_type(self, label: str) -> DeviceType:
376
+ res = self._CORE.get_device_type(label)
377
+ if res and hasattr(res, 'swig_value'):
378
+ return DeviceType(res.swig_value())
379
+ elif isinstance(res, int):
380
+ return DeviceType(res)
381
+
382
+ return None
383
+
384
+ def get_exposure(self, label: Optional[str] = None) -> float:
385
+ if label is None:
386
+ return self._CORE.get_exposure()
387
+ else:
388
+ return self._CORE.get_exposure(label)
389
+
390
+ def get_exposure_sequence_max_length(self, camera_label: str) -> int:
391
+ '''TODO: remove or fix freezing'''
392
+ return self._CORE.get_exposure_sequence_max_length(camera_label)
393
+
394
+ def get_focus_device(self) -> str:
395
+ return self._CORE.get_focus_device()
396
+
397
+ def get_focus_direction(self, stage_label: str) -> FocusDirection:
398
+ return FocusDirection(self._CORE.get_focus_direction(stage_label))
399
+
400
+ def get_galvo_channel(self, galvo_label: str) -> str:
401
+ '''TODO: Test this'''
402
+ return self._CORE.get_galvo_channel(galvo_label)
403
+
404
+ def get_galvo_device(self) -> str:
405
+ return self._CORE.get_galvo_device()
406
+
407
+ def get_galvo_position(self, galvo_device: str) -> tuple[float, float]:
408
+ '''TODO: Test this'''
409
+ return self._CORE.get_galvo_position(galvo_device)
410
+
411
+ def get_galvo_x_minimum(self, galvo_label: str) -> float:
412
+ '''TODO: Test this'''
413
+ return self._CORE.get_galvo_x_minimum(galvo_label)
414
+
415
+ def get_galvo_x_range(self, galvo_label: str) -> float:
416
+ '''TODO: Test this'''
417
+ return self._CORE.get_galvo_x_range(galvo_label)
418
+
419
+ def get_galvo_y_minimum(self, galvo_label: str) -> float:
420
+ '''TODO: Test this'''
421
+ return self._CORE.get_galvo_y_minimum(galvo_label)
422
+
423
+ def get_galvo_y_range(self, galvo_label: str) -> float:
424
+ '''TODO: Test this'''
425
+ return self._CORE.get_galvo_y_range(galvo_label)
426
+
427
+ # def get_host_name(self) -> str:
428
+ # return self._core.get_host_name()
429
+
430
+ def get_image(self, num_channel: Optional[int] = None) -> Any:
431
+ if num_channel is None:
432
+ return self._CORE.get_image()
433
+ else:
434
+ return self._CORE.get_image(num_channel)
435
+
436
+ def get_image_bit_depth(self) -> int:
437
+ return self._CORE.get_image_bit_depth()
438
+
439
+ def get_image_buffer_size(self) -> int:
440
+ return self._CORE.get_image_buffer_size()
441
+
442
+ def get_image_height(self) -> int:
443
+ return self._CORE.get_image_height()
444
+
445
+ def get_image_processor_device(self) -> str:
446
+ return self._CORE.get_image_processor_device()
447
+
448
+ def get_image_width(self) -> int:
449
+ return self._CORE.get_image_width()
450
+
451
+ def get_installed_device_description(
452
+ self, hub_label: str, peripheral_label: str
453
+ ) -> str:
454
+ return self._CORE.get_installed_device_description(hub_label, peripheral_label)
455
+
456
+ def get_installed_devices(self, hub_label: str) -> list[str]:
457
+ return vec_to_list(self._CORE.get_installed_devices(hub_label))
458
+
459
+ def get_last_focus_score(self) -> float:
460
+ return self._CORE.get_last_focus_score()
461
+
462
+ def get_last_image(self) -> Any:
463
+ return self._CORE.get_last_image()
464
+
465
+ def get_last_image_md(
466
+ self,
467
+ channel: Optional[int] = None,
468
+ slice: Optional[int] = None,
469
+ md: Optional[Any] = None,
470
+ ) -> Any:
471
+ '''TODO: Test this'''
472
+ if channel is None and slice is None:
473
+ return self._CORE.get_last_image_md(md)
474
+ else:
475
+ return self._CORE.get_last_image_md(channel, slice, md)
476
+
477
+ def get_last_tagged_image(self, camera_channel_index: Optional[int] = None) -> Any:
478
+ '''TODO: Test this'''
479
+ if camera_channel_index is None:
480
+ return self._CORE.get_last_tagged_image()
481
+ else:
482
+ return self._CORE.get_last_tagged_image(camera_channel_index)
483
+
484
+ def get_loaded_devices(self) -> list[str]:
485
+ return vec_to_list(self._CORE.get_loaded_devices())
486
+
487
+ def get_loaded_devices_of_type(self, dev_type: DeviceType) -> list[str]:
488
+ type = self._CORE._bridge._get_java_class('mmcorej.DeviceType').swig_to_enum(
489
+ dev_type.value
490
+ )
491
+ return vec_to_list(self._CORE.get_loaded_devices_of_type(type))
492
+
493
+ def get_loaded_peripheral_devices(self, hub_label: str) -> list[str]:
494
+ return vec_to_list(self._CORE.get_loaded_peripheral_devices(hub_label))
495
+
496
+ # def get_mac_addresses(self) -> list[str]:
497
+ # return vec_to_list(self._core.get_mac_addresses())
498
+
499
+ def get_magnification_factor(self) -> float:
500
+ return self._CORE.get_magnification_factor()
501
+
502
+ def get_multi_roi(self) -> list[Any]:
503
+ return vec_to_list(self._CORE.get_multi_roi())
504
+
505
+ def get_n_before_last_image_md(self, n: int, md: Any) -> Any:
506
+ '''TODO: Test this'''
507
+ return self._CORE.get_n_before_last_image_md(n, md)
508
+
509
+ def get_n_before_last_tagged_image(self, n: int) -> Any:
510
+ '''TODO: Test this'''
511
+ return self._CORE.get_n_before_last_tagged_image(n)
512
+
513
+ def get_number_of_camera_channels(self) -> int:
514
+ return self._CORE.get_number_of_camera_channels()
515
+
516
+ def get_number_of_components(self) -> int:
517
+ return self._CORE.get_number_of_components()
518
+
519
+ # def get_number_of_devices(self) -> int:
520
+ # return self._core.get_number_of_devices()
521
+
522
+ # def get_number_of_device_types(self) -> int:
523
+ # return self._core.get_number_of_device_types()
524
+
525
+ def get_number_of_galvo_polygons(self, galvo_label: str) -> int:
526
+ '''TODO: Test this'''
527
+ return self._CORE.get_number_of_galvo_polygons(galvo_label)
528
+
529
+ # def get_number_of_images(self) -> int:
530
+ # return self._core.get_number_of_images()
531
+
532
+ def get_number_of_states(self, state_device_label: str) -> int:
533
+ '''TODO: Test this'''
534
+ return self._CORE.get_number_of_states(state_device_label)
535
+
536
+ def get_parent_label(self, peripheral_label: str) -> str:
537
+ '''TODO: Test this'''
538
+ return self._CORE.get_parent_label(peripheral_label)
539
+
540
+ def get_pixel_size_affine(self, cached: bool = False) -> list[float]:
541
+ return vec_to_list(self._CORE.get_pixel_size_affine(cached))
542
+
543
+ def get_pixel_size_affine_as_string(self) -> str:
544
+ return self._CORE.get_pixel_size_affine_as_string()
545
+
546
+ def get_pixel_size_affine_by_id(self, resolution_id: str) -> list[float]:
547
+ '''TODO: freezes need to find resolution id'''
548
+ return vec_to_list(self._CORE.get_pixel_size_affine_by_id(resolution_id))
549
+
550
+ def get_pixel_size_config_data(self, config_name: str) -> Any:
551
+ '''TODO: freezes need to find config name = resolution id, e.g., Res10x'''
552
+ return config_to_dict(self._CORE.get_pixel_size_config_data(config_name))
553
+
554
+ def get_pixel_size_um(self, cached: bool = False) -> float:
555
+ return self._CORE.get_pixel_size_um(cached)
556
+
557
+ def get_pixel_size_um_by_id(self, resolution_id: str) -> float:
558
+ return self._CORE.get_pixel_size_um_by_id(resolution_id)
559
+
560
+ def get_position(self, stage_label: Optional[str] = None) -> float:
561
+ if stage_label is None:
562
+ return self._CORE.get_position()
563
+ else:
564
+ return self._CORE.get_position(stage_label)
565
+
566
+ def get_primary_log_file(self) -> str:
567
+ return self._CORE.get_primary_log_file()
568
+
569
+ def get_property(self, label: str, prop_name: str) -> str:
570
+ return self._CORE.get_property(label, prop_name)
571
+
572
+ # def get_property_block_data(self, block_name: str) -> Any:
573
+ # return self._core.get_property_block_data(block_name)
574
+
575
+ def get_property_from_cache(self, device_label: str, prop_name: str) -> str:
576
+ return self._CORE.get_property_from_cache(device_label, prop_name)
577
+
578
+ def get_property_lower_limit(self, label: str, prop_name: str) -> float:
579
+ return self._CORE.get_property_lower_limit(label, prop_name)
580
+
581
+ def get_property_sequence_max_length(self, label: str, prop_name: str) -> int:
582
+ '''TODO: freezes'''
583
+ return self._CORE.get_property_sequence_max_length(label, prop_name)
584
+
585
+ def get_property_type(self, label: str, prop_name: str) -> PropertyType:
586
+ return PropertyType.from_java(self._CORE.get_property_type(label, prop_name))
587
+
588
+ def get_property_upper_limit(self, label: str, prop_name: str) -> float:
589
+ return self._CORE.get_property_upper_limit(label, prop_name)
590
+
591
+ def get_property_limits(self, label: str, prop_name: str) -> tuple[float, float]:
592
+ if not self.has_property_limits(label, prop_name):
593
+ return None, None
594
+
595
+ return self.get_property_lower_limit(
596
+ label, prop_name
597
+ ), self.get_property_upper_limit(label, prop_name)
598
+
599
+ def get_remaining_image_count(self) -> int:
600
+ return self._CORE.get_remaining_image_count()
601
+
602
+ def get_roi(self, label: Optional[str] = None) -> tuple[int, int, int, int]:
603
+ '''
604
+ Get the region of interest (ROI) coordinates.
605
+
606
+ Parameters
607
+ ----------
608
+ label : str, optional
609
+ The label of the ROI. If None, the default ROI will be used.
610
+
611
+ Returns
612
+ -------
613
+ tuple
614
+ A tuple containing the x, y, width, and height of the ROI.
615
+ '''
616
+ roi = self._CORE.get_roi() if label is None else self._CORE.get_roi(label)
617
+
618
+ return roi.x, roi.y, roi.width, roi.height
619
+
620
+ def get_serial_port_answer(self, port_label: str, term: str) -> str:
621
+ '''TODO: to be tested'''
622
+ return self._CORE.get_serial_port_answer(port_label, term)
623
+
624
+ def get_shutter_device(self) -> str:
625
+ return self._CORE.get_shutter_device()
626
+
627
+ def get_shutter_open(self, shutter_label: Optional[str] = None) -> bool:
628
+ if shutter_label is None:
629
+ return self._CORE.get_shutter_open()
630
+ else:
631
+ return self._CORE.get_shutter_open(shutter_label)
632
+
633
+ def get_slm_bytes_per_pixel(self, slm_label: str) -> int:
634
+ '''TODO: to be tested'''
635
+ return self._CORE.get_slm_bytes_per_pixel(slm_label)
636
+
637
+ def get_slm_device(self) -> str:
638
+ return self._CORE.get_slm_device()
639
+
640
+ def get_slm_exposure(self, slm_label: str) -> float:
641
+ '''TODO: to be tested'''
642
+ return self._CORE.get_slm_exposure(slm_label)
643
+
644
+ def get_slm_height(self, slm_label: str) -> int:
645
+ '''TODO: to be tested'''
646
+ return self._CORE.get_slm_height(slm_label)
647
+
648
+ def get_slm_number_of_components(self, slm_label: str) -> int:
649
+ '''TODO: to be tested'''
650
+ return self._CORE.get_slm_number_of_components(slm_label)
651
+
652
+ def get_slm_sequence_max_length(self, slm_label: str) -> int:
653
+ '''TODO: to be tested'''
654
+ return self._CORE.get_slm_sequence_max_length(slm_label)
655
+
656
+ def get_slm_width(self, slm_label: str) -> int:
657
+ '''TODO: to be tested'''
658
+ return self._CORE.get_slm_width(slm_label)
659
+
660
+ def get_stage_sequence_max_length(self, stage_label: str) -> int:
661
+ '''TODO: freezes'''
662
+ return self._CORE.get_stage_sequence_max_length(stage_label)
663
+
664
+ def get_state(self, state_device_label: str) -> int:
665
+ return self._CORE.get_state(state_device_label)
666
+
667
+ def get_state_from_label(self, state_device_label: str, state_label: str) -> int:
668
+ return self._CORE.get_state_from_label(state_device_label, state_label)
669
+
670
+ def get_state_label(self, state_device_label: str) -> str:
671
+ return self._CORE.get_state_label(state_device_label)
672
+
673
+ # def get_state_label_data(self, state_device_label: str, state_label: str) -> Any:
674
+ # return self._core.get_state_label_data(state_device_label, state_label)
675
+
676
+ def get_state_labels(self, state_device_label: str) -> list[str]:
677
+ return vec_to_list(self._CORE.get_state_labels(state_device_label))
678
+
679
+ def get_system_state(self) -> dict:
680
+ return group_config_dict(config_to_dict(self._CORE.get_system_state()))
681
+
682
+ def get_system_state_cache(self) -> Any:
683
+ return group_config_dict(config_to_dict(self._CORE.get_system_state_cache()))
684
+
685
+ def get_tagged_image(self, camera_channel_index: Optional[int] = None) -> Any:
686
+ if camera_channel_index is None:
687
+ return self._CORE.get_tagged_image()
688
+ else:
689
+ return self._CORE.get_tagged_image(camera_channel_index)
690
+
691
+ def get_timeout_ms(self) -> int:
692
+ return self._CORE.get_timeout_ms()
693
+
694
+ # def get_user_id(self) -> str:
695
+ # return self._core.get_user_id()
696
+
697
+ def get_version_info(self) -> str:
698
+ return self._CORE.get_version_info()
699
+
700
+ def get_x_position(self, xy_stage_label: Optional[str] = None) -> float:
701
+ if xy_stage_label is None:
702
+ return self._CORE.get_x_position()
703
+ else:
704
+ return self._CORE.get_x_position(xy_stage_label)
705
+
706
+ def get_xy_position(
707
+ self, x_stage, y_stage, xy_stage_label: Optional[str] = None
708
+ ) -> tuple[float, float]:
709
+ '''TODO: test and understand'''
710
+ if xy_stage_label is None:
711
+ return self._CORE.get_xy_position(x_stage, y_stage)
712
+ else:
713
+ return self._CORE.get_xy_position(xy_stage_label, x_stage, y_stage)
714
+
715
+ def get_xy_stage_device(self) -> str:
716
+ return self._CORE.get_xy_stage_device()
717
+
718
+ def get_xy_stage_position(self, stage: Optional[str] = None) -> tuple[float, float]:
719
+ '''
720
+ Get the XY stage position.
721
+
722
+ Parameters
723
+ ----------
724
+ stage : str, optional
725
+ The name of the stage. If None, the default stage will be used.
726
+
727
+ Returns
728
+ -------
729
+ xy_position : tuple[float, float]
730
+ The X and Y coordinates of the stage position.
731
+ '''
732
+ if stage is None:
733
+ res = self._CORE.get_xy_stage_position()
734
+ else:
735
+ res = self._CORE.get_xy_stage_position(stage)
736
+
737
+ return res.x, res.y
738
+
739
+ def get_xy_stage_sequence_max_length(self, xy_stage_label: str) -> int:
740
+ '''TODO: freezes, test and understand'''
741
+ return self._CORE.get_xy_stage_sequence_max_length(xy_stage_label)
742
+
743
+ def get_y_position(self, xy_stage_label: Optional[str] = None) -> float:
744
+ if xy_stage_label is None:
745
+ return self._CORE.get_y_position()
746
+ else:
747
+ return self._CORE.get_y_position(xy_stage_label)
748
+
749
+ def has_property(self, label: str, prop_name: str) -> bool:
750
+ return self._CORE.has_property(label, prop_name)
751
+
752
+ def has_property_limits(self, label: str, prop_name: str) -> bool:
753
+ return self._CORE.has_property_limits(label, prop_name)
754
+
755
+ def home(self, xy_or_z_stage_label: str) -> None:
756
+ '''TODO: freezes, test and understand'''
757
+ self._CORE.home(xy_or_z_stage_label)
758
+
759
+ def incremental_focus(self) -> None:
760
+ '''TODO: freezes, test and understand'''
761
+ self._CORE.incremental_focus()
762
+
763
+ def initialize_all_devices(self) -> None:
764
+ '''TODO: freezes, test and understand'''
765
+ self._CORE.initialize_all_devices()
766
+
767
+ def initialize_circular_buffer(self) -> None:
768
+ self._CORE.initialize_circular_buffer()
769
+
770
+ def initialize_device(self, label: str) -> None:
771
+ '''TODO: freezes, test and understand'''
772
+ self._CORE.initialize_device(label)
773
+
774
+ def is_buffer_overflowed(self) -> bool:
775
+ return self._CORE.is_buffer_overflowed()
776
+
777
+ def is_config_defined(self, group_name: str, config_name: str) -> bool:
778
+ return self._CORE.is_config_defined(group_name, config_name)
779
+
780
+ def is_continuous_focus_drive(self, stage_label: str) -> bool:
781
+ return self._CORE.is_continuous_focus_drive(stage_label)
782
+
783
+ def is_continuous_focus_enabled(self) -> bool:
784
+ return self._CORE.is_continuous_focus_enabled()
785
+
786
+ def is_continuous_focus_locked(self) -> bool:
787
+ return self._CORE.is_continuous_focus_locked()
788
+
789
+ def is_exposure_sequenceable(self, camera_label: str) -> bool:
790
+ return self._CORE.is_exposure_sequenceable(camera_label)
791
+
792
+ def is_group_defined(self, group_name: str) -> bool:
793
+ return self._CORE.is_group_defined(group_name)
794
+
795
+ def is_multi_roi_enabled(self) -> bool:
796
+ return self._CORE.is_multi_roi_enabled()
797
+
798
+ def is_multi_roi_supported(self) -> bool:
799
+ return self._CORE.is_multi_roi_supported()
800
+
801
+ def is_pixel_size_config_defined(self, resolution_id: str) -> bool:
802
+ return self._CORE.is_pixel_size_config_defined(resolution_id)
803
+
804
+ def is_property_pre_init(self, label: str, prop_name: str) -> bool:
805
+ return self._CORE.is_property_pre_init(label, prop_name)
806
+
807
+ def is_property_read_only(self, label: str, prop_name: str) -> bool:
808
+ return self._CORE.is_property_read_only(label, prop_name)
809
+
810
+ def is_property_sequenceable(self, label: str, prop_name: str) -> bool:
811
+ return self._CORE.is_property_sequenceable(label, prop_name)
812
+
813
+ def is_sequence_running(self, camera_label: Optional[str] = None) -> bool:
814
+ if camera_label is None:
815
+ return self._CORE.is_sequence_running()
816
+ else:
817
+ return self._CORE.is_sequence_running(camera_label)
818
+
819
+ def is_stage_linear_sequenceable(self, stage_label: str) -> bool:
820
+ return self._CORE.is_stage_linear_sequenceable(stage_label)
821
+
822
+ def is_stage_sequenceable(self, stage_label: str) -> bool:
823
+ return self._CORE.is_stage_sequenceable(stage_label)
824
+
825
+ def is_xy_stage_sequenceable(self, xy_stage_label: str) -> bool:
826
+ return self._CORE.is_xy_stage_sequenceable(xy_stage_label)
827
+
828
+ def load_device(self, label: str, module_name: str, device_name: str) -> None:
829
+ '''TODO: freezes, test and understand'''
830
+ self._CORE.load_device(label, module_name, device_name)
831
+
832
+ def load_exposure_sequence(
833
+ self, camera_label: str, exposure_sequence_ms: list[float]
834
+ ) -> None:
835
+ if self.is_exposure_sequenceable():
836
+ self._CORE.load_exposure_sequence(camera_label, exposure_sequence_ms)
837
+ else:
838
+ raise ValueError(
839
+ f'Exposure sequence is not supported for camera {camera_label}'
840
+ )
841
+
842
+ def load_galvo_polygons(self, galvo_label: str) -> None:
843
+ '''TODO: freezes, test and understand'''
844
+ self._CORE.load_galvo_polygons(galvo_label)
845
+
846
+ def load_property_sequence(
847
+ self, label: str, prop_name: str, event_sequence: list[str]
848
+ ) -> None:
849
+ if self.is_property_sequenceable(label, prop_name):
850
+ self._CORE.load_property_sequence(label, prop_name, event_sequence)
851
+ else:
852
+ raise ValueError(
853
+ f'Property sequence for {label} property {prop_name} is not supported'
854
+ )
855
+
856
+ def load_slm_sequence(self, slm_label: str, image_sequence: list[bytes]) -> None:
857
+ '''TODO: freezes, test and understand'''
858
+ self._CORE.load_slm_sequence(slm_label, image_sequence)
859
+
860
+ def load_stage_sequence(
861
+ self, stage_label: str, position_sequence: list[float]
862
+ ) -> None:
863
+ if self.is_stage_sequenceable(stage_label):
864
+ self._CORE.load_stage_sequence(stage_label, position_sequence)
865
+ else:
866
+ raise ValueError(f'Stage sequence for {stage_label} is not supported')
867
+
868
+ def load_system_configuration(self, file_name: str) -> None:
869
+ '''TODO: test'''
870
+ self._CORE.load_system_configuration(file_name)
871
+
872
+ def load_system_state(self, file_name: str) -> None:
873
+ '''TODO: test'''
874
+ self._CORE.load_system_state(file_name)
875
+
876
+ def load_xy_stage_sequence(
877
+ self, xy_stage_label: str, x_sequence: list[float], y_sequence: list[float]
878
+ ) -> None:
879
+ if self.is_xy_stage_sequenceable(xy_stage_label):
880
+ self._CORE.load_xy_stage_sequence(xy_stage_label, x_sequence, y_sequence)
881
+ else:
882
+ raise ValueError(f'XY stage sequence for {xy_stage_label} is not supported')
883
+
884
+ def log_message(self, msg: str, debug_only: bool = False) -> None:
885
+ self._CORE.log_message(msg, debug_only)
886
+
887
+ def point_galvo_and_fire(
888
+ self, galvo_label: str, x: float, y: float, pulse_time_us: float
889
+ ) -> None:
890
+ '''TODO: test'''
891
+ self._CORE.point_galvo_and_fire(galvo_label, x, y, pulse_time_us)
892
+
893
+ def pop_next_image(self) -> Any:
894
+ '''TODO: test'''
895
+ return self._CORE.pop_next_image()
896
+
897
+ def pop_next_image_md(
898
+ self,
899
+ channel: Optional[int] = None,
900
+ slice: Optional[int] = None,
901
+ md: Optional[Any] = None,
902
+ ) -> Any:
903
+ '''TODO: test'''
904
+ if channel is None and slice is None:
905
+ return self._CORE.pop_next_image_md(md)
906
+ else:
907
+ return self._CORE.pop_next_image_md(channel, slice, md)
908
+
909
+ def pop_next_tagged_image(self, camera_channel_index: Optional[int] = None) -> Any:
910
+ '''TODO: test'''
911
+ if camera_channel_index is None:
912
+ return self._CORE.pop_next_tagged_image()
913
+ else:
914
+ return self._CORE.pop_next_tagged_image(camera_channel_index)
915
+
916
+ def prepare_sequence_acquisition(self, camera_label: str) -> None:
917
+ self._CORE.prepare_sequence_acquisition(camera_label)
918
+
919
+ def read_from_serial_port(self, port_label: str) -> bytes:
920
+ '''TODO: test, freezes'''
921
+ return self._CORE.read_from_serial_port(port_label)
922
+
923
+ def register_callback(self, cb: Any) -> None:
924
+ '''TODO: test'''
925
+ self._CORE.register_callback(cb)
926
+
927
+ # def remove_image_synchro(self, device_label: str) -> None:
928
+ # '''TODO: test, freezes'''
929
+ # self._CORE.remove_image_synchro(device_label)
930
+
931
+ # def remove_image_synchro_all(self) -> None:
932
+ # self._core.remove_image_synchro_all()
933
+
934
+ def rename_config(
935
+ self, group_name: str, old_config_name: str, new_config_name: str
936
+ ) -> None:
937
+ '''TODO: test'''
938
+ self._CORE.rename_config(group_name, old_config_name, new_config_name)
939
+
940
+ def rename_config_group(self, old_group_name: str, new_group_name: str) -> None:
941
+ '''TODO: test'''
942
+ self._CORE.rename_config_group(old_group_name, new_group_name)
943
+
944
+ def rename_pixel_size_config(
945
+ self, old_config_name: str, new_config_name: str
946
+ ) -> None:
947
+ '''TODO: test'''
948
+ self._CORE.rename_pixel_size_config(old_config_name, new_config_name)
949
+
950
+ def reset(self) -> None:
951
+ self._CORE.reset()
952
+
953
+ def run_galvo_polygons(self, galvo_label: str) -> None:
954
+ '''TODO: test'''
955
+ self._CORE.run_galvo_polygons(galvo_label)
956
+
957
+ def run_galvo_sequence(self, galvo_label: str) -> None:
958
+ '''TODO: test'''
959
+ self._CORE.run_galvo_sequence(galvo_label)
960
+
961
+ def save_system_configuration(self, file_name: str) -> None:
962
+ '''TODO: freezes'''
963
+ self._CORE.save_system_configuration(file_name)
964
+
965
+ def save_system_state(self, file_name: str) -> None:
966
+ '''TODO: freezes'''
967
+ self._CORE.save_system_state(file_name)
968
+
969
+ def set_adapter_origin(
970
+ self, new_z_um: float, stage_label: Optional[str] = None
971
+ ) -> None:
972
+ '''TODO: freezes'''
973
+ if stage_label is None:
974
+ self._CORE.set_adapter_origin(new_z_um)
975
+ else:
976
+ self._CORE.set_adapter_origin(stage_label, new_z_um)
977
+
978
+ def set_adapter_origin_xy(
979
+ self, new_x_um: float, new_y_um: float, xy_stage_label: Optional[str] = None
980
+ ) -> None:
981
+ '''TODO: freezes'''
982
+ if xy_stage_label is None:
983
+ self._CORE.set_adapter_origin_xy(new_x_um, new_y_um)
984
+ else:
985
+ self._CORE.set_adapter_origin_xy(xy_stage_label, new_x_um, new_y_um)
986
+
987
+ def set_auto_focus_device(self, focus_label: str) -> None:
988
+ '''TODO: test'''
989
+ self._CORE.set_auto_focus_device(focus_label)
990
+
991
+ def set_auto_focus_offset(self, offset: float) -> None:
992
+ self._CORE.set_auto_focus_offset(offset)
993
+
994
+ def set_auto_shutter(self, state: bool) -> None:
995
+ self._CORE.set_auto_shutter(state)
996
+
997
+ def set_camera_device(self, camera_label: str) -> None:
998
+ self._CORE.set_camera_device(camera_label)
999
+
1000
+ def set_channel_group(self, channel_group: str) -> None:
1001
+ self._CORE.set_channel_group(channel_group)
1002
+
1003
+ def set_circular_buffer_memory_footprint(self, size_mb: int) -> None:
1004
+ self._CORE.set_circular_buffer_memory_footprint(size_mb)
1005
+
1006
+ def set_config(self, group_name: str, config_name: str) -> None:
1007
+ self._CORE.set_config(group_name, config_name)
1008
+
1009
+ def set_device_adapter_search_paths(self, paths: list[str]) -> None:
1010
+ '''TODO: test'''
1011
+ self._CORE.set_device_adapter_search_paths(paths)
1012
+
1013
+ def set_device_delay_ms(self, label: str, delay_ms: float) -> None:
1014
+ self._CORE.set_device_delay_ms(label, delay_ms)
1015
+
1016
+ def set_exposure(self, exp: float, camera_label: Optional[str] = None) -> None:
1017
+ if camera_label is None:
1018
+ self._CORE.set_exposure(exp)
1019
+ else:
1020
+ self._CORE.set_exposure(camera_label, exp)
1021
+
1022
+ def set_focus_device(self, focus_label: str) -> None:
1023
+ self._CORE.set_focus_device(focus_label)
1024
+
1025
+ def set_focus_direction(self, stage_label: str, sign: int) -> None:
1026
+ self._CORE.set_focus_direction(stage_label, sign)
1027
+
1028
+ def set_galvo_device(self, galvo_label: str) -> None:
1029
+ '''TODO: test'''
1030
+ self._CORE.set_galvo_device(galvo_label)
1031
+
1032
+ def set_galvo_illumination_state(self, galvo_label: str, on: bool) -> None:
1033
+ '''TODO: test'''
1034
+ self._CORE.set_galvo_illumination_state(galvo_label, on)
1035
+
1036
+ def set_galvo_polygon_repetitions(self, galvo_label: str, repetitions: int) -> None:
1037
+ '''TODO: test'''
1038
+ self._CORE.set_galvo_polygon_repetitions(galvo_label, repetitions)
1039
+
1040
+ def set_galvo_position(self, galvo_label: str, x: float, y: float) -> None:
1041
+ '''TODO: test'''
1042
+ self._CORE.set_galvo_position(galvo_label, x, y)
1043
+
1044
+ def set_galvo_spot_interval(self, galvo_label: str, pulse_time_us: float) -> None:
1045
+ '''TODO: test'''
1046
+ self._CORE.set_galvo_spot_interval(galvo_label, pulse_time_us)
1047
+
1048
+ def set_image_processor_device(self, proc_label: str) -> None:
1049
+ '''TODO: test'''
1050
+ self._CORE.set_image_processor_device(proc_label)
1051
+
1052
+ def set_metadata_profile(self, profile: MetadataProfile) -> None:
1053
+ self._CORE.set_metadata_profile(profile.value)
1054
+
1055
+ def set_multi_roi(self, rois: list[Any]) -> None:
1056
+ '''TODO: test'''
1057
+ self._CORE.set_multi_roi(rois)
1058
+
1059
+ def set_origin(self, stage_label: Optional[str] = None) -> None:
1060
+ if stage_label is None:
1061
+ self._CORE.set_origin()
1062
+ else:
1063
+ self._CORE.set_origin(stage_label)
1064
+
1065
+ def set_origin_x(self, xy_stage_label: Optional[str] = None) -> None:
1066
+ if xy_stage_label is None:
1067
+ self._CORE.set_origin_x()
1068
+ else:
1069
+ self._CORE.set_origin_x(xy_stage_label)
1070
+
1071
+ def set_origin_xy(self, xy_stage_label: Optional[str] = None) -> None:
1072
+ if xy_stage_label is None:
1073
+ self._CORE.set_origin_xy()
1074
+ else:
1075
+ self._CORE.set_origin_xy(xy_stage_label)
1076
+
1077
+ def set_origin_y(self, xy_stage_label: Optional[str] = None) -> None:
1078
+ if xy_stage_label is None:
1079
+ self._CORE.set_origin_y()
1080
+ else:
1081
+ self._CORE.set_origin_y(xy_stage_label)
1082
+
1083
+ def set_parent_label(self, device_label: str, parent_hub_label: str) -> None:
1084
+ '''TODO: test'''
1085
+ self._CORE.set_parent_label(device_label, parent_hub_label)
1086
+
1087
+ def set_pixel_size_affine(self, resolution_id: str, affine: list[float]) -> None:
1088
+ '''TODO: Error does not accept list, needs mmcorej.DoubleVector'''
1089
+ self._CORE.set_pixel_size_affine(resolution_id, affine)
1090
+
1091
+ def set_pixel_size_config(self, resolution_id: str) -> None:
1092
+ self._CORE.set_pixel_size_config(resolution_id)
1093
+
1094
+ def set_pixel_size_um(self, resolution_id: str, pix_size: float) -> None:
1095
+ self._CORE.set_pixel_size_um(resolution_id, pix_size)
1096
+
1097
+ def set_position(self, position: float, stage_label: Optional[str] = None) -> None:
1098
+ if stage_label is None:
1099
+ self._CORE.set_position(position)
1100
+ else:
1101
+ self._CORE.set_position(stage_label, position)
1102
+
1103
+ def set_primary_log_file(self, filename: str, truncate: bool = False) -> None:
1104
+ '''TODO: test'''
1105
+ self._CORE.set_primary_log_file(filename, truncate)
1106
+
1107
+ def set_property(self, label: str, prop_name: str, prop_value: Any) -> None:
1108
+ if self.is_property_read_only(label, prop_name):
1109
+ raise ValueError(f'Property {prop_name} is read-only for device {label}')
1110
+
1111
+ if not self.has_property(label, prop_name):
1112
+ raise ValueError(f'Property {prop_name} does not exist for device {label}')
1113
+
1114
+ type = self.get_property_type(label, prop_name).to_python()
1115
+ if isinstance(prop_value, type):
1116
+ if self.has_property_limits(label, prop_name):
1117
+ prop_min = self.get_property_lower_limit(label, prop_name)
1118
+ prop_max = self.get_property_upper_limit(label, prop_name)
1119
+ prop_value = max(prop_min, min(prop_value, prop_max))
1120
+
1121
+ allowed = self.get_allowed_property_values(label, prop_name)
1122
+ if allowed and str(prop_value) not in allowed:
1123
+ raise ValueError(
1124
+ f'Property {prop_name} must be one of {allowed}, not {prop_value}'
1125
+ )
1126
+
1127
+ self._CORE.set_property(label, prop_name, str(prop_value))
1128
+ else:
1129
+ raise ValueError(f'Property {prop_name} must be of type {type}')
1130
+
1131
+ def set_relative_position(
1132
+ self, d: float, stage_label: Optional[str] = None
1133
+ ) -> None:
1134
+ if stage_label is None:
1135
+ self._CORE.set_relative_position(d)
1136
+ else:
1137
+ self._CORE.set_relative_position(stage_label, d)
1138
+
1139
+ def set_relative_xy_position(
1140
+ self, dx: float, dy: float, xy_stage_label: Optional[str] = None
1141
+ ) -> None:
1142
+ if xy_stage_label is None:
1143
+ self._CORE.set_relative_xy_position(dx, dy)
1144
+ else:
1145
+ self._CORE.set_relative_xy_position(xy_stage_label, dx, dy)
1146
+
1147
+ def set_roi(
1148
+ self, x: int, y: int, x_size: int, y_size: int, label: Optional[str] = None
1149
+ ) -> None:
1150
+ if label is None:
1151
+ self._CORE.set_roi(x, y, x_size, y_size)
1152
+ else:
1153
+ self._CORE.set_roi(label, x, y, x_size, y_size)
1154
+
1155
+ # def set_serial_port_command(
1156
+ # self, port_label: str, command: str, term: str) -> None:
1157
+ # self._CORE.set_serial_port_command(port_label, command, term)
1158
+
1159
+ # def set_serial_properties(
1160
+ # self,
1161
+ # port_name: str,
1162
+ # answer_timeout: str,
1163
+ # baud_rate: str,
1164
+ # delay_between_chars_ms: str,
1165
+ # handshaking: str,
1166
+ # parity: str,
1167
+ # stop_bits: str,
1168
+ # ) -> None:
1169
+ # self._CORE.set_serial_properties(
1170
+ # port_name,
1171
+ # answer_timeout,
1172
+ # baud_rate,
1173
+ # delay_between_chars_ms,
1174
+ # handshaking,
1175
+ # parity,
1176
+ # stop_bits,
1177
+ # )
1178
+
1179
+ def set_shutter_device(self, shutter_label: str) -> None:
1180
+ self._CORE.set_shutter_device(shutter_label)
1181
+
1182
+ def set_shutter_open(
1183
+ self, state: bool, shutter_label: Optional[str] = None
1184
+ ) -> None:
1185
+ if shutter_label is None:
1186
+ self._CORE.set_shutter_open(state)
1187
+ else:
1188
+ self._CORE.set_shutter_open(shutter_label, state)
1189
+
1190
+ def set_slm_device(self, slm_label: str) -> None:
1191
+ '''TODO: test'''
1192
+ self._CORE.set_slm_device(slm_label)
1193
+
1194
+ def set_slm_exposure(self, slm_label: str, exposure_ms: float) -> None:
1195
+ '''TODO: test'''
1196
+ self._CORE.set_slm_exposure(slm_label, exposure_ms)
1197
+
1198
+ def set_slm_image(self, slm_label: str, pixels: Union[bytes, list[int]]) -> None:
1199
+ '''TODO: test'''
1200
+ self._CORE.set_slm_image(slm_label, pixels)
1201
+
1202
+ def set_slm_pixels_to(
1203
+ self,
1204
+ slm_label: str,
1205
+ intensity: int,
1206
+ red: Optional[int] = None,
1207
+ green: Optional[int] = None,
1208
+ blue: Optional[int] = None,
1209
+ ) -> None:
1210
+ '''TODO: test'''
1211
+ if red is None and green is None and blue is None:
1212
+ self._CORE.set_slm_pixels_to(slm_label, intensity)
1213
+ else:
1214
+ self._CORE.set_slm_pixels_to(slm_label, red, green, blue)
1215
+
1216
+ def set_stage_linear_sequence(
1217
+ self, stage_label: str, dz_um: float, n_slices: int
1218
+ ) -> None:
1219
+ if not self.is_stage_linear_sequenceable(stage_label):
1220
+ raise ValueError(f'Stage "{stage_label}" does not support linear sequences')
1221
+ self._CORE.set_stage_linear_sequence(stage_label, dz_um, n_slices)
1222
+
1223
+ def set_state(self, state_device_label: str, state: int) -> None:
1224
+ if self.get_device_type(state_device_label) != DeviceType.StateDevice:
1225
+ raise ValueError(f'Device "{state_device_label}" is not a state device')
1226
+
1227
+ n_states = self.get_number_of_states(state_device_label)
1228
+ if state < 0 or state >= n_states:
1229
+ raise ValueError(f'State must be between 0 and {n_states - 1}, not {state}')
1230
+ self._CORE.set_state(state_device_label, state)
1231
+
1232
+ def set_state_label(self, state_device_label: str, state_label: str) -> None:
1233
+ if self.get_device_type(state_device_label) != DeviceType.StateDevice:
1234
+ raise ValueError(f'Device "{state_device_label}" is not a state device')
1235
+ allowed = self.get_allowed_property_values(state_device_label, 'Label')
1236
+ if allowed and state_label not in allowed:
1237
+ raise ValueError(f'State label must be one of {allowed}, not {state_label}')
1238
+ self._CORE.set_state_label(state_device_label, state_label)
1239
+
1240
+ def set_system_state(self, conf: Any) -> None:
1241
+ '''TODO: most likely conf is expecting an mmcore java object'''
1242
+ self._CORE.set_system_state(conf)
1243
+
1244
+ def set_timeout_ms(self, timeout_ms: int) -> None:
1245
+ self._CORE.set_timeout_ms(timeout_ms)
1246
+
1247
+ def set_xy_position(
1248
+ self, x: float, y: float, xy_stage_label: Optional[str] = None
1249
+ ) -> None:
1250
+ if xy_stage_label is None:
1251
+ self._CORE.set_xy_position(x, y)
1252
+ else:
1253
+ self._CORE.set_xy_position(xy_stage_label, x, y)
1254
+
1255
+ def set_xy_stage_device(self, xy_stage_label: str) -> None:
1256
+ self._CORE.set_xy_stage_device(xy_stage_label)
1257
+
1258
+ def sleep(self, interval_ms: float) -> None:
1259
+ self._CORE.sleep(interval_ms)
1260
+
1261
+ def snap_image(self) -> None:
1262
+ self._CORE.snap_image()
1263
+
1264
+ def start_continuous_sequence_acquisition(self, interval_ms: float) -> None:
1265
+ '''TODO: test, most likely requires setting up the acq'''
1266
+ self._CORE.start_continuous_sequence_acquisition(interval_ms)
1267
+
1268
+ def start_exposure_sequence(self, camera_label: str) -> None:
1269
+ if not self.is_exposure_sequenceable(camera_label):
1270
+ raise ValueError(
1271
+ f'Exposure sequence is not supported for camera {camera_label}'
1272
+ )
1273
+
1274
+ self._CORE.start_exposure_sequence(camera_label)
1275
+
1276
+ def start_property_sequence(self, label: str, prop_name: str) -> None:
1277
+ if not self.is_property_sequenceable(label, prop_name):
1278
+ raise ValueError(
1279
+ f'Property sequence for {label} property {prop_name} is not supported'
1280
+ )
1281
+
1282
+ self._CORE.start_property_sequence(label, prop_name)
1283
+
1284
+ def start_secondary_log_file(
1285
+ self,
1286
+ filename: str,
1287
+ enable_debug: bool,
1288
+ truncate: bool = False,
1289
+ synchronous: bool = False,
1290
+ ) -> int:
1291
+ return self._CORE.start_secondary_log_file(
1292
+ filename, enable_debug, truncate, synchronous
1293
+ )
1294
+
1295
+ def start_sequence_acquisition(
1296
+ self,
1297
+ num_images: int,
1298
+ interval_ms: float,
1299
+ stop_on_overflow: bool,
1300
+ camera_label: Optional[str] = None,
1301
+ ) -> None:
1302
+ if camera_label is None:
1303
+ self._CORE.start_sequence_acquisition(
1304
+ num_images, interval_ms, stop_on_overflow
1305
+ )
1306
+ else:
1307
+ self._CORE.start_sequence_acquisition(
1308
+ camera_label, num_images, interval_ms, stop_on_overflow
1309
+ )
1310
+
1311
+ def start_slm_sequence(self, slm_label: str) -> None:
1312
+ '''TODO: test'''
1313
+ if not self.is_slm_sequenceable(slm_label):
1314
+ raise ValueError(f'SLM sequence for {slm_label} is not supported')
1315
+
1316
+ self._CORE.start_slm_sequence(slm_label)
1317
+
1318
+ def start_stage_sequence(self, stage_label: str) -> None:
1319
+ '''TODO: test'''
1320
+ if not self.is_stage_sequenceable(stage_label):
1321
+ raise ValueError(f'Stage sequence for {stage_label} is not supported')
1322
+
1323
+ self._CORE.start_stage_sequence(stage_label)
1324
+
1325
+ def start_xy_stage_sequence(self, xy_stage_label: str) -> None:
1326
+ '''TODO: test'''
1327
+ if not self.is_xy_stage_sequenceable(xy_stage_label):
1328
+ raise ValueError(f'XY stage sequence for {xy_stage_label} is not supported')
1329
+
1330
+ self._CORE.start_xy_stage_sequence(xy_stage_label)
1331
+
1332
+ def stderr_log_enabled(self) -> bool:
1333
+ return self._CORE.stderr_log_enabled()
1334
+
1335
+ def stop(self, xy_or_z_stage_label: str) -> None:
1336
+ type = self.get_device_type(xy_or_z_stage_label)
1337
+ if type not in [DeviceType.StageDevice, DeviceType.XYStageDevice]:
1338
+ raise ValueError(f'Device "{xy_or_z_stage_label}" is not a stage device')
1339
+
1340
+ self._CORE.stop(xy_or_z_stage_label)
1341
+
1342
+ def stop_exposure_sequence(self, camera_label: str) -> None:
1343
+ '''TODO: test'''
1344
+ if not self.is_exposure_sequenceable(camera_label):
1345
+ raise ValueError(
1346
+ f'Exposure sequence is not supported for camera {camera_label}'
1347
+ )
1348
+
1349
+ self._CORE.stop_exposure_sequence(camera_label)
1350
+
1351
+ def stop_property_sequence(self, label: str, prop_name: str) -> None:
1352
+ '''TODO: test'''
1353
+ if not self.is_property_sequenceable(label, prop_name):
1354
+ raise ValueError(
1355
+ f'Property sequence for {label} property {prop_name} is not supported'
1356
+ )
1357
+
1358
+ self._CORE.stop_property_sequence(label, prop_name)
1359
+
1360
+ def stop_secondary_log_file(self, handle: int) -> None:
1361
+ self._CORE.stop_secondary_log_file(handle)
1362
+
1363
+ def stop_sequence_acquisition(self, camera_label: Optional[str] = None) -> None:
1364
+ '''TODO: test'''
1365
+ if camera_label is None:
1366
+ self._CORE.stop_sequence_acquisition()
1367
+ else:
1368
+ self._CORE.stop_sequence_acquisition(camera_label)
1369
+
1370
+ def stop_slm_sequence(self, slm_label: str) -> None:
1371
+ '''TODO: test'''
1372
+ self._CORE.stop_slm_sequence(slm_label)
1373
+
1374
+ def stop_stage_sequence(self, stage_label: str) -> None:
1375
+ '''TODO: test'''
1376
+ if not self.is_stage_sequenceable(stage_label):
1377
+ raise ValueError(f'Stage sequence for {stage_label} is not supported')
1378
+
1379
+ self._CORE.stop_stage_sequence(stage_label)
1380
+
1381
+ def stop_xy_stage_sequence(self, xy_stage_label: str) -> None:
1382
+ '''TODO: test'''
1383
+ if not self.is_xy_stage_sequenceable(xy_stage_label):
1384
+ raise ValueError(f'XY stage sequence for {xy_stage_label} is not supported')
1385
+
1386
+ self._CORE.stop_xy_stage_sequence(xy_stage_label)
1387
+
1388
+ def supports_device_detection(self, device_label: str) -> bool:
1389
+ return self._CORE.supports_device_detection(device_label)
1390
+
1391
+ def system_busy(self) -> bool:
1392
+ return self._CORE.system_busy()
1393
+
1394
+ def unload_all_devices(self) -> None:
1395
+ self._CORE.unload_all_devices()
1396
+
1397
+ def unload_device(self, label: str) -> None:
1398
+ self._CORE.unload_device(label)
1399
+
1400
+ def unload_library(self, module_name: str) -> None:
1401
+ self._CORE.unload_library(module_name)
1402
+
1403
+ def update_core_properties(self) -> None:
1404
+ self._CORE.update_core_properties()
1405
+
1406
+ def update_system_state_cache(self) -> None:
1407
+ self._CORE.update_system_state_cache()
1408
+
1409
+ def uses_device_delay(self, label: str) -> bool:
1410
+ return self._CORE.uses_device_delay(label)
1411
+
1412
+ def wait_for_config(self, group: str, config_name: str) -> None:
1413
+ self._CORE.wait_for_config(group, config_name)
1414
+
1415
+ def wait_for_device(self, label: str) -> None:
1416
+ self._CORE.wait_for_device(label)
1417
+
1418
+ def wait_for_device_type(self, dev_type: Any) -> None:
1419
+ '''TODO: requires mmcorej.DeviceType...'''
1420
+ self._CORE.wait_for_device_type(dev_type)
1421
+
1422
+ # def wait_for_image_synchro(self) -> None:
1423
+ # self._CORE.wait_for_image_synchro()
1424
+
1425
+ def wait_for_system(self) -> None:
1426
+ self._CORE.wait_for_system()
1427
+
1428
+ # def write_to_serial_port(self, port_label: str, data: bytes) -> None:
1429
+ # self._CORE.write_to_serial_port(port_label, data)
1430
+
1431
+
1432
+ if __name__ == '__main__':
1433
+ PycroCore.instance()