Thanks Laurrence for a wonder tutorial, and thanks Vladimir for pointing to it. It works great for the most part. I say that because I am running into two problems: 1. I have version 4010 of spm8 but I don't have "view_spatial_confounds.m". Is there a more recent upgrade that should have this script? 2. For some of the subject data, the 'remove_eyeblink_topography_walkthrough.m' script gives me the following error: ======================================================================= ??? Index exceeds matrix dimensions. Error in ==> spm_eeg_spatial_confounds at 166 sconf.coeff(sel1, :) = U(sel2, 1:S.ncomp); Error in ==> remove_eyeblink_topography_walkthrough at 87 D = spm_eeg_spatial_confounds(S); but for others it doesn't. How could this be? Both subjects data are similar in the way they are acquired. Any help would be much appreciated. Thanks - Muhammad On Wed, Dec 1, 2010 at 9:29 AM, Vladimir Litvak <[log in to unmask]>wrote: > Dear Muhammad and other users interested in the topography-based > artefact correction, > > Laurence Hunt prepared a tutorial for artefact detection and rejection > in SPM and has kindly made it available on > http://www.fmrib.ox.ac.uk/~woolrich/artifact_session.zip . The file > contains example data, code and a tutorial for using them. Enjoy and > thanks again to Laurence. > > Best, > > Vladimir > > > > On Wed, Dec 1, 2010 at 10:42 AM, Vladimir Litvak > <[log in to unmask]> wrote: > > Dear Muhammad, > > > > You can put it before this part. Just note that usually the file you > > would use to define spatial confounds is not the same file that you > > correct. The former would be an averaged eyeblink file and the latter > > your actual dataset of interest. The head model should be in this > > second dataset. > > > > Best, > > > > Vladimir > > > > On Wed, Dec 1, 2010 at 4:21 AM, MP <[log in to unmask]> wrote: > >> Hi Vladimir, > >> Thanks so much for your detailed response. I am now able to generate the > >> script for the 3D head model. My follow up question to you is, where > exactly > >> should I insert it in the eye blink correction routine? > >> Currently the eye blink removal section of the script looks like the > >> following: > >> % Eye Blink Correction > >> S = []; > >> S.D = fullname6; > >> S.method = 'SVD'; > >> S.timewin = [-0.498 > >> 2]; > >> S.ncomp = 2; > >> D = spm_eeg_spatial_confounds(S); > >> save(D); > >> S = []; > >> S.D = fullname6; > >> S.correction = 'Berg'; > >> D = spm_eeg_correct_sensor_data(S); > >> save (D); > >> > >> Where should I insert the 3D Head modelling script? > >> Thanks > >> - Muhammad > >> > >> > >> On Tue, Nov 30, 2010 at 5:54 AM, Vladimir Litvak < > [log in to unmask]> > >> wrote: > >>> > >>> Dear Muhammad, > >>> > >>> Press the 'Batch' button, go to SPM->M/EEG->M/EEG Source > >>> reconstruction->M/EEG head model specification > >>> > >>> Then you need to specify the configuration. The parameters are the > >>> same as in 3D source reconstruction window. Once you specify a > >>> complete configuration that can run (the triangle at the top turns > >>> grin) you can go to File->Save batch as script and save your > >>> configuration as an .m file. You can then modify the code if necessary > >>> and add it to your script. > >>> > >>> Best, > >>> > >>> Vladimir > >>> > >>> > >>> On Mon, Nov 29, 2010 at 6:47 PM, MP <[log in to unmask]> wrote: > >>> > Hi Vladimir, > >>> > Many thanks for your help. Could you please guide how can I > pre-compute > >>> > the > >>> > head model for my dataset using SPM batch tool? I want to do this so > >>> > that I > >>> > can include the eye-blink correction using Berg algorithm in a > script. > >>> > Thanks, > >>> > - Muhammad > >>> > > >>> > On Sat, Nov 13, 2010 at 7:48 AM, Vladimir Litvak > >>> > <[log in to unmask]> > >>> > wrote: > >>> >> > >>> >> Dear Muhammad, > >>> >> > >>> >> On Sat, Nov 13, 2010 at 3:46 AM, MP <[log in to unmask]> wrote: > >>> >> > Hello all, > >>> >> > I am doing eye-blink correction through Berg algorithm. I have a > >>> >> > couple > >>> >> > of > >>> >> > questions in this regard: > >>> >> > 1. Once the data has been run through the Berg algorithm, is the > >>> >> > output > >>> >> > data > >>> >> > corrected for the eye-blinks, or is there anything that needs to > be > >>> >> > done? > >>> >> > >>> >> If you've done everything correctly the data is corrected. If it's > >>> >> continuous data you could average it around eyeblinks again to make > >>> >> sure they are gone. > >>> >> > >>> >> > 2. While running the Berg algorithm, a prompt comes up asking > "Which > >>> >> > Head > >>> >> > Model?" for the MEEG/MRI coregistration. Which script is this > prompt > >>> >> > coming > >>> >> > from? > >>> >> > >>> >> Head model is necessary for the 'Berg' option (but not for SSP) > >>> >> because Berg algorithm uses lead fields of cortical sources. If you > >>> >> want to batch it you can pre-compute the head model for your dataset > >>> >> using the batch tool before correcting it. > >>> >> > >>> >> > 3. How does the Berg algorithm affect the spectral information in > the > >>> >> > data? > >>> >> > Is it OK to do TF-decomposition and then stat analysis on this > data? > >>> >> > >>> >> In principle it is OK, but it depends on the question and the data > so > >>> >> you should still be careful. The principles of this correction are > >>> >> very similar to those of ICA and ICA is very frequently used for > >>> >> removing eye blinks prior to all kinds of analyses so you can use > the > >>> >> ICA literature as a precedent. In any case perhaps you should repeat > >>> >> your analysis with and without eye blink correction and convince > >>> >> yourself that the differences you see can be attributed to eye blink > >>> >> removal. > >>> >> > >>> >> Best, > >>> >> > >>> >> Vladimir > >>> >> > >>> >> > >>> >> > Thanks > >>> >> > - Muhammad > >>> >> > > >>> >> > > >>> >> > On Fri, Nov 12, 2010 at 12:08 PM, Vladimir Litvak > >>> >> > <[log in to unmask]> wrote: > >>> >> >> > >>> >> >> No, this function is used for detecting eyeblinks in continuous > data > >>> >> >> as part of eyeblink correction procedure. See > >>> >> >> > >>> >> >> https://www.jiscmail.ac.uk/cgi-bin/wa.exe?A2=SPM;adf47ab2.1007 > >>> >> >> > >>> >> >> Vladimir > >>> >> >> > >>> >> >> On Fri, Nov 12, 2010 at 5:02 PM, MP <[log in to unmask]> wrote: > >>> >> >> > Hi all, > >>> >> >> > It may be a very naive question, but does > >>> >> >> > 'spm_eeg_detect_eyeblinks' remove > >>> >> >> > the eye-blinks after detecting them? > >>> >> >> > Thanks > >>> >> >> > - Muhammad > >>> >> > > >>> >> > > >>> > > >>> > > >> > >> > > >