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 irrelevant modalities when initializing layout #2386

Closed
jdkent opened this issue Mar 12, 2021 · 2 comments
Closed

ignore irrelevant modalities when initializing layout #2386

jdkent opened this issue Mar 12, 2021 · 2 comments
Labels
BIDS effort: low Estimated low effort task error reporting impact: high Estimated high impact task optimization UX
Milestone

Comments

@jdkent
Copy link
Collaborator

jdkent commented Mar 12, 2021

In theory, BIDS datasets should be completely valid, in practice, sometimes not all files are valid in a dataset yet.
If a lab is working on converting their project to a BIDS valid dataset that contains many modalities, they may focus on getting anat, func, and fmap to get things right, but may not have finished:

  • dwi
  • perf
  • meg
  • eeg
  • ieeg
  • beh

Currently, one can skip validation (even if you do not, a multitude of irrelevant errors are ignored)

validator_config_dict = {
"ignore": [
"EVENTS_COLUMN_ONSET",
"EVENTS_COLUMN_DURATION",
"TSV_EQUAL_ROWS",
"TSV_EMPTY_CELL",
"TSV_IMPROPER_NA",
"VOLUME_COUNT_MISMATCH",
"BVAL_MULTIPLE_ROWS",
"BVEC_NUMBER_ROWS",
"DWI_MISSING_BVAL",
"INCONSISTENT_SUBJECTS",
"INCONSISTENT_PARAMETERS",
"BVEC_ROW_LENGTH",
"B_FILE",
"PARTICIPANT_ID_COLUMN",
"PARTICIPANT_ID_MISMATCH",
"TASK_NAME_MUST_DEFINE",
"PHENOTYPE_SUBJECTS_MISSING",
"STIMULUS_FILE_MISSING",
"DWI_MISSING_BVEC",
"EVENTS_TSV_MISSING",
"TSV_IMPROPER_NA",
"ACQTIME_FMT",
"Participants age 89 or higher",
"DATASET_DESCRIPTION_JSON_MISSING",
"FILENAME_COLUMN",
"WRONG_NEW_LINE",
"MISSING_TSV_COLUMN_CHANNELS",
"MISSING_TSV_COLUMN_IEEG_CHANNELS",
"MISSING_TSV_COLUMN_IEEG_ELECTRODES",
"UNUSED_STIMULUS",
"CHANNELS_COLUMN_SFREQ",
"CHANNELS_COLUMN_LOWCUT",
"CHANNELS_COLUMN_HIGHCUT",
"CHANNELS_COLUMN_NOTCH",
"CUSTOM_COLUMN_WITHOUT_DESCRIPTION",
"ACQTIME_FMT",
"SUSPICIOUSLY_LONG_EVENT_DESIGN",
"SUSPICIOUSLY_SHORT_EVENT_DESIGN",
"MALFORMED_BVEC",
"MALFORMED_BVAL",
"MISSING_TSV_COLUMN_EEG_ELECTRODES",
"MISSING_SESSION"
],
"error": ["NO_T1W"],
"ignoredFiles": ['/dataset_description.json', '/participants.tsv']
}

but if one has malformed json files, the pybids indexer will still fail on potentially irrelevant (to fmriprep) files.

So my proposed solution is to ignore all the directories above when creating the bids layout so they will not be indexed (e.g., re.compile("sub-.*/beh")):

fmriprep/fmriprep/config.py

Lines 448 to 455 in 4bb8a61

ignore=(
"code",
"stimuli",
"sourcedata",
"models",
re.compile(r"^\."),
),
)

This may also have the added benefit of making indexing faster on larger datasets with many modalities.

@oesteban oesteban added BIDS effort: low Estimated low effort task impact: high Estimated high impact task UX labels Aug 4, 2021
@oesteban oesteban added this to the 20.2.4 milestone Aug 4, 2021
@oesteban
Copy link
Member

oesteban commented Aug 4, 2021

I think this is a pretty low-hanging fruit - don't you all agree?

@oesteban
Copy link
Member

oesteban commented Aug 6, 2021

We can address this at the same time we remove the following warning:

/home/oesteban/.miniconda/lib/python3.8/site-packages/bids/layout/validation.py:46: UserWarning: The ability to pass arguments to BIDSLayout that control indexing is likely to be removed in future; possibly as e
arly as PyBIDS 0.14. This includes the `config_filename`, `ignore`, `force_index`, and `index_metadata` arguments. The recommended usage pattern is to initialize a new BIDSLayoutIndexer with these arguments, and
 pass it to the BIDSLayout via the `indexer` argument.
  warnings.warn("The ability to pass arguments to BIDSLayout that control "

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BIDS effort: low Estimated low effort task error reporting impact: high Estimated high impact task optimization UX
Projects
None yet
Development

No branches or pull requests

2 participants