help
help > PPI analysis, nothing works :)
Aug 26, 2025 11:08 AM | Ekaterina Pronizius
PPI analysis, nothing works :)
Dear all, could you please tell me what am I doing wrong?
clear all
clc
skipNum = [14,26,29,37,40,41,55,56]; %array
of the participants, which are not existing or problematic
subjects = [10:10];
rois = {'lOFC'}; %one ROI for now; ,
'rTPJ'
% choose correct basepath
basepath = fullfile[BLINDED];
addpath(fullfile(basepath, fullfile('04_PPI',
'PPI', 'PPPIv13')));
subjpath =
fullfile(basepath,fullfile('07_MRI_DATA'));
for r = 1:length(rois)
clear roi; roi = char(rois(r));
for i = 1:length(subjects)
A = subjects(i);
if ~ismember(A, skipNum) %if NOT a
member
P = [];
id = "MP_0" + subjects(i);
clear P
P.subject = char(id);
% directory of first level spm.mat file
% create a copy just in case
firstlevel_dir = fullfile(subjpath,
P.subject, 'first_level');
ppi_firstlevel_dir = fullfile(subjpath,
P.subject, 'first_level_PPI');
% copy everything ONLY if the PPI copy does
not exist yet
if ~isfolder(ppi_firstlevel_dir)
mkdir(ppi_firstlevel_dir); % create empty
folder
fprintf('Created empty first_level_PPI for
%s\n', P.subject);
else
fprintf('Using existing first_level_PPI for
%s\n', P.subject);
end
P.directory = firstlevel_dir;
P.outdir = ppi_firstlevel_dir; %output
directory if you want to store the PPI analysis in a different
location than the first-level SPM.mat file.
cd(P.directory);
% --- PPPI PARAMETERS ---
% path to VOI (roi.nii) + roiname
P.VOI = fullfile(basepath,'04_PPI','ROIs',
[roi,'.nii']);
P.Region = roi; % roi name without
'.nii'
% F-contrast to remove noise from the data
before deconvolution
% (will be created)
% preprocessing
P.contrast = 'Omnibus F-test for PPI
Analyses';
P.analysis = 'psy'; %stands for
psychophysiological interaction
P.extract = 'eig'; % method of roi
extraction: default = eigenvariate
% Specifies traditional SPM PPI ('trad') or
generalized condition-specific PPI ('cond')
P.method = 'cond';
P.equalroi = 0; % specifies that ROIs must be
same size in all subjects, 0 allows roi to be trimmed by first
level mask
P.FLmask = 1; % 0 - no mask (no such image),
default. 1 = specifies that the ROI should be restricted using the
mask.img from the first-level statistics.
% Tasks = name of regressors (= the name you
put in first-level
% specification. you only need to specify the
conditions that you are interested
% in for your PPI analysis. These conditions
should match the names of
% the regressors (or conditions) that you
used in your first-level analysis.
% regressors / tasks /
P.Tasks = {'1' 'IMM' 'MOR' 'NEU'}; %1 = tasks
in all (this case 2) sessions.
% specify contrasts
P.CompContrasts = 1;
P.Contrasts(1).left = {'IMM'};
P.Contrasts(1).right = {'MOR'};
P.Contrasts(1).STAT = 'T';
P.Contrasts(1).name = 'IMM > MOR';
P.Contrasts(2).left = {'MOR'};
P.Contrasts(2).right = {'IMM'};
P.Contrasts(2).STAT = 'T';
P.Contrasts(2).name = 'IMM < MOR';
% if 'cond' as method:
P.Weights = []; % would have to be entered if
traditional SPM PPI (n*3 matrix; n = number of conditions)
P.SPMver = 12;
% --- RUN PPPI ---
try
fprintf('Running full estimation for %s\n',
P.subject);
P.Estimate = 1;
PPPI(P);
catch ME
warning('Full estimation failed for %s: %s',
P.subject, ME.message);
% continue anyway
end
end
end
end
My problem:
The analysis runs but gives me an error
My problem:
The analysis runs but gives me an error
Created empty first_level_PPI for MP_010
Running full estimation for MP_010
Log File: MP_010_PPPI_8_26_2025.log
PPPI Version: 13.1.4-17-2014
Parameters used:
Processing subject: MP_010
VOI file
:
X:\userdata\ekaterinap85\data\Publikation\Moral_Pletti\Pletti_code\04_PPI\ROIs\lOFC.nii
Output file will be:
MP_010_lOFC_session#_cond_PPI_regressors.txt
Valid Contrast
Warning: Missing conditions!!! Invalid Contrast
Invalid Contrast
Warning: Missing conditions!!! Invalid Contrast
Invalid Contrast
Valid Contrast
Warning: Missing conditions!!! Invalid Contrast
Invalid Contrast
Warning: Missing conditions!!! Invalid Contrast
Invalid Contrast
Valid Contrast
Warning: Missing conditions!!! Invalid Contrast
Invalid Contrast
Warning: Missing conditions!!! Invalid Contrast
Invalid Contrast
Valid Contrast
Warning: Missing conditions!!! Invalid Contrast
Invalid Contrast
Warning: Missing conditions!!! Invalid Contrast
Invalid Contrast
Valid Contrast
Warning: Missing conditions!!! Invalid Contrast
Invalid Contrast
Warning: Missing conditions!!! Invalid Contrast
Invalid Contrast
Valid Contrast
Warning: Missing conditions!!! Invalid Contrast
Invalid Contrast
Warning: Missing conditions!!! Invalid Contrast
Invalid Contrast
ESS image 7
: ...written
ess_0007.nii
spm{F} image 7
: ...written
spmF_0007.nii
Saving SPM.mat
:
...SPM.mat saved
Contrast
: Omnibus F-test for PPI Analyses
Analysis
: Psychophysiological Interactions
Extraction :
eigenvariate
Tasks
: _1_IMM_MOR_NEU
Method
: Condition Specific
No output is saved in the PPI folder
No contrasts
The results of the omnibus tests is just a whole-blob activation. I really dont know what to do. I want to investigate connectivity from the seed region lOPC for the contrast IMM>MOR and IMM<MOR
Any help is appreciated
Ekaterina
No output is saved in the PPI folder
No contrasts
The results of the omnibus tests is just a whole-blob activation. I really dont know what to do. I want to investigate connectivity from the seed region lOPC for the contrast IMM>MOR and IMM<MOR
Any help is appreciated
Ekaterina