@@ -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' ,
@@ -163,7 +161,7 @@ def init_rodent_brain_extraction_wf(
163161 skullstrip_tpl .inputs .in_file = tpl_target_path
164162
165163 # Normalise skull-stripped image to brain template
166- final_settings_file = f'data/brainextraction_{ final_normalization_quality } _{ modality } .json'
164+ final_settings_file = f'data/brainextraction_{ final_normalization_quality } _{ bids_suffix } .json'
167165 final_norm = pe .Node (Registration (from_file = pkgr_fn (
168166 'nirodents' , final_settings_file )),
169167 name = 'final_norm' ,
@@ -194,7 +192,7 @@ def init_rodent_brain_extraction_wf(
194192
195193 sinker = pe .Node (DataSink (), name = 'sinker' )
196194
197- if modality .lower () == 't2w' :
195+ if bids_suffix .lower () == 't2w' :
198196 wf .connect ([
199197 # resampling, truncation, initial N4, and creation of laplacian
200198 (inputnode , trunc , [('in_files' , 'op1' )]),
@@ -273,7 +271,7 @@ def init_rodent_brain_extraction_wf(
273271 ])
274272 return wf
275273
276- elif modality == 'mp2rage ' :
274+ elif bids_suffix == 't1w ' :
277275 wf .connect ([
278276 # resampling and creation of laplacians
279277 (inputnode , res_target , [('in_files' , 'in_file' )]),
0 commit comments