Skip to content

Commit a626776

Browse files
committed
enforce T1w presence if not derivatives given, always warn
1 parent a05ddfc commit a626776

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

fmriprep/cli/parser.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,12 @@ def parse_args(args=None, namespace=None):
825825
"Making sure the input data is BIDS compliant (warnings can be ignored in most "
826826
"cases)."
827827
)
828-
validate_input_dir(config.environment.exec_env, opts.bids_dir, opts.participant_label)
828+
validate_input_dir(
829+
config.environment.exec_env,
830+
opts.bids_dir,
831+
opts.participant_label,
832+
need_T1w=not config.execution.derivatives,
833+
)
829834

830835
# Setup directories
831836
config.execution.log_dir = config.execution.fmriprep_dir / "logs"

fmriprep/utils/bids.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def write_derivative_description(bids_dir, deriv_dir):
146146
Path.write_text(deriv_dir / 'dataset_description.json', json.dumps(desc, indent=4))
147147

148148

149-
def validate_input_dir(exec_env, bids_dir, participant_label):
149+
def validate_input_dir(exec_env, bids_dir, participant_label, need_T1w=True):
150150
# Ignore issues and warnings that should not influence FMRIPREP
151151
import subprocess
152152
import tempfile
@@ -197,6 +197,7 @@ def validate_input_dir(exec_env, bids_dir, participant_label):
197197
"MISSING_SESSION",
198198
"NO_T1W",
199199
],
200+
"error": ["NO_T1W"] if need_T1w else [],
200201
"ignoredFiles": ['/dataset_description.json', '/participants.tsv'],
201202
}
202203
# Limit validation only to data from requested participants

0 commit comments

Comments
 (0)