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.
- microEye/__init__.py +47 -0
- microEye/_version.py +2 -0
- microEye/analysis/__init__.py +1 -0
- microEye/analysis/checklist_dialog.py +143 -0
- microEye/analysis/cmosMaps.py +228 -0
- microEye/analysis/filters/__init__.py +9 -0
- microEye/analysis/filters/base.py +21 -0
- microEye/analysis/filters/spatial.py +338 -0
- microEye/analysis/filters/temporal.py +76 -0
- microEye/analysis/fitting/__init__.py +0 -0
- microEye/analysis/fitting/fit.py +680 -0
- microEye/analysis/fitting/nena.py +375 -0
- microEye/analysis/fitting/phasor_fit.py +90 -0
- microEye/analysis/fitting/processing.py +317 -0
- microEye/analysis/fitting/psf/__init__.py +6 -0
- microEye/analysis/fitting/psf/extract.py +1129 -0
- microEye/analysis/fitting/psf/rubost_mean.py +150 -0
- microEye/analysis/fitting/psf/spline.py +167 -0
- microEye/analysis/fitting/psf/stats/__init__.py +12 -0
- microEye/analysis/fitting/psf/stats/core.py +295 -0
- microEye/analysis/fitting/psf/stats/curve_fit.py +708 -0
- microEye/analysis/fitting/psf/stats/io.py +104 -0
- microEye/analysis/fitting/psf/stats/slope_fit.py +171 -0
- microEye/analysis/fitting/psf/temp.py +147 -0
- microEye/analysis/fitting/psf/test.py +47 -0
- microEye/analysis/fitting/pyfit3Dcspline/CPU/CPUfunctions.py +657 -0
- microEye/analysis/fitting/pyfit3Dcspline/CPU/CPUmleFit_LM.py +1336 -0
- microEye/analysis/fitting/pyfit3Dcspline/CPU/CPUsplineLib.py +270 -0
- microEye/analysis/fitting/pyfit3Dcspline/CPU/__init__.py +1 -0
- microEye/analysis/fitting/pyfit3Dcspline/GPU/GPUfunctions.py +609 -0
- microEye/analysis/fitting/pyfit3Dcspline/GPU/GPUmleFit_LM_EMCCD.py +1396 -0
- microEye/analysis/fitting/pyfit3Dcspline/GPU/GPUmleFit_LM_sCMOS.py +1426 -0
- microEye/analysis/fitting/pyfit3Dcspline/GPU/GPUsplineLib.py +231 -0
- microEye/analysis/fitting/pyfit3Dcspline/GPU/__init__.py +2 -0
- microEye/analysis/fitting/pyfit3Dcspline/__init__.py +10 -0
- microEye/analysis/fitting/pyfit3Dcspline/constants.py +27 -0
- microEye/analysis/fitting/pyfit3Dcspline/mainfunctions.py +903 -0
- microEye/analysis/fitting/results.py +917 -0
- microEye/analysis/fitting/results_stats.py +251 -0
- microEye/analysis/fitting/tardis.py +209 -0
- microEye/analysis/multi_viewer.py +568 -0
- microEye/analysis/processing/__init__.py +1 -0
- microEye/analysis/processing/frc.py +120 -0
- microEye/analysis/rendering/__init__.py +3 -0
- microEye/analysis/rendering/base.py +452 -0
- microEye/analysis/rendering/cloud.py +215 -0
- microEye/analysis/rendering/core.py +47 -0
- microEye/analysis/rendering/volumetric.py +198 -0
- microEye/analysis/tools/__init__.py +0 -0
- microEye/analysis/tools/kymograms.py +1079 -0
- microEye/analysis/tools/roi_selectors.py +556 -0
- microEye/analysis/utils/__init__.py +3 -0
- microEye/analysis/utils/coordinates.py +18 -0
- microEye/analysis/utils/images.py +68 -0
- microEye/analysis/utils/windows.py +19 -0
- microEye/analysis/viewer/__init__.py +3 -0
- microEye/analysis/viewer/image_options_widget.py +615 -0
- microEye/analysis/viewer/images.py +1225 -0
- microEye/analysis/viewer/layers_widget.py +415 -0
- microEye/analysis/viewer/localizations.py +1304 -0
- microEye/analysis/viewer/psf.py +1003 -0
- microEye/analysis/viewer/volume.py +456 -0
- microEye/hardware/__init__.py +3 -0
- microEye/hardware/cams/__init__.py +29 -0
- microEye/hardware/cams/camera_calibration.py +99 -0
- microEye/hardware/cams/camera_list.py +528 -0
- microEye/hardware/cams/camera_options.py +694 -0
- microEye/hardware/cams/camera_panel.py +941 -0
- microEye/hardware/cams/dummy/__init__.py +1 -0
- microEye/hardware/cams/dummy/dummy_panel.py +759 -0
- microEye/hardware/cams/jobs.py +497 -0
- microEye/hardware/cams/line_profiler.py +99 -0
- microEye/hardware/cams/linescan/IR_Cam.py +474 -0
- microEye/hardware/cams/linescan/__init__.py +1 -0
- microEye/hardware/cams/micam.py +524 -0
- microEye/hardware/cams/pco/__init__.py +58 -0
- microEye/hardware/cams/pco/enums.py +382 -0
- microEye/hardware/cams/pco/pco_cam.py +761 -0
- microEye/hardware/cams/pco/pco_panel.py +477 -0
- microEye/hardware/cams/shortcuts.py +312 -0
- microEye/hardware/cams/thorlabs/__init__.py +1 -0
- microEye/hardware/cams/thorlabs/thorlabs.py +1508 -0
- microEye/hardware/cams/thorlabs/thorlabs_panel.py +850 -0
- microEye/hardware/cams/ueye/__init__.py +1 -0
- microEye/hardware/cams/ueye/ueye_camera.py +1023 -0
- microEye/hardware/cams/ueye/ueye_panel.py +861 -0
- microEye/hardware/cams/vimba/__init__.py +1 -0
- microEye/hardware/cams/vimba/vimba_cam.py +1000 -0
- microEye/hardware/cams/vimba/vimba_panel.py +813 -0
- microEye/hardware/device.py +60 -0
- microEye/hardware/lasers/__init__.py +13 -0
- microEye/hardware/lasers/io_matchbox.py +791 -0
- microEye/hardware/lasers/io_params.py +85 -0
- microEye/hardware/lasers/io_single_laser.py +742 -0
- microEye/hardware/lasers/laser_relay.py +594 -0
- microEye/hardware/mieye/__init__.py +1 -0
- microEye/hardware/mieye/acquisition_manager.py +467 -0
- microEye/hardware/mieye/devices_manager.py +533 -0
- microEye/hardware/mieye/miEye.py +659 -0
- microEye/hardware/misc/__init__.py +0 -0
- microEye/hardware/misc/acquisition_view.py +71 -0
- microEye/hardware/misc/reglo.py +761 -0
- microEye/hardware/misc/temp.py +188 -0
- microEye/hardware/port_config.py +59 -0
- microEye/hardware/protocols/__init__.py +2 -0
- microEye/hardware/protocols/actions.py +402 -0
- microEye/hardware/protocols/actions_items.py +703 -0
- microEye/hardware/protocols/designer.py +244 -0
- microEye/hardware/protocols/scene_manager.py +191 -0
- microEye/hardware/protocols/serialization.py +97 -0
- microEye/hardware/pycromanager/__init__.py +16 -0
- microEye/hardware/pycromanager/core.py +1433 -0
- microEye/hardware/pycromanager/devices.py +461 -0
- microEye/hardware/pycromanager/enums.py +107 -0
- microEye/hardware/pycromanager/headless.py +153 -0
- microEye/hardware/pycromanager/utils.py +34 -0
- microEye/hardware/pycromanager/widgets/__init__.py +5 -0
- microEye/hardware/pycromanager/widgets/bridges.py +407 -0
- microEye/hardware/pycromanager/widgets/headless_manager.py +258 -0
- microEye/hardware/pycromanager/widgets/headless_options.py +224 -0
- microEye/hardware/pycromanager/widgets/pycro_panel.py +455 -0
- microEye/hardware/stages/__init__.py +18 -0
- microEye/hardware/stages/elliptec/__init__.py +5 -0
- microEye/hardware/stages/elliptec/baseDevice.py +314 -0
- microEye/hardware/stages/elliptec/device.py +384 -0
- microEye/hardware/stages/elliptec/deviceID.py +212 -0
- microEye/hardware/stages/elliptec/devicePort.py +379 -0
- microEye/hardware/stages/elliptec/deviceStatus.py +65 -0
- microEye/hardware/stages/elliptec/devicesView.py +706 -0
- microEye/hardware/stages/elliptec/ellDevices.py +134 -0
- microEye/hardware/stages/elliptec/messageUpdater.py +34 -0
- microEye/hardware/stages/elliptec/motorInfo.py +153 -0
- microEye/hardware/stages/elliptec/stage.py +62 -0
- microEye/hardware/stages/elliptec/test.py +139 -0
- microEye/hardware/stages/kinesis/__init__.py +1 -0
- microEye/hardware/stages/kinesis/kdc101/__init__.py +1 -0
- microEye/hardware/stages/kinesis/kdc101/enums.py +1002 -0
- microEye/hardware/stages/kinesis/kdc101/factory.py +171 -0
- microEye/hardware/stages/kinesis/kdc101/kdc101.py +718 -0
- microEye/hardware/stages/kinesis/kinesis.py +776 -0
- microEye/hardware/stages/piezo_concept.py +607 -0
- microEye/hardware/stages/stabilizer.py +785 -0
- microEye/hardware/stages/stage.py +89 -0
- microEye/hardware/widgets/__init__.py +10 -0
- microEye/hardware/widgets/controller.py +246 -0
- microEye/hardware/widgets/devices.py +133 -0
- microEye/hardware/widgets/focusWidget.py +264 -0
- microEye/hardware/widgets/qlist_slider.py +113 -0
- microEye/hardware/widgets/scan_acquisition.py +424 -0
- microEye/icons/1024.png +0 -0
- microEye/icons/128.png +0 -0
- microEye/icons/16.png +0 -0
- microEye/icons/24.png +0 -0
- microEye/icons/256.png +0 -0
- microEye/icons/32.png +0 -0
- microEye/icons/48.png +0 -0
- microEye/icons/512.png +0 -0
- microEye/icons/64.png +0 -0
- microEye/icons/__init__.py +0 -0
- microEye/icons/close.svg +88 -0
- microEye/icons/mieye.png +0 -0
- microEye/icons/min.svg +83 -0
- microEye/icons/viewer.png +0 -0
- microEye/launcher.py +42 -0
- microEye/qt.py +181 -0
- microEye/utils/__init__.py +2 -0
- microEye/utils/enum_encoder.py +10 -0
- microEye/utils/expandable_groupbox.py +93 -0
- microEye/utils/gui_helper.py +457 -0
- microEye/utils/hid/__init__.py +8 -0
- microEye/utils/hid/controller.py +153 -0
- microEye/utils/hid/device.py +63 -0
- microEye/utils/hid/enums.py +140 -0
- microEye/utils/hid/utils.py +58 -0
- microEye/utils/labelled_slider.py +134 -0
- microEye/utils/metadata.py +599 -0
- microEye/utils/metadata_tree.py +718 -0
- microEye/utils/micro_launcher.py +245 -0
- microEye/utils/parameter_tree.py +325 -0
- microEye/utils/pyscripting.py +444 -0
- microEye/utils/retry_exec.py +35 -0
- microEye/utils/start_gui.py +112 -0
- microEye/utils/thread_worker.py +115 -0
- microEye/utils/uImage.py +1512 -0
- microeye-2.3.2.dist-info/METADATA +401 -0
- microeye-2.3.2.dist-info/RECORD +190 -0
- microeye-2.3.2.dist-info/WHEEL +5 -0
- microeye-2.3.2.dist-info/entry_points.txt +2 -0
- microeye-2.3.2.dist-info/licenses/LICENSE +674 -0
- microeye-2.3.2.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from enum import Enum
|
|
3
|
+
|
|
4
|
+
import numpy as np
|
|
5
|
+
import pyqtgraph as pg
|
|
6
|
+
import qdarkstyle
|
|
7
|
+
import tifffile as tf
|
|
8
|
+
from pyqtgraph.parametertree import Parameter
|
|
9
|
+
|
|
10
|
+
from microEye.qt import (
|
|
11
|
+
QApplication,
|
|
12
|
+
Qt,
|
|
13
|
+
QtWidgets,
|
|
14
|
+
Signal,
|
|
15
|
+
getExistingDirectory,
|
|
16
|
+
getSaveFileName,
|
|
17
|
+
)
|
|
18
|
+
from microEye.utils import Tree
|
|
19
|
+
from microEye.utils.uImage import uImage
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class TileImage:
|
|
23
|
+
def __init__(self, uImage: uImage, index, position) -> None:
|
|
24
|
+
self.uImage = uImage
|
|
25
|
+
self.index = index
|
|
26
|
+
self.position = position
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class TiledImageSelector(QtWidgets.QWidget):
|
|
30
|
+
positionSelected = Signal(float, float)
|
|
31
|
+
|
|
32
|
+
def __init__(self, images: list[TileImage]) -> None:
|
|
33
|
+
super().__init__()
|
|
34
|
+
|
|
35
|
+
self.images = images
|
|
36
|
+
|
|
37
|
+
central_layout = QtWidgets.QHBoxLayout()
|
|
38
|
+
self.setLayout(central_layout)
|
|
39
|
+
|
|
40
|
+
imageWidget = pg.GraphicsLayoutWidget()
|
|
41
|
+
imageWidget.ci.setContentsMargins(0, 0, 0, 0)
|
|
42
|
+
imageWidget.ci.setSpacing(0)
|
|
43
|
+
imageWidget.sceneObj.sigMouseClicked.connect(self.clicked)
|
|
44
|
+
|
|
45
|
+
for _idx, tImg in enumerate(images):
|
|
46
|
+
vb: pg.ViewBox = imageWidget.addViewBox(*tImg.index)
|
|
47
|
+
vb.setMouseEnabled(False, False)
|
|
48
|
+
vb.setDefaultPadding(0.004)
|
|
49
|
+
vb.setAspectLocked(True)
|
|
50
|
+
vb.invertY()
|
|
51
|
+
# menu: QMenu = vb.getMenu(None)
|
|
52
|
+
# vb.action = QAction("Save Raw Data (.tif)")
|
|
53
|
+
# menu.addAction(vb.action)
|
|
54
|
+
# vb.action.triggered.connect(
|
|
55
|
+
# lambda: self.save_raw_data(tImg))
|
|
56
|
+
img = pg.ImageItem(tImg.uImage._view)
|
|
57
|
+
vb.addItem(img)
|
|
58
|
+
vb.item = tImg
|
|
59
|
+
|
|
60
|
+
self.imgView = pg.ImageView()
|
|
61
|
+
self.setWindowTitle('Tiled Image Selector')
|
|
62
|
+
|
|
63
|
+
central_layout.addWidget(imageWidget, 3)
|
|
64
|
+
central_layout.addWidget(self.imgView, 4)
|
|
65
|
+
|
|
66
|
+
def clicked(self, event):
|
|
67
|
+
if event.modifiers() == Qt.ShiftModifier and event.button() == Qt.LeftButton:
|
|
68
|
+
self.save_raw_data(event.currentItem.item)
|
|
69
|
+
elif (
|
|
70
|
+
event.modifiers() == Qt.ControlModifier and event.button() == Qt.LeftButton
|
|
71
|
+
):
|
|
72
|
+
self.save_raw_data_all()
|
|
73
|
+
else:
|
|
74
|
+
if event.double():
|
|
75
|
+
self.positionSelected.emit(*event.currentItem.item.position)
|
|
76
|
+
else:
|
|
77
|
+
self.setWindowTitle(
|
|
78
|
+
'Tiled Image Selector ({}, {}) ({}, {})'.format(
|
|
79
|
+
*event.currentItem.item.index, *event.currentItem.item.position
|
|
80
|
+
)
|
|
81
|
+
)
|
|
82
|
+
self.imgView.setImage(event.currentItem.addedItems[0].image)
|
|
83
|
+
|
|
84
|
+
def save_raw_data(self, img: TileImage):
|
|
85
|
+
filename = None
|
|
86
|
+
if filename is None:
|
|
87
|
+
filename, _ = getSaveFileName(
|
|
88
|
+
self, 'Save Raw Data', filter='Tiff Files (*.tif)'
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
if len(filename) > 0:
|
|
92
|
+
tf.imwrite(filename, img.uImage.image, photometric='minisblack')
|
|
93
|
+
|
|
94
|
+
def save_raw_data_all(self):
|
|
95
|
+
directory = None
|
|
96
|
+
if directory is None:
|
|
97
|
+
directory = str(getExistingDirectory(self, 'Select Directory'))
|
|
98
|
+
|
|
99
|
+
if len(directory) > 0:
|
|
100
|
+
for idx, tImg in enumerate(self.images):
|
|
101
|
+
tf.imwrite(
|
|
102
|
+
directory
|
|
103
|
+
+ f'/{idx:03d}_image_y{tImg.index[0]:02d}_x{tImg.index[1]:02d}.tif',
|
|
104
|
+
tImg.uImage.image,
|
|
105
|
+
photometric='minisblack',
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
class ScanParams(Enum):
|
|
110
|
+
'''
|
|
111
|
+
Enum class defining Scanning Acquisition parameters.
|
|
112
|
+
'''
|
|
113
|
+
|
|
114
|
+
DELAY = 'Delay [ms]'
|
|
115
|
+
XY_SCAN = 'XY SCAN'
|
|
116
|
+
Z_SCAN = 'Z SCAN'
|
|
117
|
+
X_STEP = 'XY SCAN.X Steps'
|
|
118
|
+
Y_STEP = 'XY SCAN.Y Steps'
|
|
119
|
+
Z_STEP = 'Z SCAN.Z Steps'
|
|
120
|
+
X_STEP_SIZE = 'XY SCAN.X Step Size [um]'
|
|
121
|
+
Y_STEP_SIZE = 'XY SCAN.Y Step Size [um]'
|
|
122
|
+
Z_STEP_SIZE = 'Z SCAN.Z Step Size [nm]'
|
|
123
|
+
AVG_FRAMES = 'XY SCAN.Average [Frames]'
|
|
124
|
+
|
|
125
|
+
XY_START = 'XY SCAN.Start XY-Scan'
|
|
126
|
+
XY_LAST = 'XY SCAN.Last XY-Scan'
|
|
127
|
+
XY_STOP = 'XY SCAN.Stop XY-Scan'
|
|
128
|
+
|
|
129
|
+
N_FRAMES = 'Z SCAN.Frames per Z-Slice'
|
|
130
|
+
Z_REVERSED = 'Z SCAN.Reversed'
|
|
131
|
+
Z_DIRECTORY = 'Z SCAN.Save Directory'
|
|
132
|
+
Z_START = 'Z SCAN.Start Z-Scan'
|
|
133
|
+
Z_STOP = 'Z SCAN.Stop Z-Scan'
|
|
134
|
+
Z_CAL = 'Z SCAN.Start Z-Calibration'
|
|
135
|
+
|
|
136
|
+
def __str__(self):
|
|
137
|
+
'''
|
|
138
|
+
Return the last part of the enum value (Param name).
|
|
139
|
+
'''
|
|
140
|
+
return self.value.split('.')[-1]
|
|
141
|
+
|
|
142
|
+
def get_path(self):
|
|
143
|
+
'''
|
|
144
|
+
Return the full parameter path.
|
|
145
|
+
'''
|
|
146
|
+
return self.value.split('.')
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
class ScanAcquisitionWidget(Tree):
|
|
150
|
+
PARAMS = ScanParams
|
|
151
|
+
startAcquisitionXY = Signal(tuple)
|
|
152
|
+
stopAcquisitionXY = Signal()
|
|
153
|
+
openLastTileXY = Signal()
|
|
154
|
+
startAcquisitionZ = Signal(tuple)
|
|
155
|
+
startCalibrationZ = Signal(tuple)
|
|
156
|
+
stopAcquisitionZ = Signal()
|
|
157
|
+
|
|
158
|
+
moveZ = Signal(bool, int)
|
|
159
|
+
|
|
160
|
+
directoryChanged = Signal(str)
|
|
161
|
+
|
|
162
|
+
def __init__(self) -> None:
|
|
163
|
+
super().__init__()
|
|
164
|
+
|
|
165
|
+
self._directory = os.path.join(os.path.expanduser('~'), 'Desktop')
|
|
166
|
+
|
|
167
|
+
def create_parameters(self):
|
|
168
|
+
'''
|
|
169
|
+
Create the parameter tree structure.
|
|
170
|
+
|
|
171
|
+
This method creates and sets up the parameter tree structure for the
|
|
172
|
+
`PzFocView` class.
|
|
173
|
+
'''
|
|
174
|
+
params = [
|
|
175
|
+
{
|
|
176
|
+
'name': str(ScanParams.DELAY),
|
|
177
|
+
'type': 'int',
|
|
178
|
+
'value': 200,
|
|
179
|
+
'limits': [1, 1e4],
|
|
180
|
+
'step': 50,
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
'name': str(ScanParams.XY_SCAN),
|
|
184
|
+
'type': 'group',
|
|
185
|
+
'children': [
|
|
186
|
+
{
|
|
187
|
+
'name': str(ScanParams.X_STEP),
|
|
188
|
+
'type': 'int',
|
|
189
|
+
'value': 4,
|
|
190
|
+
'limits': [1, 100],
|
|
191
|
+
'step': 1,
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
'name': str(ScanParams.Y_STEP),
|
|
195
|
+
'type': 'int',
|
|
196
|
+
'value': 4,
|
|
197
|
+
'limits': [1, 100],
|
|
198
|
+
'step': 1,
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
'name': str(ScanParams.X_STEP_SIZE),
|
|
202
|
+
'type': 'float',
|
|
203
|
+
'value': 50.0,
|
|
204
|
+
'limits': [0.1, 500],
|
|
205
|
+
'step': 1,
|
|
206
|
+
'dec': False,
|
|
207
|
+
'decimals': 3,
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
'name': str(ScanParams.Y_STEP_SIZE),
|
|
211
|
+
'type': 'float',
|
|
212
|
+
'value': 50.0,
|
|
213
|
+
'limits': [0.1, 500],
|
|
214
|
+
'step': 1,
|
|
215
|
+
'dec': False,
|
|
216
|
+
'decimals': 3,
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
'name': str(ScanParams.AVG_FRAMES),
|
|
220
|
+
'type': 'int',
|
|
221
|
+
'value': 1,
|
|
222
|
+
'limits': [1, 128],
|
|
223
|
+
'step': 1,
|
|
224
|
+
},
|
|
225
|
+
{'name': str(ScanParams.XY_START), 'type': 'action'},
|
|
226
|
+
{'name': str(ScanParams.XY_STOP), 'type': 'action'},
|
|
227
|
+
{'name': str(ScanParams.XY_LAST), 'type': 'action'},
|
|
228
|
+
],
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
'name': str(ScanParams.Z_SCAN),
|
|
232
|
+
'type': 'group',
|
|
233
|
+
'children': [
|
|
234
|
+
{
|
|
235
|
+
'name': str(ScanParams.Z_STEP),
|
|
236
|
+
'type': 'int',
|
|
237
|
+
'value': 5,
|
|
238
|
+
'limits': [2, 1e4],
|
|
239
|
+
'step': 1,
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
'name': str(ScanParams.Z_STEP_SIZE),
|
|
243
|
+
'type': 'int',
|
|
244
|
+
'value': 25,
|
|
245
|
+
'limits': [1, 2e4],
|
|
246
|
+
'step': 1,
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
'name': str(ScanParams.N_FRAMES),
|
|
250
|
+
'type': 'int',
|
|
251
|
+
'value': 10,
|
|
252
|
+
'limits': [1, 1e9],
|
|
253
|
+
'step': 1,
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
'name': str(ScanParams.Z_REVERSED),
|
|
257
|
+
'type': 'bool',
|
|
258
|
+
'value': False,
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
'name': str(ScanParams.Z_DIRECTORY),
|
|
262
|
+
'type': 'file',
|
|
263
|
+
'directory': os.path.join(os.path.expanduser('~'), 'Desktop'),
|
|
264
|
+
'value': os.path.join(os.path.expanduser('~'), 'Desktop'),
|
|
265
|
+
'fileMode': 'Directory',
|
|
266
|
+
},
|
|
267
|
+
{'name': str(ScanParams.Z_START), 'type': 'action'},
|
|
268
|
+
{'name': str(ScanParams.Z_STOP), 'type': 'action'},
|
|
269
|
+
{'name': str(ScanParams.Z_CAL), 'type': 'action'},
|
|
270
|
+
],
|
|
271
|
+
},
|
|
272
|
+
]
|
|
273
|
+
|
|
274
|
+
self.param_tree = Parameter.create(name='', type='group', children=params)
|
|
275
|
+
self.param_tree.sigTreeStateChanged.connect(self.change)
|
|
276
|
+
self.header().setSectionResizeMode(
|
|
277
|
+
QtWidgets.QHeaderView.ResizeMode.ResizeToContents
|
|
278
|
+
)
|
|
279
|
+
|
|
280
|
+
self.get_param(ScanParams.XY_START).sigActivated.connect(
|
|
281
|
+
lambda: self.startScanning(True)
|
|
282
|
+
)
|
|
283
|
+
self.get_param(ScanParams.XY_STOP).sigActivated.connect(
|
|
284
|
+
lambda: self.stopAcquisitionXY.emit()
|
|
285
|
+
)
|
|
286
|
+
self.get_param(ScanParams.XY_LAST).sigActivated.connect(
|
|
287
|
+
lambda: self.openLastTileXY.emit()
|
|
288
|
+
)
|
|
289
|
+
|
|
290
|
+
self.get_param(ScanParams.Z_START).sigActivated.connect(
|
|
291
|
+
lambda: self.startScanning(False)
|
|
292
|
+
)
|
|
293
|
+
self.get_param(ScanParams.Z_STOP).sigActivated.connect(
|
|
294
|
+
lambda: self.stopAcquisitionZ.emit()
|
|
295
|
+
)
|
|
296
|
+
self.get_param(ScanParams.Z_CAL).sigActivated.connect(
|
|
297
|
+
lambda: self.startScanning(None)
|
|
298
|
+
)
|
|
299
|
+
|
|
300
|
+
self.get_param(ScanParams.Z_DIRECTORY).sigValueChanged.connect(
|
|
301
|
+
self.directory_changed
|
|
302
|
+
)
|
|
303
|
+
|
|
304
|
+
def startScanning(self, XY: bool):
|
|
305
|
+
'''
|
|
306
|
+
Starts the scanning process based on the provided XY parameter.
|
|
307
|
+
|
|
308
|
+
Parameters
|
|
309
|
+
----------
|
|
310
|
+
XY : bool, optional
|
|
311
|
+
If True, starts XY scanning with the parameters set in the
|
|
312
|
+
GUI. If False, starts Z scanning with the parameters set in
|
|
313
|
+
the GUI. If None, starts calibration for Z scanning with
|
|
314
|
+
the parameters set in the GUI.
|
|
315
|
+
|
|
316
|
+
'''
|
|
317
|
+
if XY is None:
|
|
318
|
+
self.startCalibrationZ.emit(self.get_params(False))
|
|
319
|
+
return
|
|
320
|
+
|
|
321
|
+
if XY:
|
|
322
|
+
self.startAcquisitionXY.emit(self.get_params(XY))
|
|
323
|
+
else:
|
|
324
|
+
self.startAcquisitionZ.emit(self.get_params(XY))
|
|
325
|
+
|
|
326
|
+
def directory_changed(self, param, value):
|
|
327
|
+
'''Slot for browse clicked event'''
|
|
328
|
+
self._directory = value
|
|
329
|
+
self.directoryChanged.emit(self._directory)
|
|
330
|
+
|
|
331
|
+
def get_params(self, XY: bool):
|
|
332
|
+
'''
|
|
333
|
+
Returns the scanning parameters for XY or Z scan.
|
|
334
|
+
|
|
335
|
+
Parameters
|
|
336
|
+
----------
|
|
337
|
+
XY : bool
|
|
338
|
+
If True, returns parameters for XY scan. If False, returns
|
|
339
|
+
parameters for Z scan.
|
|
340
|
+
|
|
341
|
+
Returns
|
|
342
|
+
-------
|
|
343
|
+
tuple
|
|
344
|
+
A tuple of scanning parameters depending on the value of XY.
|
|
345
|
+
|
|
346
|
+
If XY is True, returns:
|
|
347
|
+
- Number of X steps
|
|
348
|
+
- Number of Y steps
|
|
349
|
+
- X Step size (um)
|
|
350
|
+
- Y Step size (um)
|
|
351
|
+
- Delay (ms)
|
|
352
|
+
- Average (frames)
|
|
353
|
+
|
|
354
|
+
If XY is False, returns:
|
|
355
|
+
- Number of Z steps
|
|
356
|
+
- Z Step size (nm)
|
|
357
|
+
- Delay (ms)
|
|
358
|
+
- Number of Frames
|
|
359
|
+
- Reversed (bool)
|
|
360
|
+
'''
|
|
361
|
+
if XY:
|
|
362
|
+
return (
|
|
363
|
+
self.get_param_value(ScanParams.X_STEP),
|
|
364
|
+
self.get_param_value(ScanParams.Y_STEP),
|
|
365
|
+
self.get_param_value(ScanParams.X_STEP_SIZE),
|
|
366
|
+
self.get_param_value(ScanParams.Y_STEP_SIZE),
|
|
367
|
+
self.get_param_value(ScanParams.DELAY),
|
|
368
|
+
self.get_param_value(ScanParams.AVG_FRAMES),
|
|
369
|
+
)
|
|
370
|
+
else:
|
|
371
|
+
return (
|
|
372
|
+
self.get_param_value(ScanParams.Z_STEP),
|
|
373
|
+
self.get_param_value(ScanParams.Z_STEP_SIZE),
|
|
374
|
+
self.get_param_value(ScanParams.DELAY),
|
|
375
|
+
self.get_param_value(ScanParams.N_FRAMES),
|
|
376
|
+
self.get_param_value(ScanParams.Z_REVERSED),
|
|
377
|
+
)
|
|
378
|
+
|
|
379
|
+
def setActionsStatus(self, status: bool):
|
|
380
|
+
'''
|
|
381
|
+
Enables or disables the scanning actions based on the provided status parameter.
|
|
382
|
+
|
|
383
|
+
Parameters
|
|
384
|
+
----------
|
|
385
|
+
status : bool
|
|
386
|
+
The status to set for the scanning actions.
|
|
387
|
+
If True, the actions are enabled.
|
|
388
|
+
If False, the actions are disabled.
|
|
389
|
+
|
|
390
|
+
'''
|
|
391
|
+
self.get_param(ScanParams.XY_START).setOpts(enabled=status)
|
|
392
|
+
# self.get_param(ScanParams.XY_STOP).setOpts(enabled=status)
|
|
393
|
+
self.get_param(ScanParams.XY_LAST).setOpts(enabled=status)
|
|
394
|
+
self.get_param(ScanParams.Z_START).setOpts(enabled=status)
|
|
395
|
+
# self.get_param(ScanParams.Z_STOP).setOpts(enabled=status)
|
|
396
|
+
self.get_param(ScanParams.Z_CAL).setOpts(enabled=status)
|
|
397
|
+
self.get_param(ScanParams.Z_DIRECTORY).setOpts(enabled=status)
|
|
398
|
+
|
|
399
|
+
def __str__(self):
|
|
400
|
+
return 'Scan Acquistion'
|
|
401
|
+
|
|
402
|
+
if __name__ == '__main__':
|
|
403
|
+
x = np.linspace(255, 0, 256)
|
|
404
|
+
y = np.linspace(0, 255, 256)
|
|
405
|
+
z = np.concatenate([x, y])
|
|
406
|
+
image = np.tile(z, (512, 1)).T
|
|
407
|
+
|
|
408
|
+
data = []
|
|
409
|
+
|
|
410
|
+
for i in range(10):
|
|
411
|
+
for j in range(10):
|
|
412
|
+
uImg = uImage(image)
|
|
413
|
+
uImg.equalizeLUT()
|
|
414
|
+
tImg = TileImage(uImg, [i, j], [17, 17])
|
|
415
|
+
data.append(tImg)
|
|
416
|
+
|
|
417
|
+
app = QApplication([])
|
|
418
|
+
app.setStyleSheet(qdarkstyle.load_stylesheet(qt_api='pyqt5'))
|
|
419
|
+
|
|
420
|
+
win = TiledImageSelector(data)
|
|
421
|
+
win.positionSelected.connect(lambda x, y: print(x, y))
|
|
422
|
+
win.show()
|
|
423
|
+
|
|
424
|
+
app.exec()
|
microEye/icons/1024.png
ADDED
|
Binary file
|
microEye/icons/128.png
ADDED
|
Binary file
|
microEye/icons/16.png
ADDED
|
Binary file
|
microEye/icons/24.png
ADDED
|
Binary file
|
microEye/icons/256.png
ADDED
|
Binary file
|
microEye/icons/32.png
ADDED
|
Binary file
|
microEye/icons/48.png
ADDED
|
Binary file
|
microEye/icons/512.png
ADDED
|
Binary file
|
microEye/icons/64.png
ADDED
|
Binary file
|
|
File without changes
|
microEye/icons/close.svg
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<svg
|
|
3
|
+
width="9.9724712mm"
|
|
4
|
+
height="9.9724722mm"
|
|
5
|
+
viewBox="0 0 9.9724711 9.9724718"
|
|
6
|
+
version="1.1"
|
|
7
|
+
id="svg8"
|
|
8
|
+
inkscape:version="1.1.2 (b8e25be833, 2022-02-05)"
|
|
9
|
+
sodipodi:docname="close.svg"
|
|
10
|
+
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
11
|
+
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
12
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
13
|
+
xmlns:svg="http://www.w3.org/2000/svg"
|
|
14
|
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
15
|
+
xmlns:cc="http://creativecommons.org/ns#"
|
|
16
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
|
17
|
+
<defs
|
|
18
|
+
id="defs2" />
|
|
19
|
+
<sodipodi:namedview
|
|
20
|
+
id="base"
|
|
21
|
+
pagecolor="#313131"
|
|
22
|
+
bordercolor="#898989"
|
|
23
|
+
borderopacity="1"
|
|
24
|
+
inkscape:pageopacity="0"
|
|
25
|
+
inkscape:pageshadow="2"
|
|
26
|
+
inkscape:zoom="11.2"
|
|
27
|
+
inkscape:cx="16.964286"
|
|
28
|
+
inkscape:cy="37.5"
|
|
29
|
+
inkscape:document-units="mm"
|
|
30
|
+
inkscape:current-layer="layer2"
|
|
31
|
+
inkscape:document-rotation="0"
|
|
32
|
+
showgrid="false"
|
|
33
|
+
inkscape:showpageshadow="false"
|
|
34
|
+
showborder="true"
|
|
35
|
+
inkscape:snap-smooth-nodes="true"
|
|
36
|
+
inkscape:snap-intersection-paths="true"
|
|
37
|
+
inkscape:object-paths="true"
|
|
38
|
+
inkscape:snap-midpoints="true"
|
|
39
|
+
inkscape:snap-object-midpoints="true"
|
|
40
|
+
inkscape:snap-center="true"
|
|
41
|
+
inkscape:pagecheckerboard="0"
|
|
42
|
+
fit-margin-top="0"
|
|
43
|
+
fit-margin-left="0"
|
|
44
|
+
fit-margin-right="0"
|
|
45
|
+
fit-margin-bottom="0"
|
|
46
|
+
inkscape:window-width="2560"
|
|
47
|
+
inkscape:window-height="1369"
|
|
48
|
+
inkscape:window-x="-8"
|
|
49
|
+
inkscape:window-y="-8"
|
|
50
|
+
inkscape:window-maximized="1" />
|
|
51
|
+
<metadata
|
|
52
|
+
id="metadata5">
|
|
53
|
+
<rdf:RDF>
|
|
54
|
+
<cc:Work
|
|
55
|
+
rdf:about="">
|
|
56
|
+
<dc:format>image/svg+xml</dc:format>
|
|
57
|
+
<dc:type
|
|
58
|
+
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
59
|
+
</cc:Work>
|
|
60
|
+
</rdf:RDF>
|
|
61
|
+
</metadata>
|
|
62
|
+
<g
|
|
63
|
+
inkscape:groupmode="layer"
|
|
64
|
+
id="layer2"
|
|
65
|
+
inkscape:label="Content"
|
|
66
|
+
transform="translate(-177.19829,-136.37685)">
|
|
67
|
+
<g
|
|
68
|
+
id="g256185"
|
|
69
|
+
transform="translate(140.26708,-84.247917)">
|
|
70
|
+
<circle
|
|
71
|
+
style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.439569;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
|
|
72
|
+
id="circle255680"
|
|
73
|
+
cx="41.917446"
|
|
74
|
+
cy="225.61101"
|
|
75
|
+
r="4.7664514" />
|
|
76
|
+
<path
|
|
77
|
+
style="fill:none;stroke:#ffffff;stroke-width:0.7;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
|
78
|
+
d="m 44.518196,222.8347 -5.201498,5.20149"
|
|
79
|
+
id="path255847"
|
|
80
|
+
sodipodi:nodetypes="cc" />
|
|
81
|
+
<path
|
|
82
|
+
style="fill:none;stroke:#ffffff;stroke-width:0.7;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
|
83
|
+
d="m 39.316698,222.8347 5.201498,5.20149"
|
|
84
|
+
id="path256099"
|
|
85
|
+
sodipodi:nodetypes="cc" />
|
|
86
|
+
</g>
|
|
87
|
+
</g>
|
|
88
|
+
</svg>
|
microEye/icons/mieye.png
ADDED
|
Binary file
|
microEye/icons/min.svg
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<svg
|
|
3
|
+
width="9.9724712mm"
|
|
4
|
+
height="9.9724722mm"
|
|
5
|
+
viewBox="0 0 9.9724711 9.9724718"
|
|
6
|
+
version="1.1"
|
|
7
|
+
id="svg8"
|
|
8
|
+
inkscape:version="1.1.2 (b8e25be833, 2022-02-05)"
|
|
9
|
+
sodipodi:docname="min.svg"
|
|
10
|
+
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
11
|
+
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
12
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
13
|
+
xmlns:svg="http://www.w3.org/2000/svg"
|
|
14
|
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
15
|
+
xmlns:cc="http://creativecommons.org/ns#"
|
|
16
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
|
17
|
+
<defs
|
|
18
|
+
id="defs2" />
|
|
19
|
+
<sodipodi:namedview
|
|
20
|
+
id="base"
|
|
21
|
+
pagecolor="#313131"
|
|
22
|
+
bordercolor="#898989"
|
|
23
|
+
borderopacity="1"
|
|
24
|
+
inkscape:pageopacity="0"
|
|
25
|
+
inkscape:pageshadow="2"
|
|
26
|
+
inkscape:zoom="11.2"
|
|
27
|
+
inkscape:cx="16.919643"
|
|
28
|
+
inkscape:cy="37.5"
|
|
29
|
+
inkscape:document-units="mm"
|
|
30
|
+
inkscape:current-layer="layer2"
|
|
31
|
+
inkscape:document-rotation="0"
|
|
32
|
+
showgrid="false"
|
|
33
|
+
inkscape:showpageshadow="false"
|
|
34
|
+
showborder="true"
|
|
35
|
+
inkscape:snap-smooth-nodes="true"
|
|
36
|
+
inkscape:snap-intersection-paths="true"
|
|
37
|
+
inkscape:object-paths="true"
|
|
38
|
+
inkscape:snap-midpoints="true"
|
|
39
|
+
inkscape:snap-object-midpoints="true"
|
|
40
|
+
inkscape:snap-center="true"
|
|
41
|
+
inkscape:pagecheckerboard="0"
|
|
42
|
+
fit-margin-top="0"
|
|
43
|
+
fit-margin-left="0"
|
|
44
|
+
fit-margin-right="0"
|
|
45
|
+
fit-margin-bottom="0"
|
|
46
|
+
inkscape:window-width="2560"
|
|
47
|
+
inkscape:window-height="1369"
|
|
48
|
+
inkscape:window-x="-8"
|
|
49
|
+
inkscape:window-y="-8"
|
|
50
|
+
inkscape:window-maximized="1" />
|
|
51
|
+
<metadata
|
|
52
|
+
id="metadata5">
|
|
53
|
+
<rdf:RDF>
|
|
54
|
+
<cc:Work
|
|
55
|
+
rdf:about="">
|
|
56
|
+
<dc:format>image/svg+xml</dc:format>
|
|
57
|
+
<dc:type
|
|
58
|
+
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
59
|
+
</cc:Work>
|
|
60
|
+
</rdf:RDF>
|
|
61
|
+
</metadata>
|
|
62
|
+
<g
|
|
63
|
+
inkscape:groupmode="layer"
|
|
64
|
+
id="layer2"
|
|
65
|
+
inkscape:label="Content"
|
|
66
|
+
transform="translate(-177.19829,-136.37685)">
|
|
67
|
+
<g
|
|
68
|
+
id="g256185"
|
|
69
|
+
transform="translate(140.26708,-84.247917)">
|
|
70
|
+
<circle
|
|
71
|
+
style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.439569;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
|
|
72
|
+
id="circle255680"
|
|
73
|
+
cx="41.917446"
|
|
74
|
+
cy="225.61101"
|
|
75
|
+
r="4.7664514" />
|
|
76
|
+
<path
|
|
77
|
+
style="fill:none;stroke:#ffffff;stroke-width:0.7;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
|
78
|
+
d="m 45.595459,225.43545 -7.356024,-1e-5"
|
|
79
|
+
id="path255847"
|
|
80
|
+
sodipodi:nodetypes="cc" />
|
|
81
|
+
</g>
|
|
82
|
+
</g>
|
|
83
|
+
</svg>
|
|
Binary file
|
microEye/launcher.py
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
from microEye import ARGS
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def main():
|
|
8
|
+
# access the parsed arguments
|
|
9
|
+
module_name = ARGS.module
|
|
10
|
+
|
|
11
|
+
if module_name == 'mieye':
|
|
12
|
+
from microEye.hardware import miEye_module
|
|
13
|
+
|
|
14
|
+
try:
|
|
15
|
+
import vimba as vb
|
|
16
|
+
except Exception:
|
|
17
|
+
vb = None
|
|
18
|
+
|
|
19
|
+
if vb:
|
|
20
|
+
with vb.Vimba.get_instance() as vimba:
|
|
21
|
+
app, window = miEye_module.StartGUI()
|
|
22
|
+
app.exec()
|
|
23
|
+
else:
|
|
24
|
+
app, window = miEye_module.StartGUI()
|
|
25
|
+
app.exec()
|
|
26
|
+
elif module_name == 'viewer':
|
|
27
|
+
from microEye.analysis.multi_viewer import multi_viewer
|
|
28
|
+
|
|
29
|
+
app, window = multi_viewer.StartGUI('')
|
|
30
|
+
|
|
31
|
+
app.exec()
|
|
32
|
+
else:
|
|
33
|
+
print('For help: \n>>> microEye -h')
|
|
34
|
+
from microEye.utils.micro_launcher import microLauncher
|
|
35
|
+
|
|
36
|
+
app, window = microLauncher.StartGUI()
|
|
37
|
+
|
|
38
|
+
app.exec()
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
if __name__ == '__main__':
|
|
42
|
+
main()
|