Quantitative analysis of source estimation matlab results file

Dear experts,

I would like to do a quantitative analysis of the result file of source estimation and post-processing with Matlab, but I have some questions.

In SourceEstimation, the results are stored in a linear inverse kernel:
ImagingKernel: [Nsources Nchannels x] Linear inverse operator that must be multiplied by the recordings in order to get the full source time series.
ImageGridAmp: [Nsources x Ntime] Full source time series, in amper.meter.
Time: [1 x Ntime] Time values for each sample recorded in F, in seconds

In the tutorial "average response", F in the calculated result file is:
F: [Nchannels x Ntime] average recordings across all the trials, in Volts.

My questions are:

  1. The unit of time is second, why does the time of negative value appear in the result file?

2.ImagingKernel*F=ImageGridAmp ?

  1. I don't want to consider the time series, but only analyze the size and location of brain activity sources. How should I calculate?

Is it correct to perform the following operation on the result variable in matlab?

Recordings = F/Time

Source = ImagingKernel * recordings

Looking forward to your reply :wink:

Hi Anhuiyi,

To answer your questions.

  1. The source localization is done on the same time basis as your epoch. If you epoch contains a pre-event part, e.g. starting 200 milliseconds before, the time-axis is negative there and zero is aligned with the event usually.

  2. Indeed, eventually you want a Nsources X Ntime matrix, which you can make by multiplying a Nsources * Nchannels by a Nchannels * Ntime matrix. The Imaging kernel is a transformation that operates on your channel time series and transforms it to source time series.

I would not advice this, it is highly likely that Matlab doesn't take this since you are dividing a matrix by a vector, which gets you in all kinds of dimensionality problems. And doesn't take the dimension of time away.

What you could do is get the full time series of the sources and then average over the time axis with Source = mean(ImagingKernel*F,2), which would give you the average response of a source over time.

Kind regards,
Steven

1 Like

Dear Steven,

Thank you for your reply~It helped me a lot,but I still have a little question:

Could I use the ImageGridAmp directly with Source=mean(ImageGridAmp,2)?

Best wishes,
AnHuiyi

Dear An Huiyi,

Yes, that should give you the same value, I indeed wrote it out a bit too extensive.
I don't know if the mean value of the sources is a good measure though, I'm not that deep in that topic, I can imagine that the maximum value could also show something, though that is something that can maybe be better answered by someone else.

Kind regards,
Steven

1 Like

Dear Steven,

Thank you very much for your reply that my questions have been sovled perfectly.

I want to analyze the locations of eeg sources obtained by different eeg traceability algorithms, and the mean value of sources is enough for me.If I want to analyze the source at a certain point in time, I'm just going to extract the source at that point in time.

Best wishes,
AnHuiyi

1 Like

Indeed, eventually you want a Nsources X Ntime matrix, which you can make by multiplying a Nsources * Nchannels by a Nchannels * Ntime matrix. The Imaging kernel is a transformation that operates on your channel time series and transforms it to source time series.

If what you want is this full matrix [Nsources x Ntime], you can obtain it directly by selecting the advanced option "Full results" when estimating the sources:
https://neuroimage.usc.edu/brainstorm/Tutorials/SourceEstimation#Advanced_options:_Minimum_norm_.5BTODO.5D

Alternatively, use one the Brainstorm functions to read your file instead of loading the files in Matlab manually, they can do this multiplication for you:
https://neuroimage.usc.edu/brainstorm/Tutorials/Scripting#Reference:_File_manipulation

Could I use the ImageGridAmp directly with Source=mean(ImageGridAmp,2)?

I'd recommend you do this averaging from the Brainstorm interface as well, to avoid any manipulation error. Use the process "Average > Average time", it will let you select easily the time window of interest (do not average the entire epoch including the pre-stim baseline, you would lose most of your effects)

I can imagine that the maximum value could also show something

Avoid using the maximum, this is usually a very noisy statistic. In most cases, it is preferable to average a short time window around the latency of interest.

1 Like