Nipype - handling missing events

During the last run for one of my participants, PsychoPy opened a window for some reason I don’t remember. The end result is I lost a few events at the end of this run. This means one of those events, ‘ProsSameObj’ is not present in this run at all. The means the validity checks in pyscript_estimatecontrast.m throw an exception. I edited the code to remove the checks, and predictably, SPM fails when calculating the contrasts.

Is there a way to exclude just this part of my data? I hate to lose a whole participant because of this; my other 14 participants’ data are fine.


the simplest solution may be to remove the last run and generate an info object for just the remaining runs for that participant. if the run needs to be kept it becomes more complicated. one could use the concatenate runs option if using SPM, but that’s only recommended if the run cannot be removed for other reasons.

1 Like


I removed sub-04_task-ao_run-04_bold.json, sub-04_task-ao_run-04_bold.nii, sub-04_task-ao_run-04_events.tsv). Although I get errors about files not matching the template for run-04, things seem to be processing anyway.