bidsaid.events.PresentationBlockExtractor.extract_mean_reaction_times
- PresentationBlockExtractor.extract_mean_reaction_times(response_map=None, response_type='all', response_trial_names=None)[source]
Extract mean reaction times for each block.
Parameters
- response_map
dict[str, int]orNone, default=None A dictionary mapping response codes, from “Stim Type” column (ie. “hit”, “miss”, “other”, “false alarm”, “incorrect”), to accuracy values (0 for incorrect, 1 for correct). Use
float("NaN")to exclude a response code from the computation. Required whenresponse_typeis “correct” or “incorrect”. When provided withresponse_type="all", responses mapped tofloat("NaN")are excluded from the mean reaction time computation.- response_type
Literal["correct", "incorrect", "all"], default=”all” Whether to compute mean RT for correct, incorrect, or all trials. When “all”,
response_mapis not needed.- response_trial_names
Iterable[str]orNone, default=None The stimulus trial names within each block to include for the reaction_time computation.
Important
If
split_cue_from_blockis True, trial types are excluded from this parameter.
Returns
- list[float]
A list of mean reaction times for each block.
Note
The reaction time is computed for the first response only. Also, if cue is split from the block, NaN will be assigned for its reaction time.
Example
>>> # Mean RT for all trials with a response >>> mean_reaction_times = extractor.extract_mean_reaction_times() >>> # Mean RT for correct trials only >>> response_map = {"hit": 1, "miss": 0} >>> mean_reaction_times = extractor.extract_mean_reaction_times( ... response_map=response_map, ... response_type="correct", ... )
- response_map