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