Dear Martin,
This is just standard SVD or PCA described in any standard stats
textbook (http://en.wikipedia.org/wiki/Principal_component_analysis).
Best,
Vladimir
On Thu, Apr 28, 2011 at 11:20 AM, Martin Dietz <[log in to unmask]> wrote:
> Hi Vladimir & John,
>
> I have been following your discussion on how to extract a source time-series. I believe SPM uses singular value decomposition to compute the 1st eigenvariate of the VOI. Could you kindly point me to a description in the literature or the piece of code that performs the computation.
>
> Very best wishes,
> Martin
>
>
>
> On Apr 27, 2011, at 10:59 PM, Vladimir Litvak wrote:
>
>
>
> On 27 Apr 2011, at 21:40, "Sexton, John A." <[log in to unmask]<mailto:[log in to unmask]>> wrote:
>
> Hi Vladimir,
>
> Thank you for the quick response! I was not aware of the latest SPM updates.
> I have now installed them and tried the extract feature but got an error (see below).
>
> Just to make sure I understand: the output of that extract function will be a time series of eeg data from the vertex nearest the coordinate I specified?
>
> Only if you specify VOI radius of zero. See below.
>
>
> I am actually using the multi-modal face data for practice, so the EEG data I am using do in fact have the fMRI priors applied to them already. I've gone all the way through the source localization process as far as I can tell and am using the "N170+fMRI" inversion for my tests right now.
>
> I have looked at the meeg methods and the Reference section of the EEG part of the SPM manual. I have also looked at section 14.11, the data structure appendix. This tells a little bit about D.inv{val}.mesh, datareg, inverse, etc. but it is the fields within those that I would really like to understand. I can't seem to find a clear guide to those anywhere (though I have been trying to piece it together from the individual spm_eeg_inv_*.m files).
>
> This message seemed relevant to what i was trying to do, but I didn't understand the instruction to "extract corresponding temporal mode values in D.inv{val}.inverse.J{c} and post-multiply by those temporal modes themselves in D.inv{val}.inverse T (transposed)"
>
> <https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=SPM;a5e4241.1001>https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=SPM;a5e4241.1001
>
> Is that similar to what the extract function is doing?
>
>
> Basically yes, but the extract function also summarises the time series of all the vertices within some distance of your chosen location (VOI radius) as the first eigenvariate (similarly to what fMRI 'eigenvariate' button does). This is the right way to do it because the vertex that picks up most of the activity of interest might not be the closest one as orientation is more important than location.
>
>
> I appreciate your help and I do feel like I am inching in the right direction.
>
>
> I can't say what's wrong from the error message. You sound like you can try to figure it out yourself. If not, send me an example of your data and what parameters you specified and I'll look at it. If you find the bug, also let me know.
>
> Best,
>
> Vladimir
>
> Thank you!
> John
>
>
>
> About the Extract Error
>
> When I enter some coordinates in the ms or mm box - say [5, -48, 21] and choose "extract",
> I am able to enter a Source label, VOI radius, and File name.
>
> However, at that point I get the following error:
>
> ??? Index exceeds matrix dimensions.
>
> Error in ==> spm_eeg_inv_extract at 122
> MY(:, MYi:(MYi+Np-1)) =
> J{i}(js,:)*T';
>
> Error in ==> spm_eeg_inv_extract_ui at 52
> [Ds, D] = spm_eeg_inv_extract(D);
>
> Error in ==>
> spm_eeg_inv_imag_api>CheckInverse_Callback
> at 421
> handles.D =
> spm_eeg_inv_extract_ui(handles.D,
> handles.D.val, PST);
>
> Error in ==> spm_eeg_inv_imag_api at 53
> feval(varargin{:}); % FEVAL
> switchyard
>
> ??? Error while evaluating uicontrol Callback
>
>
>
>
> ________________________________________
> From: Vladimir Litvak [[log in to unmask]<mailto:[log in to unmask]>]
> Sent: Wednesday, April 27, 2011 2:24 PM
> To: Sexton, John A.
> Cc: <mailto:[log in to unmask]> [log in to unmask]<mailto:[log in to unmask]>
> Subject: Re: [SPM] Need help getting EEG timecourse associated with coordinates defined by fMRI
>
> Dear John,
>
> You are almost there. If you install the latest set of SPM8 updates,
> you'll find the 'extract' checkbox that will enable you to save the
> source time series as SPM dataset when you press the MIP button. A
> more convenient way to access this functionality is via SPM batch or
> scripts. If you want closer correspondence with fMRI you might want to
> use fMRI priors as described in the multimodal faces tutorial.
>
> @meeg methods are described quite in detail in the reference chapter
> in the manual. You can also type methods('meeg') in the command line
> to get a full list of methods and then type help meeg/<method name> to
> get help for each method. However, in this case it's not the object
> itself that you need but the inversion results that are stored in
> D.inv which is a struct. The fields are briefly described at the end
> of 3D source reconstruction chapter.
>
> In general if you want to save something that you can plot in SPM you
> can find the code that does the plotting and use it as an example.
>
> Best,
>
> Vladimir
>
> On Wed, Apr 27, 2011 at 6:38 PM, John Sexton <[log in to unmask]<mailto:[log in to unmask]>> wrote:
>> Hello everyone,
>>
>> I am new to EEG analysis with SPM. I have followed the tutorials in the manual carefully and have managed to get reasonably far on my own, but I am stuck when it comes to digging inside the D meeg object for specific pieces of information.
>>
>> I have fMRI data and EEG data (collected separately) of subjects viewing faces. So far, I have performed the standard SPM analysis on fMRI data. I have identified the clusters of interest and the corresponding coordinates of the centroids of those clusters in MNI space.
>>
>> Now this is what I want to do:
>>
>> 1. Find the point in the EEG data (vertex or sensor) which most closely corresponds to the centroids of the fMRI activation
>>
>> 2. Extract the time courses for the those points in the EEG data
>>
>> So far I have entered the coordinates of the fMRI centroids into the "ms or mm" box below the MIP button on the 3D Source Localization window on SPM, then hit the MIP button. This appeared to provide EEG coordinates that were very close to the fMRI coordinates and gave the time (in ms) of peak activity at that coordinate.
>>
>> For example, if I enter [-39, -46, -23] (obtained from fMRI), the EEG MIP returns [-39, -45, -22] with peak at 195ms.
>>
>> But now that I have that coordinate (which I assume is the vertex in the EEG data closest to the coordinates I entered), I do not know how to extract the time course of EEG activity associated with it.
>>
>> This seems like it ought to be easy enough (and there are surely better ways than what I have tried so far), but don't know how to be sure I am getting the correct information.
>>
>>
>> I would greatly appreciate some help on this.
>>
>> Also, if there any straightforward guide out there to the information contained in the D meeg object, I would love to read it.
>>
>> Thank you!
>>
>> John
>>
>
> ________________________________
>
> This e-mail message (including any attachments) is for the sole use of
> the intended recipient(s) and may contain confidential and privileged
> information. If the reader of this message is not the intended
> recipient, you are hereby notified that any dissemination, distribution
> or copying of this message (including any attachments) is strictly
> prohibited.
>
> If you have received this message in error, please contact
> the sender by reply e-mail message and destroy all copies of the
> original message (including attachments).
>
>
|