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
infomne.Info

The mne.Info object with information about the sensors and methods of measurement. This is 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
categorieslist

Return list of averaging categories ordered by DACQ index.

eventslist

Return events ordered by DACQ index.

rejectdict

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).

flatdict

Flatness rejection criteria from DACQ that can be used with mne.Epochs.

acq_dictdict

All DACQ parameters.

Methods

__getitem__(item)

Return an averaging category, or list of categories.

__hash__(/)

Return hash(self).

__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
itemstr | list of str

Name of the category (comment field in DACQ).

Returns
condsdict | list of dict

Each dict should have the following keys:

comment: str

The comment field in DACQ.

statebool

Whether the category was marked enabled in DACQ.

indexint

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

eventint

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

startfloat

Start time of epoch relative to the reference event.

endfloat

End time of epoch relative to the reference event.

reqeventint

Index of the required (conditional) event.

reqwhenint

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

reqwithinfloat

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

displaybool

Whether the category was displayed online in DACQ.

naveint

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

subaveint

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.

__len__()[source]

Return number of averaging categories marked active in DACQ.

Returns
n_catint

The number of categories.

property categories

Return list of averaging categories ordered by DACQ index.

Only returns categories marked active in DACQ.

property 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
rawRaw object

An instance of Raw.

conditionNone | 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_channelNone | str | list of str

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.

maskint | None

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

uint_castbool

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_lookupbool

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_datadict or list of dict

Each dict has the following keys:

eventsarray, 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_iddict

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

tminfloat

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

tmaxfloat

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