1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 """The fix user function definitions."""
24
25
26 from graphics import WIZARD_IMAGE_PATH
27 from pipe_control import fix
28 from user_functions.data import Uf_info; uf_info = Uf_info()
29 from user_functions.objects import Desc_container
30
31
32
33 uf = uf_info.add_uf('fix')
34 uf.title = "Fix or allow parameter values to change during optimisation."
35 uf.title_short = "Fixing of parameters."
36 uf.display = True
37 uf.add_keyarg(
38 name = "element",
39 py_type = "str",
40 desc_short = "element",
41 desc = "Which element to fix.",
42 wiz_element_type = "combo",
43 wiz_combo_choices = [
44 "Diffusion tensor parameters",
45 "All parameters from all spins",
46 "All parameters (diffusion and spin)"],
47 wiz_combo_data = [
48 "diff",
49 "all_spins",
50 "all"],
51 wiz_read_only = True,
52 )
53 uf.add_keyarg(
54 name = "fixed",
55 default = True,
56 py_type = "bool",
57 desc_short = "fixed",
58 desc = "A flag specifying if the parameters should be fixed or allowed to change."
59 )
60
61 uf.desc.append(Desc_container())
62 uf.desc[-1].add_paragraph("The element can be any of the following:")
63 uf.desc[-1].add_item_list_element("'diff'", "The diffusion tensor parameters. This will allow all diffusion tensor parameters to be toggled.")
64 uf.desc[-1].add_item_list_element("'all_spins'", "Using this keyword, all parameters from all spins will be toggled.")
65 uf.desc[-1].add_item_list_element("'all'", "All parameters will be toggled. This is equivalent to combining both 'diff' and 'all_spins'.")
66 uf.desc[-1].add_paragraph("The flag 'fixed', if set to True, will fix parameters during optimisation whereas a value of False will allow parameters to vary.")
67 uf.backend = fix.fix
68 uf.menu_text = "&fix"
69 uf.gui_icon = "oxygen.status.object-locked"
70 uf.wizard_height_desc = 400
71 uf.wizard_size = (800, 600)
72 uf.wizard_apply_button = False
73 uf.wizard_image = WIZARD_IMAGE_PATH + 'object-locked-unlocked.png'
74