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:
103103 structures : dict
104104 Mapping from structure names to ``Pointset``
105105 """
106+ def __init__ (self , structures ):
107+ self .structures = structures
106108
107109 @classmethod
108110 def from_spec (klass , pathlike ):
Original file line number Diff line number Diff line change @@ -27,11 +27,26 @@ def from_spec(klass, pathlike):
2727 "lh" : FreeSurferHemisphere .from_filename (surfs / "lh.white" ),
2828 "rh" : FreeSurferHemisphere .from_filename (surfs / "rh.white" ),
2929 }
30- subject = super (). __init__ (structures )
30+ subject = klass (structures )
3131 subject ._subject_dir = subject_dir
3232 return subject
3333
3434
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+
3550def test_Cifti2Image_as_CoordImage ():
3651 ones = nb .load (CIFTI2_DATA / "ones.dscalar.nii" )
3752 axes = [ones .header .get_axis (i ) for i in range (ones .ndim )]
You can’t perform that action at this time.
0 commit comments