22
22
from niworkflows .interfaces .fixes import FixHeaderApplyTransforms as ApplyTransforms
23
23
from niworkflows .interfaces .freesurfer import MedialNaNs
24
24
25
- from .. .config import DEFAULT_MEMORY_MIN_GB
25
+ from nibabies .config import DEFAULT_MEMORY_MIN_GB
26
26
27
27
28
28
def init_bold_surf_wf (
29
- mem_gb , surface_spaces , medial_surface_nan , project_goodvoxels , name = "bold_surf_wf"
29
+ * ,
30
+ mem_gb : float ,
31
+ surface_spaces : list ,
32
+ medial_surface_nan : bool ,
33
+ project_goodvoxels : bool ,
34
+ surface_recon_method : str ,
35
+ name : str = "bold_surf_wf" ,
30
36
):
31
37
"""
32
38
Sample functional images to FreeSurfer surfaces.
@@ -184,6 +190,14 @@ def select_target(subject_id, space):
184
190
name = "outputnode" ,
185
191
)
186
192
193
+ # Some recon methods do not create T1
194
+ if surface_recon_method == 'freesurfer' :
195
+ fsnative_file = 'T1'
196
+ elif surface_recon_method in ('infantfs' , 'mcribs' ):
197
+ fsnative_file = 'brain'
198
+ else :
199
+ raise NotImplementedError (f"Surface recon method: { surface_recon_method } " )
200
+
187
201
# fmt: off
188
202
workflow .connect ([
189
203
(inputnode , get_fsnative , [
@@ -195,8 +209,7 @@ def select_target(subject_id, space):
195
209
("source_file" , "src_file" ),
196
210
("t1w2fsnative_xfm" , "in_file" ),
197
211
]),
198
- # TODO: Dynamically adjust based on MCRIBS/InfantFS/FS
199
- (get_fsnative , itk2lta , [('brain' , 'dst_file' )]), # InfantFS: Use brain instead of T1
212
+ (get_fsnative , itk2lta , [(fsnative_file , 'dst_file' )]),
200
213
(inputnode , sampler , [
201
214
("subjects_dir" , "subjects_dir" ),
202
215
("subject_id" , "subject_id" ),
0 commit comments