bidsaid.events.EPrimeBlockExtractor.extract_response_counts

EPrimeBlockExtractor.extract_response_counts(reaction_time_column_name, correct_response_column=None, valid_correct_responses=None, response_trial_names=None)[source]

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

Parameters

reaction_time_column_namestr

The name of the column containing reaction time values.

correct_response_columnstr or None, default=None

The name of the column containing the correct response. Required if valid_correct_responses is provided.

valid_correct_responsesIterable[str | int | float] or None, default=None

Specific values in the correct_response_column to include in the count. If provided, the script will only count responses for trials where the correct response matches one of these values (e.g., counting only responses on valid Go trials). If None, all trials are evaluated.

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.