Dealing with missing trials per run in nilearn.FirstLevelModel

I just started switching some of my fmri glm analyses from FSL to nilearn.glm - So far, I’m really happy with it!

Right now, I’m trying to run a simple two stage GLM contrasting two trial_types. However, our experiment has several runs per subject and one of the trial_types does not occur in all of the runs. Hence, not all our design matrices (generated with make_first_level_design_matrix) have the same number of regressors and computing a contrast with the FirstLevelModel.compute_contrast() method fails.

As far as I know, FSL has a method to use “Null EVs” for such scenarios. Is there anything comparable in nilearn?

Cheers and many thanks

You can specific your contrasts in a symbolic form, as “A-B”, where ‘A’ and 'B 'are the event-type (condition) names, instead of a sequence of 0’s and 1’s. Does the use of this solve your issue ?