Contents

Following the previous single-trial modeling, I will introduce Finite Impulse Response (FIR) model using a different basis function. While the single-trial model uses canonical HRF, FIR model uses 'finite impulse response' as a basis set. Let's get started!! - Byeol 🤩

You can download the materials for this module at here.

Extract from D, condition per run

% onsets
onsets_view = get_var(D, 'eventonsettime', 'conditional', {'eventname', 'view'});
onsets_emotion_select = get_var(D, 'eventonsettime', 'conditional', {'eventname', 'emotion_selection'});
onsets_concentration = get_var(D, 'eventonsettime', 'conditional', {'eventname', 'concentration'});

% names
names_view = get_var(D, 'eventname', 'conditional', {'eventname', 'view'});
names_emotion_select = get_var(D, 'eventname', 'conditional', {'eventname', 'emotion_selection'});
names_concentration = get_var(D, 'eventname', 'conditional', {'eventname', 'concentration'});

% durations
durations_view = get_var(D, 'eventduration', 'conditional', {'eventname', 'view'});
durations_emotion_select = get_var(D, 'eventduration', 'conditional', {'eventname', 'emotion_selection'});
durations_concentration = get_var(D, 'eventduration', 'conditional', {'eventname', 'concentration'});

Making onset_*, names_*, and durations_* variables is the same as the single-trial modeling.

conditions_per_run = [1 1 1 1]; % view

The first difference with the single-trial modeling is conditions_per_run. Here, we have only one condition for view task per run.

Onsets, Durations, Names

% run loop
for run_i = 1:4
    
    onsets_temp{1} = onsets_view(sub_j, view_run_idx==run_i)';
    onsets = [onsets;onsets_temp];
    
    duration_temp{1} = zeros(size(onsets_temp{1}));
    durations = [durations;duration_temp];
    
    names = [names;{'view'}];
    
    clear *_temp;
end

We also need to set onsets, durations, names using onset_*, names_*, durations_*. Their structure for FIR model is different from that of single-trial model. For the single-trial model, onsets, durations, and names are 164 x 1 cells. In constrast, they are 4 x 1 cells for FIR. The contents of onsets are the same as that of the single-trial model. However, because we don't need the duration, we replace the values of durations with zeros.