snake.core.handlers.activations.bold
#
BOLD Signal utilities.
Module Contents#
Functions#
Create a simple block design paradigm. |
|
Convolve the HRF with the event condition to generate the BOLD signal. |
|
Get the event time series, sampled at tr_ms. |
API#
- snake.core.handlers.activations.bold.block_design(block_on: float, block_off: float, duration: float, offset: float = 0, event_name: str = 'block_on') pandas.DataFrame [source]#
Create a simple block design paradigm.
- Parameters:
block_on (float) β in seconds, the amount of time the stimuli is on
block_off (float) β in seconds, the amount of time the stimuli is off (rest) after the on state.
duration (float) β in seconds, the total amount of the experiments.
offset (float) β in seconds, the starting point of the experiment, default=0.
event_name (str) β name of the block event, default=βblock_onβ
- Returns:
the data frame corresponding to a block design.
- Return type:
pd.DataFrame
Notes
The design is as follows
|---------| |----------| |------> |--------| |----------| |-------| offset block_on block_off block_on ...
And repeats until duration is reached.
- snake.core.handlers.activations.bold.get_bold(tr_ms: float, max_time: float, event_condition: pandas.DataFrame, hrf_model: str, oversampling: int, min_onset: float, bold_strength: float) numpy.ndarray [source]#
Convolve the HRF with the event condition to generate the BOLD signal.
- Parameters:
frame_times β array-like of shape (n_times,) The timing of the acquisition
event_condition β array-like of shape (3, n_events) yields description of events for this condition as a (onsets, durations, amplitudes) triplet
hrf_model β Choice for the HRF, FIR is not
oversampling β Oversampling factor to perform the convolution. Default=50.
min_onset β Minimal onset relative to frame_times[0] (in seconds) events that start before frame_times[0] + min_onset are not considered. Default=-24.
duration β Duration of the event in seconds.
offset β Offset of the event in seconds.
bold_strength β Strength of the BOLD signal.
- Returns:
The convolved HRF with the event condition.
- Return type:
np.ndarray