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:
The unit of time is second, why does the time of negative value appear in the result file?
2.ImagingKernel*F=ImageGridAmp ?
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?
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.
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.
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.
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.
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.
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.