Epoching
rename_events
module-attribute
¶
rename_events = dict()
A dictionary specifying which events in the BIDS dataset to rename upon loading, and before processing begins.
Pass an empty dictionary to not perform any renaming.
Example
Rename audio_left
in the BIDS dataset to audio/left
in the
pipeline:
rename_events = {'audio_left': 'audio/left'}
on_rename_missing_events
module-attribute
¶
on_rename_missing_events = 'raise'
How to handle the situation where you specified an event to be renamed via
rename_events
, but this particular event is not present in the data. By
default, we will raise an exception to avoid accidental mistakes due to typos;
however, if you're sure what you're doing, you may change this to 'warn'
to only get a warning instead, or 'ignore'
to ignore it completely.
event_repeated
module-attribute
¶
event_repeated = 'error'
How to handle repeated events. We call events "repeated" if more than one event
occurred at the exact same time point. Currently, MNE-Python cannot handle
this situation gracefully when trying to create epochs, and will throw an
error. To only keep the event of that time point ("first" here referring to
the order that events appear in *_events.tsv
), pass 'drop'
. You can also
request to create a new type of event by merging repeated events by setting
this to 'merge'
.
Warning
The 'merge'
option is entirely untested in the MNE BIDS Pipeline as of
April 1st, 2021.
conditions
module-attribute
¶
conditions = None
The time-locked events based on which to create evoked responses.
This can either be name of the experimental condition as specified in the
BIDS *_events.tsv
file; or the name of condition groups, if the condition
names contain the (MNE-specific) group separator, /
. See the Subselecting
epochs tutorial
for more information.
Passing a dictionary allows to assign a name to map a complex condition name (value) to a more legible one (value).
This is a required parameter in the configuration file, unless you are
processing resting-state data. If left as None
and
task_is_rest
is not True
, we will raise an error.
Example
Specifying conditions as lists of strings:
conditions = ['auditory/left', 'visual/left']
conditions = ['auditory/left', 'auditory/right']
conditions = ['auditory'] # All "auditory" conditions (left AND right)
conditions = ['auditory', 'visual']
conditions = ['left', 'right']
conditions = None # for a resting-state analysis
epochs_tmin
module-attribute
¶
epochs_tmin = -0.2
The beginning of an epoch, relative to the respective event, in seconds.
Example
epochs_tmin = -0.2 # 200 ms before event onset
epochs_tmax
module-attribute
¶
epochs_tmax = 0.5
The end of an epoch, relative to the respective event, in seconds.
Example
epochs_tmax = 0.5 # 500 ms after event onset
baseline
module-attribute
¶
baseline = (None, 0)
Specifies which time interval to use for baseline correction of epochs;
if None
, no baseline correction is applied.
Example
baseline = (None, 0) # beginning of epoch until time point zero
epochs_metadata_tmin
module-attribute
¶
epochs_metadata_tmin = None
The beginning of the time window for metadata generation, in seconds,
relative to the time-locked event of the respective epoch. This may be less
than or larger than the epoch's first time point. If None
, use the first
time point of the epoch.
epochs_metadata_tmax
module-attribute
¶
epochs_metadata_tmax = None
Same as epochs_metadata_tmin
, but specifying the end of the time
window for metadata generation.
epochs_metadata_keep_first
module-attribute
¶
epochs_metadata_keep_first = None
Event groupings using hierarchical event descriptors (HEDs) for which to store
the time of the first occurrence of any event of this group in a new column
with the group name, and the type of that event in a column named after the
group, but with a first_
prefix. If None
(default), no event
aggregation will take place and no new columns will be created.
Example
Assume you have two response events types, response/left
and
response/right
; in some trials, both responses occur, because the
participant pressed both buttons. Now, you want to keep the first response
only. To achieve this, set
epochs_metadata_keep_first = ['response']
response
, indicating
the time relative to the time-locked event; and first_response
,
depicting the type of event ('left'
or 'right'
).
You may also specify a grouping for multiple event types:
epochs_metadata_keep_first = ['response', 'stimulus']
response
, first_response
, stimulus
,
and first_stimulus
.
epochs_metadata_keep_last
module-attribute
¶
epochs_metadata_keep_last = None
Same as epochs_metadata_keep_first
, but for keeping the last
occurrence of matching event types. The columns indicating the event types
will be named with a last_
instead of a first_
prefix.
epochs_metadata_query
module-attribute
¶
epochs_metadata_query = None
A [metadata query][https://mne.tools/stable/auto_tutorials/epochs/30_epochs_metadata.html] specifying which epochs to keep. If the query fails because it refers to an unknown metadata column, a warning will be emitted and all epochs will be kept.
Example
Only keep epochs without a response_missing
event:
epochs_metadata_query = ['response_missing.isna()']
rest_epochs_duration
module-attribute
¶
rest_epochs_duration = None
Duration of epochs in seconds.
rest_epochs_overlap
module-attribute
¶
rest_epochs_overlap = None
Overlap between epochs in seconds. This is used if the task is 'rest'
and when the annotations do not contain any stimulation or behavior events.