42
42
]
43
43
"""List of supported nonstandard reference spaces."""
44
44
45
+ NONSTANDARD_2D_REFERENCES = ["fsnative" ]
46
+ """List of supported nonstandard 2D reference spaces."""
45
47
46
48
FSAVERAGE_DENSITY = {
47
49
"fsaverage3" : "642" ,
@@ -117,6 +119,16 @@ class Reference:
117
119
>>> Reference('MNIPediatricAsym', {'cohort': 1}).standard
118
120
True
119
121
122
+ >>> # Check dim property
123
+ >>> Reference('func').dim
124
+ 3
125
+ >>> Reference('MNI152NLin6Asym').dim
126
+ 3
127
+ >>> Reference('fsnative').dim
128
+ 2
129
+ >>> Reference('onavg').dim
130
+ 2
131
+
120
132
>>> # Equality/inequality checks
121
133
>>> Reference('func') == Reference('func')
122
134
True
@@ -138,6 +150,7 @@ class Reference:
138
150
"""
139
151
140
152
_standard_spaces = tuple (_tfapi .templates ())
153
+ _spaces_2d = tuple (_tfapi .templates (suffix = "sphere" ))
141
154
142
155
space = attr .ib (default = None , type = str )
143
156
"""Name designating this space."""
@@ -165,7 +178,7 @@ def __attrs_post_init__(self):
165
178
spec ["den" ] = FSAVERAGE_DENSITY [space ]
166
179
object .__setattr__ (self , "spec" , spec )
167
180
168
- if self .space . startswith ( "fs" ):
181
+ if ( self .space in self . _spaces_2d ) or ( self . space in NONSTANDARD_2D_REFERENCES ):
169
182
object .__setattr__ (self , "dim" , 2 )
170
183
171
184
if self .space in self ._standard_spaces :
0 commit comments