-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
47 lines (42 loc) · 1.61 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# ------ global configs
X_RES = 3840
Y_RES = 2160
PIX_PER_UM_20X = 3535 / 370 # 20x objective
PIX_PER_UM_5X = 2350 / 1000 # 5x objective, 3.94 +/- 0.005 ratio to 20x
PIX_PER_UM_10X = 3330 / 700 # 10x objective, ~4.757 pix/um
LAPLACIAN_WINDOW_20X = 27 # 20x objective
LAPLACIAN_WINDOW_10X = 5 # needs tweaking
LAPLACIAN_WINDOW_5X = 11 # 5x objective (around 7-11 seems to be a good area?)
FILTER_WINDOW_20X = 31 # guess, needs tweaking
FILTER_WINDOW_10X = 7
FILTER_WINDOW_5X = 5 # guess, needs tweaking
NOM_STEP_20x = 0.1
NOM_STEP_10x = 0.3
NOM_STEP_5x = 0.5
THUMB_SCALE = 0.125 # scaling of a thumbnail (in linear dimensions)
THUMB_THRESHOLD_PX = 2000 # threshold to use thumbnails for the overview
UI_MIN_WIDTH = 1000
UI_MIN_HEIGHT = 1000
TILES_VERSION = 1
PIEZO_UM_PER_LSB = (1/193.5) # from empirical measurements
SECULAR_PIEZO_UM_PER_LSB = 0.007425 # from datasheet numbers
# ----- configure template matching
# low scores are better. scores greater than this fail.
FAILING_SCORE = 80.0
CONTOUR_THRESH = 192 # 192 for well-focused images; 224 if the focus quality is poor
# maximum number of potential solutions before falling back to manual review
MAX_SOLUTIONS = 8
PREVIEW_SCALE = 0.3
X_REVIEW_THRESH_UM = 110.0
Y_REVIEW_THRESH_UM = 110.0
SEARCH_SCALE = 0.80 # 0.8 worked on the AW set, 0.9 if using a square template
MAX_TEMPLATE_PX = 768
MSE_SEARCH_LIMIT = 50
# snippet for a parser script (json-to-csv) for the piezo cal data
"""
import json
with open("piezo_cal.json", "r") as f:
foo = json.loads(f.read())
for (step, z, piezo) in foo:
print(f"{step}, {z}, {piezo}")
"""