help > Estimation Failed and Warning: Missing conditions!!! Invalid Contrast
Showing 1-3 of 3 posts
Display:
Results per page:
Oct 15, 2018  09:10 AM | Anne Saulin
Estimation Failed and Warning: Missing conditions!!! Invalid Contrast
Dear Donald,

I have just started using gPPI, thank you for the great package!
The sample data ran fine. After adapting the code for my own data I could fix most of the errors but I keep getting the following error:

VOI has 28 voxels in 2.500000e+00x2.500000e+00x2.500000e+00 space

VOI has 28 voxels in 2.500000e+00x2.500000e+00x2.500000e+00 space. This is in the the same space as the input data and functional mask.
VOI has 28 voxels in 2.500000e+00x2.500000e+00x2.500000e+00 space
VOI has 28 voxels in 2.500000e+00x2.500000e+00x2.500000e+00 space. This is in the the same space as the input data and functional mask.
Estimation Failed
Generate Contrast Vectors
Warning: Missing conditions!!! Invalid Contrast
Invalid Contrast
Warning: Missing conditions!!! Invalid Contrast
Invalid Contrast
Generate Contrasts
PPI Contrasts were not estimated for some reason.
ans =
xY: [1x1 struct]
xBF: [1x1 struct]
nscan: [948 977]
Sess: [1x2 struct]
factor: []
xGX: [1x1 struct]
xM: [1x1 struct]
xX: [1x1 struct]
xVi: [1x1 struct]
SPMid: 'SPM12: spm_spm (v6678)'
xsDes: [1x1 struct]
swd: 'D:\MRI\SPM\mm_Int_04\firstLevel_Wue_firstDeriv'
xVol: [1x1 struct]
Vbeta: [1x26 struct]
VResMS: [1x1 struct]
VM: [1x1 struct]
xCon: [1x21 struct]

So the ROIs are fine and I copy-pasted and double-checked the task names from the SPM file. The variable names all match (directories, filenames, subject names). I want to compare across sessions. I don't know whether that poses a problem, but I guess that's exactly what gPPI is made for. Just as a background information.

The parameter code looks like this:

%% Setting the gPPI Parameters

%%% For more details on the parameters below and what they mean, go to the
%%% gPPI website and download the guide: http://www.nitrc.org/projects/gppi
P.subject = subject; % A string with the subjects id
P.directory = first_level_dir; % path to the first level GLM directory
P.VOI = fullfile(spm_dir, subject, analysis, [VOI_name '_mask.nii']); % path to the ROI image, created above
P.Region = VOI_name; % string, basename of output folder
P.Estimate = 1; % Yes, estimate this gPPI model
P.contrast = 0; % contrast to adjust for. Default is zero for no adjustment
P.extract = 'eig'; % method for ROI extraction. Default is eigenvariate
P.Tasks = {'0' 'condE' 'condR' 'invalid trials session 2'...
'condM' 'condC' 'invalid trials session 2' }; % Specify the tasks for this analysis. Think of these as trial types. Zero means "does not have to occur in every session"
P.Weights = []; % Weights for each task. If you want to weight one more than another. Default is not to weight when left blank
P.maskdir = fullfile(subject, gPPI_dir); % Where should we save the masks?
P.equalroi = 1; % When 1, All ROI's must be of equal size. When 0, all ROIs do not have to be of equal size
P.FLmask = 0; % restrict the ROI's by the first level mask. This is useful when ROI is close to the edge of the brain
P.VOI2 = {}; % specifiy a second ROI. Only used for "physiophysiological interaction"
P.analysis = 'psy'; % for "psychophysiological interaction"
P.method = 'cond'; % "cond" for gPPI and "trad" for traditional PPI
P.CompContrasts = 1; % 1 to estimate contrasts
P.Weighted = 0; % Weight tasks by number of trials. Default is 0 for do not weight
P.outdir = fullfile(spm_dir, subject, gPPI_dir); % Output directory
P.ConcatR = 1; % Tells gPPI toolbox to concatenate runs
P.Contrasts(1).left = {'condM'}; % left side or positive side of contrast
P.Contrasts(1).right = {'condR'}; % right side or negative side of contrast
P.Contrasts(1).STAT = 'T'; % T contrast
P.Contrasts(1).Weighted = 0; % Weighting contrasts by trials. Deafult is 0 for do not weight
P.Contrasts(1).MinEvents = 1; % min number of event need to compute this contrast
P.Contrasts(1).name = 'M-R'; % Name of this contrast
P.Contrasts(2).left = {'condE'}; % left side or positive side of contrast
P.Contrasts(2).right = {'condR'}; % right side or negative side of contrast
P.Contrasts(2).STAT = 'T'; % T contrast
P.Contrasts(2).Weighted = 0; % Weighting contrasts by trials
P.Contrasts(2).MinEvents = 1; % min number of event need to compute this contrast
P.Contrasts(2).name = 'E-R'; % Name of this contrast


%% Actually Run PPI
PPPI(P)

Any insights on reasons and/or fixes for this Error are immensely appreciated since I kind of ran out of ideas at this point :(
Best,
Anne
Jan 16, 2019  03:01 PM | Anne Saulin
RE: Estimation Failed and Warning: Missing conditions!!! Invalid Contrast
Dear all,

it works now. I deleted the lines containing XXXXX.Weighted = 0;. I have no clue why that fixed it, though.

Cheers,
Anne
Jan 20, 2019  05:01 AM | Mark Green
RE: Estimation Failed and Warning: Missing conditions!!! Invalid Contrast
Dear Anne,

The following is speculation:

Perhaps there is some mismatch between i) your task specification in P.Name; and ii) your contrast specification P.Contrast(1...) which you have resolved by removing P.Weighted from the localiser and the subsequent contrasts. Since you are not using a localiser (P.Contrast=0), you could try re-running to with only P.Weighted removed (keep P.Weighted=0) for the contrasts P.Contrast(1).Weighted etc. This could support the mismatch in task/contrast specification. I agree that the suspicion that a session issue may be a factor in this mismatch is a possibility.

I don't know whether your fix violates any assumptions of gPPI.

Looking at P.Tasks you seem to specify 'invalid trials session 2' twice. Perhaps this is an issue. Another thing that you could possibly try.
P.Tasks = {'0' 'condE' 'condR' 'invalid trials session 2'...
'condM' 'condC' 'invalid trials session 2' };

If you are not already aware, then the following forum query seems to pertain to a similar issue (invalid task gPPI contrasts).

https://www.nitrc.org/forum/forum.php?th...

Is your study event-related or block in design?

Many thanks,

Mark