Print

Print


Dear Experts,

I am new to gPPI and I had a couple of questions. Using some of the examples in the manual, I wrote the  script below to go through a series of subject creating a sphere and running gPPI.

My questions are:

- I am using FLmask = 1 and equalroi = 0 because I was getting the error of VOI exceeding in some subjects. Is this correct?

- Also, I am putting in TaskSpecfy all the regressors I used in my first level analysis but only using the regressors of interest from that list in the contrast left and right. Is this also correct? And is it correct to use a 0 in this case? 

- Finally, I put in contrasts MinEvents a 2 because I was not sure what this MinEvent referred to, and I couldn't find anything online to help me answer this question. Does this refer to the number of events in each regressor or the number of regressors? or something else like the number of events in the whole experiment? If its the number of events in each regressors, some of my regressors have different number of events, so do I just take into consideration the ones in the contrast of interest or overall? And is it a mistake to use 2 as the MinEvent, does it change the results if I increase it?  

Thank you so much for your time and I am sorry for all the questions. 

Have a nice day,

Ben



Script:

subs =[1:27];
VOI= 'VOI_vmPFC_-3_66_12_r6_mask.nii';
VOIName='VOI_vmPFC_-3_66_12_r6';
Coord=[-3 66 12];
SphereRadious = 6;
Basename= 'vmPFC_gPPI_Fr_Zone';
TaskSpecify = {'0' 'ErApp1S','ErApp1D','ErApp2S','ErApp2D','ErFrS','ErFrD','LtApp1S','LtApp1D','LtApp2S','LtApp2D','LtFrS','LtFrD','ObjPlcEr','ObjPlcLt','ObjPck','SaShock','CSpShock','CSmShock'};

ContName1 = 'SvsD';
left1 ={'ErFrS' 'LtFrS'};
right1={'ErFrD' 'LtFrD'};

ContName2 = 'DvsS';
left2={'ErFrD' 'LtFrD'};
right2={'ErFrS' 'LtFrS'};


directories.rdir = 'directory of first level analysis for all subjects'; 


for sub = subs; 
 
    directories.sdir = sprintf('S%02d',sub); % subject directory
    
    % Create VOI
    
    cd(fullfile(directories.rdir,directories.sdir));
    create_sphere_image(fullfile(directories.rdir,directories.sdir,'SPM.mat'),Coord,{VOIName},SphereRadious)
    
    
    % Set-up gPPI
   
    P.subject=directories.sdir;
    P.directory=fullfile(directories.rdir,directories.sdir);
    P.VOI=fullfile(directories.rdir,directories.sdir,VOI);
    P.Region= Basename;
    P.Estimate=1;
    P.contrast=0;
    P.extract='eig';
    P.Tasks= TaskSpecify;
    P.Weights=[];
    P.analysis='psy';
    P.method='cond';
    P.CompContrasts=1;
    P.Weighted=0;
    P.equalroi=0;
    P.FLmask=1;
    
    
    % Contrasts
    P.Contrasts(1).name=ContName1;
    P.Contrasts(1).left= left1;
    P.Contrasts(1).right= right1;
    P.Contrasts(1).STAT='T';
    P.Contrasts(1).Weighted=0;    
    P.Contrasts(1).MinEvents=2;
    


    P.Contrasts(2).name=ContName2;
    P.Contrasts(2).left= left2;
    P.Contrasts(2).right= right2;
    P.Contrasts(2).STAT='T';
    P.Contrasts(2).Weighted=0;
    P.Contrasts(2).MinEvents=2;
    

    %Run gPPI
    PPPI(P,fullfile(directories.rdir,directories.sdir,'gPPI_vmPFCx(FrZone).mat'));
    
end