Spike realignment within source localization

Hi all,

For my epilepsy sleep project, we performed single spike source localization using cMEM. The spikes are classified within the sleep stages. Now we also want to take the average spike source localization for each sleep stage. However, as the annotation of the epileptic discharges are not always occuring at zero, the spikes are not aligned perfectly.

I also wrote a Matlab code annotated the actual spikes (instead of the zero point) and I have these delays in a table.

Now the question is: is there a way to align the data after the source localization? Or do I have to first align everything and then solve the forward problem again etc. Because it would save a lot of time is there is a way to align after the forward problem is solve.

Also, an interesting thing that we observed is the fact the there is a shift in the spike peak and a reduction of the amplitude when we took a different baseline for the cMEM computation (first results were with a N2 baseline, second with a wake baseline).

Thanks!
Lysette

Please check the process Pre-process > Add time offset that has been updated today (14-Oct-2025) to work with source files. Commit: 2f89bc0

This process now automatically update the sources files that related to the data file that is being process. Just remove the time occurrence of the spike to have the files with the spike occurrence at 0 s.

image

Note: Unlike full sources files (e.g., cMEM sources files), "Link" files do not need to be updated. Since they take their time vector on the fly from the data file.


Once all your files have as 0 s the time of the spike, it is possible to obtain the same time window around the spike with the process Extract > Extract time

Thank you so much, I will try this!