File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,9 @@ class GeometryCollection:
107
107
Mapping from structure names to ``Pointset``
108
108
"""
109
109
110
+ def __init__ (self , structures ):
111
+ self .structures = structures
112
+
110
113
@classmethod
111
114
def from_spec (klass , pathlike ):
112
115
"""Load a collection of geometries from a specification."""
Original file line number Diff line number Diff line change @@ -28,11 +28,27 @@ def from_spec(klass, pathlike):
28
28
'lh' : FreeSurferHemisphere .from_filename (surfs / 'lh.white' ),
29
29
'rh' : FreeSurferHemisphere .from_filename (surfs / 'rh.white' ),
30
30
}
31
- subject = super (). __init__ (structures )
31
+ subject = klass (structures )
32
32
subject ._subject_dir = subject_dir
33
33
return subject
34
34
35
35
36
+ class CaretSpec (ci .GeometryCollection ):
37
+ @classmethod
38
+ def from_spec (klass , pathlike ):
39
+ from nibabel .cifti2 .caretspec import CaretSpecFile
40
+
41
+ csf = CaretSpecFile .from_filename (pathlike )
42
+ structures = {
43
+ df .structure : df .uri
44
+ for df in csf .data_files
45
+ if df .selected # Use selected to avoid overloading for now
46
+ }
47
+ wbspec = klass (structures )
48
+ wbspec ._specfile = csf
49
+ return wbspec
50
+
51
+
36
52
def test_Cifti2Image_as_CoordImage ():
37
53
ones = nb .load (CIFTI2_DATA / 'ones.dscalar.nii' )
38
54
axes = [ones .header .get_axis (i ) for i in range (ones .ndim )]
You can’t perform that action at this time.
0 commit comments