mne.AcqParserFIF

class mne.AcqParserFIF(info)[source]

Parser for Elekta data acquisition settings.

This class parses parameters (e.g. events and averaging categories) that are defined in the Elekta TRIUX/VectorView data acquisition software (DACQ) and stored in info['acq_pars']. It can be used to reaverage raw data according to DACQ settings and modify original averaging settings if necessary.

Parameters:

info : Info

An instance of Info where the DACQ parameters will be taken from.

See also

mne.io.Raw.acqparser
access the parser through a Raw attribute

Notes

Any averaging category (also non-active ones) can be accessed by indexing as acqparserfif['category_name'].

Attributes

categories Return list of averaging categories ordered by DACQ index.
events Return events ordered by DACQ index.
reject (dict) Rejection criteria from DACQ that can be used with mne.Epochs. Note that mne does not support all DACQ rejection criteria (e.g. spike, slope).
flat (dict) Flatness rejection criteria from DACQ that can be used with mne.Epochs.
acq_dict (dict) All DACQ parameters.

Methods

__getitem__(item) Return an averaging category, or list of categories.
__hash__() <==> hash(x)
__len__() Return number of averaging categories marked active in DACQ.
get_condition(raw[, condition, …]) Get averaging parameters for a condition (averaging category).
__getitem__(item)[source]

Return an averaging category, or list of categories.

Parameters:

item : str or list of str

Name of the category (comment field in DACQ).

Returns:

conds : dict or list of dict, each with following keys:

comment: str

The comment field in DACQ.

state : bool

Whether the category was marked enabled in DACQ.

index : int

The index of the category in DACQ. Indices start from 1.

event : int

DACQ index of the reference event (trigger event, zero time for the corresponding epochs). Note that the event indices start from 1.

start : float

Start time of epoch relative to the reference event.

end : float

End time of epoch relative to the reference event.

reqevent : int

Index of the required (conditional) event.

reqwhen : int

Whether the required event is required before (1) or after (2) the reference event.

reqwithin : float

The time range within which the required event must occur, before or after the reference event.

display : bool

Whether the category was displayed online in DACQ.

nave : int

Desired number of averages. DACQ stops collecting averages once this number is reached.

subave : int

Whether to compute normal and alternating subaverages, and how many epochs to include. See the Elekta data acquisition manual for details. Currently the class does not offer any facility for computing subaverages, but it can be done manually by the user after collecting the epochs.

__hash__() <==> hash(x)
__len__()[source]

Return number of averaging categories marked active in DACQ.

categories

Return list of averaging categories ordered by DACQ index.

Only returns categories marked active in DACQ.

events

Return events ordered by DACQ index.

Only returns events that are in use (referred to by a category).

get_condition(raw, condition=None, stim_channel=None, mask=None, uint_cast=None, mask_type='and', delayed_lookup=True)[source]

Get averaging parameters for a condition (averaging category).

Output is designed to be used with the Epochs class to extract the corresponding epochs.

Parameters:

raw : Raw object

An instance of Raw.

condition : None | str | dict | list of dict

Condition or a list of conditions. Conditions can be strings (DACQ comment field, e.g. ‘Auditory left’) or category dicts (e.g. acqp[‘Auditory left’], where acqp is an instance of AcqParserFIF). If None, get all conditions marked active in DACQ.

stim_channel : None | string | list of string

Name of the stim channel or all the stim channels affected by the trigger. If None, the config variables ‘MNE_STIM_CHANNEL’, ‘MNE_STIM_CHANNEL_1’, ‘MNE_STIM_CHANNEL_2’, etc. are read. If these are not found, it will fall back to ‘STI101’ or ‘STI 014’ if present, then fall back to the first channel of type ‘stim’, if present.

mask : int | None

The value of the digital mask to apply to the stim channel values. If None (default), no masking is performed.

uint_cast : bool

If True (default False), do a cast to uint16 on the channel data. This can be used to fix a bug with STI101 and STI014 in Neuromag acquisition setups that use channel STI016 (channel 16 turns data into e.g. -32768), similar to mne_fix_stim14 --32 in MNE-C.

mask_type: ‘and’ | ‘not_and’

The type of operation between the mask and the trigger. Choose ‘and’ for MNE-C masking behavior.

delayed_lookup: bool

If True, use the ‘delayed lookup’ procedure implemented in Elekta software. When a trigger transition occurs, the lookup of the new trigger value will not happen immediately at the following sample, but with a 1-sample delay. This allows a slight asynchrony between trigger onsets, when they are intended to be synchronous. If you have accurate hardware and want to detect transitions with a resolution of one sample, use delayed_lookup=False.

Returns:

conds_data : dict or list of dict, each with following keys:

events : array, shape (n_epochs_out, 3)

List of zero time points (t0) for the epochs matching the condition. Use as the events parameter to Epochs. Note that these are not (necessarily) actual events.

event_id : dict

Name of condition and index compatible with events. Should be passed as the event_id parameter to Epochs.

tmin : float

Epoch starting time relative to t0. Use as the tmin parameter to Epochs.

tmax : float

Epoch ending time relative to t0. Use as the tmax parameter to Epochs.