File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 43
43
44
44
LOGGER = logging .getLogger ('nipype.interface' )
45
45
46
+ _ORI_TO_NAME = {
47
+ 'L' : 'Left' ,
48
+ 'R' : 'Right' ,
49
+ 'A' : 'Anterior' ,
50
+ 'P' : 'Posterior' ,
51
+ 'S' : 'Superior' ,
52
+ 'I' : 'Inferior' ,
53
+ }
54
+
55
+ _OPPOSITE = {
56
+ 'L' : 'R' ,
57
+ 'R' : 'L' ,
58
+ 'A' : 'P' ,
59
+ 'P' : 'A' ,
60
+ 'S' : 'I' ,
61
+ 'I' : 'S' ,
62
+ }
63
+
64
+
65
+ def get_world_pedir (orientation : str , pe_dir : str ) -> str :
66
+ """Return the world phase-encoding direction."""
67
+
68
+ orientation = orientation .upper ()
69
+ axis = pe_dir [0 ].lower ()
70
+ idx = {'i' : 0 , 'j' : 1 , 'k' : 2 }[axis ]
71
+ letter = orientation [idx ]
72
+
73
+ if pe_dir .endswith ('-' ):
74
+ start = letter
75
+ end = _OPPOSITE [letter ]
76
+ else :
77
+ start = _OPPOSITE [letter ]
78
+ end = letter
79
+
80
+ return f"{ _ORI_TO_NAME [start ]} -{ _ORI_TO_NAME [end ]} "
81
+
46
82
SUBJECT_TEMPLATE = """\
47
83
\t <ul class="elem-desc">
48
84
\t \t <li>Subject ID: {subject_id}</li>
You can’t perform that action at this time.
0 commit comments