diff --git a/src/fmripost_aroma/cli/workflow.py b/src/fmripost_aroma/cli/workflow.py index 9505f85..b612dee 100644 --- a/src/fmripost_aroma/cli/workflow.py +++ b/src/fmripost_aroma/cli/workflow.py @@ -40,7 +40,6 @@ def build_workflow(config_file, retval): from fmriprep.utils.misc import check_deps from nireports.assembler.tools import generate_reports from niworkflows.utils.bids import collect_participants - from niworkflows.utils.misc import check_valid_fs_license from pkg_resources import resource_filename as pkgrf from fmripost_aroma import config @@ -116,30 +115,6 @@ def build_workflow(config_file, retval): retval['workflow'] = init_fmripost_aroma_wf() - # Check for FS license after building the workflow - if not check_valid_fs_license(): - from fmripost_aroma.utils.misc import fips_enabled - - if fips_enabled(): - build_log.critical( - """\ -ERROR: Federal Information Processing Standard (FIPS) mode is enabled on your system. \ -FreeSurfer (and thus fMRIPost-AROMA) cannot be used in FIPS mode. \ -Contact your system administrator for assistance.""" - ) - else: - build_log.critical( - """\ -ERROR: a valid license file is required for FreeSurfer to run. \ -fMRIPost-AROMA looked for an existing license file at several paths, in this order: \ -1) command line argument ``--fs-license-file``; \ -2) ``$FS_LICENSE`` environment variable; and \ -3) the ``$FREESURFER_HOME/license.txt`` path. \ -Get it (for free) by registering at https://surfer.nmr.mgh.harvard.edu/registration.html""" - ) - retval['return_code'] = 126 # 126 == Command invoked cannot execute. - return retval - # Check workflow for missing commands missing = check_deps(retval['workflow']) if missing: diff --git a/src/fmripost_aroma/data/io_spec.json b/src/fmripost_aroma/data/io_spec.json index 750d3cd..cb1b2e4 100644 --- a/src/fmripost_aroma/data/io_spec.json +++ b/src/fmripost_aroma/data/io_spec.json @@ -69,6 +69,8 @@ null ], "space": null, + "res": null, + "den": null, "desc": "confounds", "suffix": "timeseries", "extension": [ diff --git a/src/fmripost_aroma/data/tests/config.toml b/src/fmripost_aroma/data/tests/config.toml index d19940b..8dc1353 100644 --- a/src/fmripost_aroma/data/tests/config.toml +++ b/src/fmripost_aroma/data/tests/config.toml @@ -13,7 +13,6 @@ aggr_ses_reports = false bids_dir = "/home/runner/work/fmripost-aroma/fmripost-aroma/src/fmripost_aroma/tests/data" bids_description_hash = "5d42e27751bbc884eca87cb4e62b9a0cca0cd86f8e578747fe89b77e6c5b21e5" boilerplate_only = false -fs_license_file = "/opt/freesurfer/license.txt" log_dir = "/home/runner/work/fmripost-aroma/fmripost-aroma/src/fmripost_aroma/tests/data" log_level = 40 low_mem = false diff --git a/src/fmripost_aroma/workflows/base.py b/src/fmripost_aroma/workflows/base.py index 74d2e47..9605192 100644 --- a/src/fmripost_aroma/workflows/base.py +++ b/src/fmripost_aroma/workflows/base.py @@ -29,9 +29,11 @@ """ +import os import sys from copy import deepcopy +import yaml from nipype.pipeline import engine as pe from packaging.version import Version @@ -349,9 +351,22 @@ def init_single_subject_wf(subject_id: str): ica_aroma_wf.inputs.inputnode.bold_mask_std = functional_cache['bold_mask_std'] workflow.add_nodes([ica_aroma_wf]) + config.loggers.workflow.info( + ( + f"Collected run data for {os.path.basename(bold_file)}:\n" + f"{yaml.dump(functional_cache, default_flow_style=False, indent=4)}" + ), + ) + if config.workflow.dummy_scans is not None: skip_vols = config.workflow.dummy_scans else: + if not functional_cache['confounds']: + raise ValueError( + 'No confounds detected. ' + 'Automatical dummy scan detection cannot be performed. ' + 'Please set the `--dummy-scans` flag explicitly.' + ) skip_vols = get_nss(functional_cache['confounds']) ica_aroma_wf.inputs.inputnode.confounds = functional_cache['confounds']