Skip to content

Commit

Permalink
Throw a warning when BIDS compliance fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gab-D-G committed Sep 26, 2023
1 parent 6d54e97 commit 792cd55
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 8 additions & 1 deletion rabies/preprocess_pkg/main_wf.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,14 @@ def init_main_wf(data_dir_path, output_folder, opts, name='main_wf'):

import bids
bids.config.set_option('extension_initial_dot', True)
layout = bids.layout.BIDSLayout(data_dir_path, validate=False)
try:
layout = bids.layout.BIDSLayout(data_dir_path, validate=True)
except Exception as e:
from nipype import logging
log = logging.getLogger('nipype.workflow')
log.warning(f"The BIDS compliance failed: {e} \n\nRABIES will run anyway; double-check that the right files were picked up for processing.\n")
layout = bids.layout.BIDSLayout(data_dir_path, validate=False)

split_name, scan_info, run_iter, scan_list, bold_scan_list = prep_bids_iter(
layout, opts.bold_only, inclusion_list=opts.inclusion_ids, exclusion_list=opts.exclusion_ids)

Expand Down
1 change: 0 additions & 1 deletion rabies/preprocess_pkg/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
traits, TraitedSpec, BaseInterfaceInputSpec,
File, BaseInterface
)
from rabies.utils import run_command

def prep_bids_iter(layout, bold_only=False, inclusion_list=['all'], exclusion_list=['none']):
'''
Expand Down

0 comments on commit 792cd55

Please sign in to comment.