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 | di
(
self,
raw,
condition=None,
stim_channel=None,
mask=None,
uint_cast=None,
mask_type="and",
delayed_lookup=True,
)
| 1460 | return {k: v for k, v in self._events.items() if v["in_use"]} |
| 1461 | |
| 1462 | def get_condition( |
| 1463 | self, |
| 1464 | raw, |
| 1465 | condition=None, |
| 1466 | stim_channel=None, |
| 1467 | mask=None, |
| 1468 | uint_cast=None, |
| 1469 | mask_type="and", |
| 1470 | delayed_lookup=True, |
| 1471 | ): |
| 1472 | """Get averaging parameters for a condition (averaging category). |
| 1473 | |
| 1474 | Output is designed to be used with the Epochs class to extract the |
| 1475 | corresponding epochs. |
| 1476 | |
| 1477 | Parameters |
| 1478 | ---------- |
| 1479 | raw : Raw object |
| 1480 | An instance of Raw. |
| 1481 | condition : None | str | dict | list of dict |
| 1482 | Condition or a list of conditions. Conditions can be strings |
| 1483 | (DACQ comment field, e.g. 'Auditory left') or category dicts |
| 1484 | (e.g. acqp['Auditory left'], where acqp is an instance of |
| 1485 | AcqParserFIF). If None, get all conditions marked active in |
| 1486 | DACQ. |
| 1487 | stim_channel : None | str | list of str |
| 1488 | Name of the stim channel or all the stim channels |
| 1489 | affected by the trigger. If None, the config variables |
| 1490 | 'MNE_STIM_CHANNEL', 'MNE_STIM_CHANNEL_1', 'MNE_STIM_CHANNEL_2', |
| 1491 | etc. are read. If these are not found, it will fall back to |
| 1492 | 'STI101' or 'STI 014' if present, then fall back to the first |
| 1493 | channel of type 'stim', if present. |
| 1494 | mask : int | None |
| 1495 | The value of the digital mask to apply to the stim channel values. |
| 1496 | If None (default), no masking is performed. |
| 1497 | uint_cast : bool |
| 1498 | If True (default False), do a cast to ``uint16`` on the channel |
| 1499 | data. This can be used to fix a bug with STI101 and STI014 in |
| 1500 | Neuromag acquisition setups that use channel STI016 (channel 16 |
| 1501 | turns data into e.g. -32768), similar to ``mne_fix_stim14 --32`` |
| 1502 | in MNE-C. |
| 1503 | mask_type : 'and' | 'not_and' |
| 1504 | The type of operation between the mask and the trigger. |
| 1505 | Choose 'and' for MNE-C masking behavior. |
| 1506 | delayed_lookup : bool |
| 1507 | If True, use the 'delayed lookup' procedure implemented in Elekta |
| 1508 | software. When a trigger transition occurs, the lookup of |
| 1509 | the new trigger value will not happen immediately at the following |
| 1510 | sample, but with a 1-sample delay. This allows a slight |
| 1511 | asynchrony between trigger onsets, when they are intended to be |
| 1512 | synchronous. If you have accurate hardware and want to detect |
| 1513 | transitions with a resolution of one sample, use |
| 1514 | delayed_lookup=False. |
| 1515 | |
| 1516 | Returns |
| 1517 | ------- |
| 1518 | conds_data : dict or list of dict |
| 1519 | Each dict has the following keys: |