-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
70 lines (56 loc) · 2.22 KB
/
main.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import gui as gui
import data as data
import inputfiles as inputfiles
import phase as phase
import refine as refine
import field as field
import alignholo as alignholo
import matplotlib.pyplot as plt
def main():
def input_files(event):
if not event.inaxes == emgui.event_input.ax:
raise Exception('Improper input axis')
file_path_holo_1, file_path_holo_2, file_path_holo_ref = emgui.open_files()
inputfiles.load_files(file_path_holo_1, file_path_holo_2, file_path_holo_ref, emdata)
print('Files Loaded')
def align_holograms(event):
if not event.inaxes == emgui.event_align.ax:
raise Exception('Improper axis')
emgui.align_holo()
def ft(event):
if not event.inaxes == emgui.event_ft.ax:
raise Exception('Improper axis')
alignholo.deform_image(emgui.fig_align.scale, emgui.fig_align.rotation,
emgui.fig_align.shear, emgui.fig_align.translation, emdata)
emgui.mask_holo()
def phase_calc(event):
if not event.inaxes == emgui.event_phase.ax:
raise Exception('Improper axis')
print(emgui.circle_1.artist.radius)
print(emgui.circle_1.artist.center)
phase.phase(emgui.circle_1.artist.center, emgui.circle_1.artist.radius,
emgui.circle_2.artist.center, emgui.circle_2.artist.radius, emdata)
emgui.phase_holo()
def refine_calc(event):
if not event.inaxes == emgui.event_refine.ax:
raise Exception('Improper axis')
u = emgui.reference_extract(emgui.rect.rectangle)
refine.update_ref(u, emdata)
emgui.refine_gui()
def field_calc(event):
if not event.inaxes == emgui.event_field.ax:
raise Exception('Improper axis')
field.fields(emdata)
emgui.field_gui()
emdata = data.EMdata()
emgui = gui.HoloEMgui(emdata)
emgui.flow()
emgui.event_input.on_clicked(input_files)
emgui.event_align.on_clicked(align_holograms)
emgui.event_ft.on_clicked(ft)
emgui.event_phase.on_clicked(phase_calc)
emgui.event_refine.on_clicked(refine_calc)
emgui.event_field.on_clicked(field_calc)
plt.show()
if __name__ == "__main__":
main()