Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore unselected subjects in BIDSLayoutIndexer #3236

Merged
merged 6 commits into from
Mar 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions fmriprep/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,18 +471,23 @@ def init(cls):
_db_path.mkdir(exist_ok=True, parents=True)

# Recommended after PyBIDS 12.1
ignore_patterns = [
'code',
'stimuli',
'sourcedata',
'models',
re.compile(r'^\.'),
re.compile(r'sub-[a-zA-Z0-9]+(/ses-[a-zA-Z0-9]+)?/(beh|dwi|eeg|ieeg|meg|perf)'),
]
if cls.participant_label:
# Ignore any subjects who aren't the requested ones.
ignore_patterns.append(
re.compile(r'sub-(?!' + '|'.join(cls.participant_label) + r')\w+')
tsalo marked this conversation as resolved.
Show resolved Hide resolved
)
effigies marked this conversation as resolved.
Show resolved Hide resolved

_indexer = BIDSLayoutIndexer(
validate=False,
ignore=(
'code',
'stimuli',
'sourcedata',
'models',
re.compile(r'^\.'),
re.compile(
r'sub-[a-zA-Z0-9]+(/ses-[a-zA-Z0-9]+)?/(beh|dwi|eeg|ieeg|meg|perf)'
),
),
ignore=ignore_patterns,
)
cls._layout = BIDSLayout(
str(cls.bids_dir),
Expand Down