File tree Expand file tree Collapse file tree 3 files changed +14
-11
lines changed Expand file tree Collapse file tree 3 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -389,8 +389,12 @@ def parse_args(args=None, namespace=None):
389
389
390
390
# First check that bids_dir looks like a BIDS folder
391
391
config .init_layout ()
392
+ all_subjects = config .execution .layout .get_subjects ()
393
+ if config .execution .participant_label is None :
394
+ config .execution .participant_label = all_subjects
395
+
392
396
participant_label = set (config .execution .participant_label )
393
- missing_subjects = participant_label - set (config . execution . layout . get_subjects () )
397
+ missing_subjects = participant_label - set (all_subjects )
394
398
if missing_subjects :
395
399
config .loggers .cli .error (
396
400
"One or more participant labels were not found in the BIDS directory: "
Original file line number Diff line number Diff line change @@ -27,13 +27,14 @@ def build_workflow(config_file, retval):
27
27
retval ['return_code' ] = 1
28
28
retval ['workflow' ] = None
29
29
30
- # warn if older results exist
30
+ # warn if older results exist: check for dataset_description.json in output folder
31
31
msg = check_pipeline_version (
32
32
version , output_dir / 'fmriprep' / 'dataset_description.json'
33
33
)
34
34
if msg is not None :
35
35
build_log .warning (msg )
36
36
37
+ # Please note this is the input folder's dataset_description.json
37
38
dset_desc_path = config .execution .bids_dir / 'dataset_description.json'
38
39
if dset_desc_path .exists ():
39
40
from hashlib import sha256
Original file line number Diff line number Diff line change @@ -86,6 +86,12 @@ def init_fmriprep_wf():
86
86
else :
87
87
fmriprep_wf .add_nodes ([single_subject_wf ])
88
88
89
+ # Dump a copy of the config file into the log directory
90
+ log_dir = config .execution .output_dir / 'fmriprep' / 'sub-{}' .format (subject_id ) \
91
+ / 'log' / config .execution .run_uuid
92
+ log_dir .mkdir (exist_ok = True , parents = True )
93
+ config .to_filename (log_dir / 'fmriprep.toml' )
94
+
89
95
return fmriprep_wf
90
96
91
97
@@ -294,19 +300,11 @@ def init_single_subject_wf(subject_id):
294
300
('outputnode.t1w2fsnative_xfm' , 'inputnode.t1w2fsnative_xfm' ),
295
301
('outputnode.fsnative2t1w_xfm' , 'inputnode.fsnative2t1w_xfm' )]),
296
302
])
297
-
298
- # Dump a copy of the config file into the log directory
299
- log_dir = config .execution .output_dir / 'fmriprep' / 'sub-{}' .format (subject_id ) \
300
- / 'log' / config .execution .run_uuid
301
- log_dir .mkdir (exist_ok = True , parents = True )
302
- config .to_filename (log_dir / 'fmriprep.toml' )
303
303
return workflow
304
304
305
305
306
306
def _prefix (subid ):
307
- if subid .startswith ('sub-' ):
308
- return subid
309
- return '-' .join (('sub' , subid ))
307
+ return '-' .join (('sub' , subid .lstrip ('sub-' )))
310
308
311
309
312
310
def _pop (inlist ):
You can’t perform that action at this time.
0 commit comments