Skip to content

Commit

Permalink
Get it building at least.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed May 16, 2024
1 parent 9d75012 commit f217d16
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 26 deletions.
25 changes: 0 additions & 25 deletions src/fmripost_aroma/cli/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def build_workflow(config_file, retval):
from fmriprep.utils.misc import check_deps
from nireports.assembler.tools import generate_reports

Check warning on line 41 in src/fmripost_aroma/cli/workflow.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/cli/workflow.py#L39-L41

Added lines #L39 - L41 were not covered by tests
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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions src/fmripost_aroma/data/io_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
null
],
"space": null,
"res": null,
"den": null,
"desc": "confounds",
"suffix": "timeseries",
"extension": [
Expand Down
1 change: 0 additions & 1 deletion src/fmripost_aroma/data/tests/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions src/fmripost_aroma/workflows/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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(

Check warning on line 354 in src/fmripost_aroma/workflows/base.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/workflows/base.py#L354

Added line #L354 was not covered by tests
(
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

Check warning on line 362 in src/fmripost_aroma/workflows/base.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/workflows/base.py#L362

Added line #L362 was not covered by tests
else:
if not functional_cache['confounds']:
raise ValueError(

Check warning on line 365 in src/fmripost_aroma/workflows/base.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/workflows/base.py#L365

Added line #L365 was not covered by tests
'No confounds detected. '
'Automatical dummy scan detection cannot be performed. '
'Please set the `--dummy-scans` flag explicitly.'
)
skip_vols = get_nss(functional_cache['confounds'])

Check warning on line 370 in src/fmripost_aroma/workflows/base.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/workflows/base.py#L370

Added line #L370 was not covered by tests

ica_aroma_wf.inputs.inputnode.confounds = functional_cache['confounds']
Expand Down

0 comments on commit f217d16

Please sign in to comment.