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