@@ -37,11 +37,9 @@ def init_rodent_brain_extraction_wf(
3737 final_normalization_quality = 'precise' ,
3838 in_template = 'WHS' ,
3939 init_normalization_quality = '3stage' ,
40- modality = 'T2w' ,
4140 mem_gb = 3.0 ,
4241 name = 'rodent_brain_extraction_wf' ,
4342 omp_nthreads = None ,
44- tpl_suffix = 'T2star' ,
4543 template_spec = None ,
4644 use_float = True ,
4745):
@@ -63,7 +61,7 @@ def init_rodent_brain_extraction_wf(
6361 name = 'inputnode' )
6462
6563 # Find images in templateFlow
66- tpl_target_path = get_template (in_template , resolution = debug + 1 , suffix = tpl_suffix )
64+ tpl_target_path = get_template (in_template , resolution = debug + 1 , suffix = "T2star" if bids_suffix == "T2w" else "T1w" )
6765 tpl_regmask_path = get_template (in_template , resolution = debug + 1 , atlas = 'v3' , desc = 'brain' , suffix = 'mask' )
6866 if tpl_regmask_path :
6967 inputnode .inputs .in_mask = str (tpl_regmask_path )
@@ -125,7 +123,7 @@ def init_rodent_brain_extraction_wf(
125123 interpolation = 'Linear' , invert_transform_flags = True ), name = 'warp_mask' )
126124
127125 # Set up initial spatial normalization
128- init_settings_file = f'data/brainextraction_{ init_normalization_quality } _{ modality } .json'
126+ init_settings_file = f'data/brainextraction_{ init_normalization_quality } _{ bids_suffix } .json'
129127 init_norm = pe .Node (Registration (from_file = pkgr_fn (
130128 'nirodents' , init_settings_file )),
131129 name = 'init_norm' ,
@@ -161,7 +159,7 @@ def init_rodent_brain_extraction_wf(
161159 skullstrip_tpl .inputs .in_file = tpl_target_path
162160
163161 # Normalise skull-stripped image to brain template
164- final_settings_file = f'data/brainextraction_{ final_normalization_quality } _{ modality } .json'
162+ final_settings_file = f'data/brainextraction_{ final_normalization_quality } _{ bids_suffix } .json'
165163 final_norm = pe .Node (Registration (from_file = pkgr_fn (
166164 'nirodents' , final_settings_file )),
167165 name = 'final_norm' ,
@@ -192,7 +190,7 @@ def init_rodent_brain_extraction_wf(
192190
193191 sinker = pe .Node (DataSink (), name = 'sinker' )
194192
195- if modality .lower () == 't2w' :
193+ if bids_suffix .lower () == 't2w' :
196194 wf .connect ([
197195 # resampling, truncation, initial N4, and creation of laplacian
198196 (inputnode , trunc , [('in_files' , 'op1' )]),
@@ -271,7 +269,7 @@ def init_rodent_brain_extraction_wf(
271269 ])
272270 return wf
273271
274- elif modality == 'mp2rage ' :
272+ elif bids_suffix == 't1w ' :
275273 wf .connect ([
276274 # resampling and creation of laplacians
277275 (inputnode , res_target , [('in_files' , 'in_file' )]),
0 commit comments