BIDSQueryError#

exception neurocaps.exceptions.BIDSQueryError[source]#

Bases: Exception

BIDS File Querying Exception.

Raised in TimeseriesExtractor.get_bold() when a pybids BIDSLayout returns no subject IDs when querying the BIDS directory.

This error may occur due to:
  • Incorrect template space (e.g. using the default “MNI152NLin2009cAsym” when a different space is used).

  • File naming issues where required entities (e.g. “sub-”, “space-”, “task-”, “desc-”) are missing.

  • An incorrect task name specified in the task parameter.

  • The directory being changed during the current Python session (e.g. new files added, file names changed, etc), resulting in the cache needing to be cleared using TimeseriesExtractor._call_layout.cache_clear().

Refer to NeuroCAPs’ BIDS Structure and Entities for additional information on the expected directory structure and entities needed for querying.