bidsaid.events.PresentationBlockExtractor.extract_response_counts

PresentationBlockExtractor.extract_response_counts(response_map=None, response_trial_names=None)[source]

Extract the number of trials with a response for each block.

Parameters

response_mapdict[str, int] or None, default=None

A dictionary mapping response codes, from “Stim Type” column, to values. If provided, responses mapped to float("NaN") (or responses not in the map) are excluded from the count. This ensures the count accurately reflects the valid trials used in reaction time and accuracy computations.

response_trial_namesIterable[str] or None, default=None

The stimulus trial names within each block to include.

Important

If split_cue_from_block is True, trial types are excluded from this parameter.

Returns

list[int]

A list of response counts for each block. If cue row is separated, NaN will be assigned for its count.