diff --git a/src/fmripost_phase/cli/parser.py b/src/fmripost_phase/cli/parser.py index 1431610..77c8c5d 100644 --- a/src/fmripost_phase/cli/parser.py +++ b/src/fmripost_phase/cli/parser.py @@ -244,6 +244,7 @@ def _bids_filter(value, parser): action=ToDict, metavar='PACKAGE=PATH', nargs='+', + required=True, help=( 'Search PATH(s) for pre-computed derivatives. ' 'These may be provided as named folders ' diff --git a/src/fmripost_phase/workflows/base.py b/src/fmripost_phase/workflows/base.py index fa71ffd..8e8859a 100644 --- a/src/fmripost_phase/workflows/base.py +++ b/src/fmripost_phase/workflows/base.py @@ -305,47 +305,21 @@ def init_single_run_wf(bold_file): entities = extract_entities(bold_file) functional_cache = defaultdict(list, {}) - if config.execution.derivatives: - # Collect native-space derivatives and transforms - functional_cache = collect_derivatives( - raw_dataset=config.execution.layout, - derivatives_dataset=None, - entities=entities, - fieldmap_id=None, - allow_multiple=False, - spaces=None, - ) - for deriv_dir in config.execution.derivatives.values(): - functional_cache = update_dict( - functional_cache, - collect_derivatives( - raw_dataset=None, - derivatives_dataset=deriv_dir, - entities=entities, - fieldmap_id=None, - allow_multiple=False, - spaces=spaces, - ), - ) - - if not functional_cache['confounds']: - if config.workflow.dummy_scans is None: - raise ValueError( - 'No confounds detected. ' - 'Automatical dummy scan detection cannot be performed. ' - 'Please set the `--dummy-scans` flag explicitly.' - ) - - # TODO: Calculate motion parameters from motion correction transform - raise ValueError('Motion parameters cannot be extracted from transforms yet.') - - else: - # Collect MNI152NLin6Asym:res-2 derivatives - # Only derivatives dataset was passed in, so we expected standard-space derivatives - functional_cache.update( + # Collect native-space derivatives and transforms + functional_cache = collect_derivatives( + raw_dataset=config.execution.layout, + derivatives_dataset=None, + entities=entities, + fieldmap_id=None, + allow_multiple=False, + spaces=None, + ) + for deriv_dir in config.execution.derivatives.values(): + functional_cache = update_dict( + functional_cache, collect_derivatives( raw_dataset=None, - derivatives_dataset=config.execution.layout, + derivatives_dataset=deriv_dir, entities=entities, fieldmap_id=None, allow_multiple=False, @@ -353,6 +327,17 @@ def init_single_run_wf(bold_file): ), ) + if not functional_cache['confounds']: + if config.workflow.dummy_scans is None: + raise ValueError( + 'No confounds detected. ' + 'Automatical dummy scan detection cannot be performed. ' + 'Please set the `--dummy-scans` flag explicitly.' + ) + + # TODO: Calculate motion parameters from motion correction transform + raise ValueError('Motion parameters cannot be extracted from transforms yet.') + config.loggers.workflow.info( ( f'Collected run data for {os.path.basename(bold_file)}:\n' @@ -371,10 +356,6 @@ def init_single_run_wf(bold_file): ) skip_vols = get_nss(functional_cache['confounds']) - workflow.__desc__ += """\ -Raw BOLD series were resampled to MNI152NLin6Asym:res-2, for ICA-Phase classification. -""" - validate_bold = pe.Node( ValidateImage(in_file=functional_cache['bold_raw']), name='validate_bold',