help > SBC-gPPI 2nd-level: condition-difference contrast crashes ("Empty implicit analysis mask") while single-condition/sum contrasts work fine
Jul 17, 2026  12:07 PM | Nina Loew
SBC-gPPI 2nd-level: condition-difference contrast crashes ("Empty implicit analysis mask") while single-condition/sum contrasts work fine

Software versions



  • CONN 25.b

  • MATLAB R2024a

  • SPM12 (+ AAL3, Anatomy, ArtRepair, DAiSS, DEM, FieldMap, MEEGtools, bspmview, cat12, marsbar, physio, wfupickatlas)


1st-level analysis



  • Type: SBC-gPPI, Seed-to-Voxel

  • 2 seeds: bilateral amygdala (atlas.Amygdala r / atlas.Amygdala l, from the bundled atlas.nii)

  • 2 task conditions: "Neutral" and "Gewalt" (2 blocks/conditions in an event-related task design)

  • Analysis options: type=2, measure=3 (bivariate regression coefficients), modulation=2 (gPPI model output: main+interaction coefficients, task-dependent total-connectivity)

  • 1st-level analysis completes successfully for 38 of 39 subjects (1 subject intentionally excluded at 1st-level due to unrelated data-quality issue; no BETA_Subject*.nii files exist for that subject, as expected/intended).


What works at 2nd-level (via conn_batch, Results.between_sources/between_conditions/between_subjects)



  • Single condition alone, e.g. between_conditions.effect_names = {'Neutral'}, contrast = 1 — completes normally, SPM.mat/con/spmT written.

  • Two conditions combined with a non-zero-sum contrast, e.g. effect_names = {'Neutral','Gewalt'}, contrast = [1 1] — completes normally.

  • This is independent of which between-subjects effect is used (tested with {'AllSubjects'}, and separately with a single continuous 2nd-level covariate containing 1 NaN value for the excluded subject — both work fine for single-condition/non-zero-sum tests).


What fails



  • Two conditions combined with a zero-sum ("difference") contrast, e.g. effect_names = {'Neutral','Gewalt'}, contrast = [-1 1] or contrast = [1 -1] (both signs tested, both fail identically) — crashes every time, regardless of the between-subjects effect used (tested with {'AllSubjects'} alone and with a single covariate alone), regardless of seed (both amygdala seeds tested), regardless of exact between-subjects contrast weight.


Exact error




 



Error using assert
Empty implicit analysis mask (data from one subject may have all NaN values, or all
subjects may have zero or constant values)

Error in conn_process (line 5432)
assert(isfield(SPM.xX_multivariate,'F'),'Empty implicit analysis mask (data from one
subject may have all NaN values, or all subjects may have zero or constant values)');

Error in conn_process (line 99)
case 'results_voxel', [varargout{1:nargout}]=conn_process(16,varargin{:});

Error in conn_batch (line 1958)
conn_process('results_voxel','dosingle','seed-to-voxel');



Minimal reproduction (conn_batch)




 


matlab


clear batch
batch.filename = '<project>.mat';
batch.Results.analysis_number = 'gPPI_01';
batch.Results.between_subjects.effect_names = {'AllSubjects'};
batch.Results.between_subjects.contrast = 1;
batch.Results.between_conditions.effect_names = {'Neutral','Gewalt'};
batch.Results.between_conditions.contrast = [-1 1]; % or [1 -1] -- same crash
batch.Results.between_sources.effect_names = {'atlas.Amygdala r'};
batch.Results.between_sources.contrast = 1;
conn_batch(batch);



What we've already ruled out



  • Not related to the excluded subject: we confirmed via direct inspection of CONN_x.Setup.l2covariates that the excluded subject is correctly dropped from the between-subjects design (nsubjects in conn_process.m correctly excludes it via the NaN check at line ~4995) before this step is reached. We also reproduced the crash using a between-subjects effect that has no NaN at all (AllSubjects), so subject exclusion is not a factor here.

  • Not related to sign: [-1 1] and [1 -1] fail identically.

  • Not related to seed: both atlas.Amygdala r and atlas.Amygdala l fail identically.

  • Not related to the between-subjects covariate choice: fails with AllSubjects alone and with a single continuous covariate alone.

  • Only the combination of (a) two conditions and (b) contrast weights summing to zero triggers it. [1 1] (sum) on the same two conditions works fine; [-1 1]/[1 -1] (difference) does not.


Question Is this a known limitation/edge case of the gPPI "main+interaction coefficients" (measure=3, modulation=2) 1st-level output when used with a zero-sum between-conditions contrast at 2nd-level? Is there a recommended workaround — e.g., computing the condition difference directly from the subject-level BETA_Subject_Condition_Source*.nii files (outside conn_process) and feeding that into a one-sample design, rather than using CONN's built-in between-conditions contrast mechanism?