CONN scripting: specify the gPPI 1st level contrasts & 2nd level models (in a pre- post- design: 2 sessions x 2 runs)

Hello,

I am new to CONN and want to use scripting for a gPPI analysis on mnemonic discrimination task fMRI data.

-I have 2 groups (training, control) with a pre- post- design (2 sessions x 2 runs each).
-onsets in a .mat file from 9 trial types (‘first’,‘repeats’, lures_correct, lures_incorrect → for objects & scenes separately; & ‘scrambled’ (baseline)

I plan to run seed-based gPPI to check differential connectivity of a seed with other areas, specifically for the training vs control condition in certain contrasts (e.g. lures minus repeats).

I am puzzled however how I can define the 1st level contrasts and the 2nd level:

  1. I think I must define the variables to be used for the 1st levels contrasts at the setup.conditions. Right?

*my code so far to define the 9 trial types onsets via the *set.conditions:
for nsub=1:NSUBJECTS
for nses=1:2
clear onsets
load(EVENTS_FILE{nses,nsub}) %loads onsets+CondNames
batch.Setup.conditions.names=CondNames;

for ncon=1:9 %size(CondNames,2) %9 cons i.e.
for nrun=1:2
batch.Setup.conditions.onsets {ncon}{nsub}{nses+nrun} =onsets{nrun,ncon} %thus nses goes to =4; (1-2=ses1(runs1-2); 3-4=ses2);
batch.Setup.conditions.durations{ncon}{nsub}{nses+nrun} =0; % session-specific conditions
end
end; end; end

But how I define the 1st-level contrasts (e.g. lures - repeats), so I can create 1st level gPPIs (lures-repeats etc.)? Which field I have to use to create a contrast vector for this?

  1. How one can define the 2nd-level contrasts to represent the 2 different sessions with 2 runs each?
    i.e.,how do I point to the different sessions runs for my intended design?

my code here so far:
%create group indicators
group_train=participants.group(participants.complete==1); %is it ==1 training?
group_control=group_train; %copy first.
group_control(group_train==1)=0;
group_control(group_train==0)=1; %code control cond with 1s (to use in the design matrix)

BATCH.Setup.done=1; %(runs the initial data extraction steps)
    %DEFINE
    BATCH.Setup.subjects.names={'group_train','group_control','age'};
    BATCH.Setup.subjects.effects{1}=group_train;
    BATCH.Setup.subjects.effects{2}=group_control;
    BATCH.Setup.subjects.effects{3}=subs_age;
    %between subjects
    BATCH.Results.between_subjects.effect_names={'group_train','group_control','age'} %cell array of second-level effect names
    BATCH.Results.between_subjects.contrast=[1 -1 0]; % % contrast vector (same size as effect_names)
    %betw. conditions (within-subjects i.e.)
    BATCH.Results.between_conditions.effect_names=CondNames; %cell array of condition names (as in Setup.conditions.names)
    BATCH.Results.between_conditions.contrast=[0 -0.5 0.5 0 0 -0.5 0.5 0 0] %lures correct - repeats across object&scenes (9 trial types thus 9 columns)

Any help & your wisdom would be greatly appreciated! :slight_smile:

MANAGED BY INCF