@@ -142,7 +142,7 @@ def merge_help(wrapper_help, target_help):
142
142
# Make sure we're not clobbering options we don't mean to
143
143
overlap = set (w_flags ).intersection (t_flags )
144
144
expected_overlap = set (['h' , 'version' , 'w' , 'template-resampling-grid' ,
145
- 'fs-license-file' , 'use-plugin' ])
145
+ 'fs-license-file' , 'fs-subjects-dir' , ' use-plugin' ])
146
146
147
147
assert overlap == expected_overlap , "Clobbering options: {}" .format (
148
148
', ' .join (overlap - expected_overlap ))
@@ -242,6 +242,10 @@ def get_parser():
242
242
default = os .getenv ('FS_LICENSE' , None ),
243
243
help = 'Path to FreeSurfer license key file. Get it (for free) by registering'
244
244
' at https://surfer.nmr.mgh.harvard.edu/registration.html' )
245
+ g_wrap .add_argument (
246
+ '--fs-subjects-dir' , metavar = 'PATH' , type = os .path .abspath ,
247
+ help = 'Path to existing FreeSurfer subjects directory to reuse. '
248
+ '(default: OUTPUT_DIR/freesurfer)' )
245
249
g_wrap .add_argument (
246
250
'--use-plugin' , metavar = 'PATH' , action = 'store' , default = None ,
247
251
type = os .path .abspath , help = 'nipype plugin configuration file' )
@@ -366,6 +370,10 @@ def main():
366
370
main_args .append ('/out' )
367
371
main_args .append (opts .analysis_level )
368
372
373
+ if opts .fs_subjects_dir :
374
+ command .extend (['-v' , '{}:/opt/subjects' .format (opts .fs_subjects_dir )])
375
+ unknown_args .extend (['--fs-subjects-dir' , '/opt/subjects' ])
376
+
369
377
if opts .work_dir :
370
378
command .extend (['-v' , ':' .join ((opts .work_dir , '/scratch' ))])
371
379
unknown_args .extend (['-w' , '/scratch' ])
0 commit comments