/
dimnames.jl
113 lines (82 loc) · 2.44 KB
/
dimnames.jl
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#=
* This is a very minimal implementation along the lines of properties from this:
http://bioportal.bioontology.org/ontologies/FMA. Instead of defining a complex
type hierarchy we need to use traits because this will invetiably evolve.
* It might be good adopt something like FilePathsBase.jl and parts of each "path"
could be subject to these methods/traits.
=#
"""
is_left(x) -> Bool
Returns `true` if `x` represent the left position.
"""
is_left(x::Symbol) = (x === :left) || (x === :L)
"""
is_right(x) -> Bool
Returns `true` if `x` represent the right position.
"""
is_right(x::Symbol) = (x === :right) || (x === :R)
"""
is_anterior(x) -> Bool
Returns `true` if `x` represent the anterior position.
"""
is_anterior(x::Symbol) = (x === :anterior) || (x === :A)
"""
is_posterior(x) -> Bool
Returns `true` if `x` represent the posterior position.
"""
is_posterior(x::Symbol) = (x === :posterior) || (x === :P)
"""
is_inferior(x) -> Bool
Returns `true` if `x` represent the inferior position.
"""
is_inferior(x::Symbol) = (x === :inferior) || (x === :I)
"""
is_superior(x) -> Bool
Returns `true` if `x` represent the superior position.
"""
is_superior(x::Symbol) = (x === :superior) || (x === :S)
"""
is_sagittal(x) -> Bool
Returns `true` if `x` represent the sagittal orientation.
"""
is_sagittal(x::Symbol) = is_left(x) || is_right(x) || (x === :sagittal)
"""
is_coronal(x) -> Bool
Returns `true` if `x` represent the coronal orientation.
"""
is_coronal(x::Symbol) = is_anterior(x) || is_posterior(x) || (x === :coronal)
"""
is_axial(x) -> Bool
Returns `true` if `x` represent the axial orientation.
"""
is_axial(x::Symbol) = is_superior(x) || is_inferior(x) || (x === :axial)
"""
is_cortical(::T) -> Bool
Returns `true` if `T` represents a cortical region.
"""
is_cortical(x::Symbol) = x === :cortical
"""
is_csf(::T) -> Bool
Returns `true` if `T` represents a region of corticospinal fluid (CSF).
"""
is_csf(x::Symbol) = x === :csf
"""
is_white_matter(::T) -> Bool
Returns `true` if `T` represents white matter.
"""
is_white_matter(x::Symbol) = x === :white_matter
"""
is_gyrus(::T) -> Bool
Returns `true` if `T` represents a gyrus.
"""
is_gyrus(x::Symbol) = x === :gyrus
"""
is_sulcus(::T) -> Bool
Returns `true` if `T` represents a gyrus.
"""
is_sulcus(x::Symbol) = x === :sulcus
"""
is_channel(::T) -> Bool
Returns `true` if `T` represents a gyrus.
"""
is_channel(x::Symbol) = x === :channel