From wibral at BIC.UNI-FRANKFURT.DE Fri Aug 1 10:00:01 2008 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Fri, 1 Aug 2008 10:00:01 +0200 Subject: Logical problem with CTF 3rd order gra diometers correction Message-ID: Dear Robert, thank you very much for your answer. What I tried to do is invoke reject artefact after denoise_synthetic so that it works on the already denoised data (which is of course useless as it reads the data anew as I see now) . The aim of this procedure was to keep more trials. Is there any way to achieve this? The only thing I can think of right now is to run 3rd grads in the CTF software, save these data, then read them in with the new functions (Fieldtrip should know then that data are already in 3rd grad, shouldn't it?) and proceed as usual (i.e. run rejectartefact + preprocessing). Best Regards, Michael > -----Ursprüngliche Nachricht----- > Von: "Robert Oostenveld" > Gesendet: 31.07.08 23:01:00 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] Logical problem with CTF 3rd order gradiometers correction > Hi Michael > > On 31 Jul 2008, at 18:11, Michael Wibral wrote: > > Dear listusers, > > I have a logical problem with denoise-synthetic. > > > > here's what I want to do: > > > > 1. use definetrial to make cfg.trl (works fine) > > 2. use preprocessing with the new cfg. headerfile='ctf_new' , > > cfg.datafile='ctf_new' options to read the reference gradiometer > > information and the data into a fieldtrip structure (works fine) > > 3. use denoise_synthetic to denoise the data (works fine ?) > > In the (sofar limited) experiences that I heard there are noticeable > differences mainly on the central/vertex sensors (which are also the > closest to the reference sensors). > > > 4. un artefact detection on these data (-> this works fine and > > updates cfg.trl) > > after artifact_xxx and rejectartifact you should read the data using > preprocessing. Or are you using rejectvisual? If so, then you don't > have to call preprocessing a second time, because the output of > rejectvisual is again your data with the bad trials removed. > > > 5. run preprocessing a second time for filtering and actually > > applying the results of artefact corrcetion,... i.e. those things > > that I didn't want to do before denoise_synthetic. > > After rejectartifact, you should be calling it here like preprocessing > (cfg), and not with a second input argument. > > If you call it like preprocessing(cfg, data), then the cfg should not > contain cfg.dataset and cfg.trl but only filtering options, because > the data should not be read from file. > > > BUT preprocessing complains that cfg shouldn't contain the cfg.trl > > field when no data are read - which is the case because I am > > invoking preprocessing a second time here on an existing fieldtrip > > structure. > > I suspect that you are mixing up rejectartifact and preprocessing. > Calling preprocessing with a 2nd data input argument is only meant to > apply another set of filters on that data (i.e. if you forgot to do > it in the first run, or if you sequentially want to bandstopfilter > some line noise or CRT artifacts). > > > Therefore all information from artefact rejection is lost. > > > > Somehow it seems that I can run denoise_synthetic only after > > artefact rejection, because I need a fieldtrip dataset to run it, > > but NO dataset for preprocessing to perform artefact correction, > > i.e. accept cfg.trl. This would be a pity. > > I must say that I had not considered sofar the interaction between > denoising and artifact detectoin and removal. The artfifact_xxx > functions perform detection on data from disk(*), i.e. prior to > reading the data into memory. The historical reason for (*) is to > save on memory when a lot of filter padding is used and when there is > a lot of overlap between padded trials. The padded regions should be > checked for artifacts (esp jump artifacts which cause a lot of filter > rinning), but in the end we don't need them in memory. The denoising > only happens after the data is read into memory. > > > Any suggestion how to solve this? > > For the moment I suggest to use the following sequence > > definetrial > preprocessing > denoise_synthetic > rejectvisual > > and not use artifact_xxx combined with rejectartifact. We are > revising the automatic artifact detection functions at the moment, > since computers nowadays have much more RAM than when we started > implementing it 5 years ago, and reading the padded data into memory > is now much less of a concern. So in the near future, it will be > possible to do autodetection of artifacts also on data that is in > memory, which means that then you could also do the autodetection > after denoise_synthetic. > > best regards > Robert > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 443 bytes Desc: not available URL: From michael.wibral at WEB.DE Fri Aug 1 11:18:05 2008 From: michael.wibral at WEB.DE (Michael Wibral) Date: Fri, 1 Aug 2008 11:18:05 +0200 Subject: Logical problem with CTF 3rd order gra diometers correction Message-ID: Dear Robert, thank you very much for your answer. What I tried to do is invoke reject artefact after denoise_synthetic so that it works on the already denoised data (which is of course useless as it reads the data anew as I see now) . The aim of this procedure was to keep more trials. Is there any way to achieve this? The only thing I can think of right now is to run 3rd grads in the CTF software, save these data, then read them in with the new functions (Fieldtrip should know then that data are already in 3rd grad, shouldn't it?) and proceed as usual (i.e. run rejectartefact + preprocessing). Best Regards, Michael > -----Ursprüngliche Nachricht----- > Von: "Robert Oostenveld" > Gesendet: 31.07.08 23:01:00 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] Logical problem with CTF 3rd order gradiometers correction > Hi Michael > > On 31 Jul 2008, at 18:11, Michael Wibral wrote: > > Dear listusers, > > I have a logical problem with denoise-synthetic. > > > > here's what I want to do: > > > > 1. use definetrial to make cfg.trl (works fine) > > 2. use preprocessing with the new cfg. headerfile='ctf_new' , > > cfg.datafile='ctf_new' options to read the reference gradiometer > > information and the data into a fieldtrip structure (works fine) > > 3. use denoise_synthetic to denoise the data (works fine ?) > > In the (sofar limited) experiences that I heard there are noticeable > differences mainly on the central/vertex sensors (which are also the > closest to the reference sensors). > > > 4. un artefact detection on these data (-> this works fine and > > updates cfg.trl) > > after artifact_xxx and rejectartifact you should read the data using > preprocessing. Or are you using rejectvisual? If so, then you don't > have to call preprocessing a second time, because the output of > rejectvisual is again your data with the bad trials removed. > > > 5. run preprocessing a second time for filtering and actually > > applying the results of artefact corrcetion,... i.e. those things > > that I didn't want to do before denoise_synthetic. > > After rejectartifact, you should be calling it here like preprocessing > (cfg), and not with a second input argument. > > If you call it like preprocessing(cfg, data), then the cfg should not > contain cfg.dataset and cfg.trl but only filtering options, because > the data should not be read from file. > > > BUT preprocessing complains that cfg shouldn't contain the cfg.trl > > field when no data are read - which is the case because I am > > invoking preprocessing a second time here on an existing fieldtrip > > structure. > > I suspect that you are mixing up rejectartifact and preprocessing. > Calling preprocessing with a 2nd data input argument is only meant to > apply another set of filters on that data (i.e. if you forgot to do > it in the first run, or if you sequentially want to bandstopfilter > some line noise or CRT artifacts). > > > Therefore all information from artefact rejection is lost. > > > > Somehow it seems that I can run denoise_synthetic only after > > artefact rejection, because I need a fieldtrip dataset to run it, > > but NO dataset for preprocessing to perform artefact correction, > > i.e. accept cfg.trl. This would be a pity. > > I must say that I had not considered sofar the interaction between > denoising and artifact detectoin and removal. The artfifact_xxx > functions perform detection on data from disk(*), i.e. prior to > reading the data into memory. The historical reason for (*) is to > save on memory when a lot of filter padding is used and when there is > a lot of overlap between padded trials. The padded regions should be > checked for artifacts (esp jump artifacts which cause a lot of filter > rinning), but in the end we don't need them in memory. The denoising > only happens after the data is read into memory. > > > Any suggestion how to solve this? > > For the moment I suggest to use the following sequence > > definetrial > preprocessing > denoise_synthetic > rejectvisual > > and not use artifact_xxx combined with rejectartifact. We are > revising the automatic artifact detection functions at the moment, > since computers nowadays have much more RAM than when we started > implementing it 5 years ago, and reading the padded data into memory > is now much less of a concern. So in the near future, it will be > possible to do autodetection of artifacts also on data that is in > memory, which means that then you could also do the autodetection > after denoise_synthetic. > > best regards > Robert > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 443 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 443 bytes Desc: not available URL: From michelic72 at GMAIL.COM Sat Aug 2 17:26:06 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Sat, 2 Aug 2008 17:26:06 +0200 Subject: Logical problem with CTF 3rd order gradiometers correction Message-ID: About point 2 and 3 of Michael's email Is it unimportant if I apply denoise_synthetic before or after preprocessing? I thought denoise_synthetic applies a non linear transformation of the data so that any filtering preprocessing should be done immediately after this. If this is the case i propose the following schema: 1) 'read-in' preprocessing: simply reads the dataset in a structure without doing anything 2) denoise_synthetic 3) filtering In code: 1) cfg = []; cfg.dataset = 'Mydata.ds'; cfg.datatype = 'continuous'; cfg.channel = 'all'; cfg.trl = 'Mytrialfunction'; cfg.headerformat = 'ctf_new'; cfg.dataformat = 'ctf_new'; meg = preprocessing(cfg); 2) cfg = []; cfg.gradient = 'G3BR'; cfg.trials = 'all'; meg_d = denoise_synthetic(cfg, meg); 3) cfg = []; cfg.channel = 'MEG'; cfg.hpfilter = 'yes'; cfg.hpfreq = 1; meg_df = preprocessing(cfg, megd); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Sat Aug 2 17:42:03 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Sat, 2 Aug 2008 17:42:03 +0200 Subject: Logical problem with CTF 3rd order gradiometers correction Message-ID: I tested the routine denoise_synthetic on some dataset and compared with the downloaded denoise CTF routines for matlab. Taking care not to apply any filtering or baseline correction in the data reading/preprocessing, it works fine. Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From nathan.dees at UMSL.EDU Tue Aug 5 02:45:58 2008 From: nathan.dees at UMSL.EDU (Nathan Dees) Date: Tue, 5 Aug 2008 02:45:58 +0200 Subject: DICS Localization Problem Message-ID: Dear Fieldtrippers, Have been struggling a long time to produce a viable image of beamforming analysis. We are using a 4D-Magnes3600 Magnetometer MEG unit to record a prompted finger tapping motor task with variable ISI of 2.5 - 3.0 seconds. Our time-frequency plots show evident beta and alpha desynchronization at movement onset. We are using the beamforming tutorial as a guide. After calculating dataPre and dataPost, and verifying our mri has been properly segmented by SPM, our code is: cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 2; cfg.foilim = [18 20]; cfg.pad = 0.5; freqPre = freqanalysis(cfg,dataPre); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 2; cfg.foilim = [18 20];segmentedmriF.transform = mri.transform; segmentedmriF.anatomy = mri.anatomy; cfg.pad = 0.5; freqPost = freqanalysis(cfg,dataPost); segmentedmri.transform = mri.transform; segmentedmri.anatomy = mri.anatomy; [vol, cfg] = prepare_singleshell([], segmentedmri); cfg = []; cfg.grad = freqPre.grad; cfg.vol = vol; cfg.reducerank = 2; cfg.channel = {'MEG'}; cfg.xgrid = -30:1:30; % 'AUTO' does not work! cfg.ygrid = -30:1:30; % 'AUTO' does not work! cfg.zgrid = -40:1:40; % 'AUTO' does not work! [grid] = prepare_leadfield(cfg); cfg = []; cfg.frequency = 20; cfg.method = 'dics'; cfg.projectnoise = 'yes'; cfg.grid = grid; cfg.vol = vol; cfg.lambda = 0; sourcePre = sourceanalysis(cfg,freqPre ); sourcePost = sourceanalysis(cfg,freqPost); %Plot of deep sources in the center of the brain looks reasonable. sourceDiff = sourcePost; sourceDiff.avg.pow = (sourcePre.avg.pow - sourcePost.avg.pow) ./ sourcePost.avg.pow; cfg = []; cfg.downsample = 2; sourceDiffInt = sourceinterpolate(cfg, sourceDiff , mri); cfg = []; cfg.method = 'slice'; cfg.funparameter = 'avg.pow'; cfg.maskparameter = cfg.funparameter; cfg.funcolorlim = [0.0 .2]; cfg.opacitylim = [0.0 .2]; cfg.opacitymap = 'rampup'; figure sourceplot(cfg,sourceDiffInt); We expect localization of desynchronization to be in the motor cortex, predominantly on the left side. The result we get is diffusely localized, and with weak signal. I have images to possibly help diagnose the problem, but for now, can anyone spot the errors? Thank you!! ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From nathanweisz at MAC.COM Tue Aug 5 07:34:34 2008 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Tue, 5 Aug 2008 07:34:34 +0200 Subject: DICS Localization Problem In-Reply-To: Message-ID: dear nathan, we see nice mu desynchronizations nicely localized to motor cortex when subjects prepare responding to a target using a 4-D 2500 WH (the one with 148 sensors). Have you already done localizations with your MEG system using a segmented brain? If not, then I suggest to check if you get the same results using a more 'standard' headmodel, e.g. multisphere (like in the tutorial). this assures you always are in the MEG-coordinate system, and have no weird mixture between coordinate systems. you need a headshape for that (pretty standard with 4D; i can provide you with one if you don't have one). also you might want to check if your volume / grid makes sense relative to the sensor position using 'headmodelplot'. good luck, yet-another-nathan On 05.08.2008, at 02:45, Nathan Dees wrote: > Dear Fieldtrippers, > > Have been struggling a long time to produce a viable image of > beamforming > analysis. We are using a 4D-Magnes3600 Magnetometer MEG unit to > record a > prompted finger tapping motor task with variable ISI of 2.5 - 3.0 > seconds. > Our time-frequency plots show evident beta and alpha > desynchronization at movement onset. We are using the beamforming > tutorial > as a guide. After calculating dataPre and dataPost, and verifying > our mri > has been properly segmented by SPM, our code is: > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'powandcsd'; > cfg.tapsmofrq = 2; > cfg.foilim = [18 20]; > cfg.pad = 0.5; > freqPre = freqanalysis(cfg,dataPre); > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'powandcsd'; > cfg.tapsmofrq = 2; > cfg.foilim = [18 20];segmentedmriF.transform = mri.transform; > segmentedmriF.anatomy = mri.anatomy; > cfg.pad = 0.5; > freqPost = freqanalysis(cfg,dataPost); > > segmentedmri.transform = mri.transform; > segmentedmri.anatomy = mri.anatomy; > [vol, cfg] = prepare_singleshell([], segmentedmri); > > cfg = []; > cfg.grad = freqPre.grad; > cfg.vol = vol; > cfg.reducerank = 2; > cfg.channel = {'MEG'}; > cfg.xgrid = -30:1:30; % 'AUTO' does not work! > cfg.ygrid = -30:1:30; % 'AUTO' does not work! > cfg.zgrid = -40:1:40; % 'AUTO' does not work! > [grid] = prepare_leadfield(cfg); > > cfg = []; > cfg.frequency = 20; > cfg.method = 'dics'; > cfg.projectnoise = 'yes'; > cfg.grid = grid; > cfg.vol = vol; > cfg.lambda = 0; > > sourcePre = sourceanalysis(cfg,freqPre ); > sourcePost = sourceanalysis(cfg,freqPost); > > %Plot of deep sources in the center of the brain looks reasonable. > > sourceDiff = sourcePost; > sourceDiff.avg.pow = (sourcePre.avg.pow - sourcePost.avg.pow) ./ > sourcePost.avg.pow; > cfg = []; > cfg.downsample = 2; > sourceDiffInt = sourceinterpolate(cfg, sourceDiff , mri); > > cfg = []; > cfg.method = 'slice'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > cfg.funcolorlim = [0.0 .2]; > cfg.opacitylim = [0.0 .2]; > cfg.opacitymap = 'rampup'; > figure > sourceplot(cfg,sourceDiffInt); > > We expect localization of desynchronization to be in the motor cortex, > predominantly on the left side. The result we get is diffusely > localized, > and with weak signal. I have images to possibly help diagnose the > problem, > but for now, can anyone spot the errors? > > Thank you!! > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/fcdonders/fieldtrip. -------------------------------------------- Attention: New Contact Details -------------------------------------------- Dr. Nathan Weisz OBOB-Lab University of Konstanz Department of Psychology P.O. Box D23 78457 Konstanz Germany Tel: ++49 - (0)7531 - 88 45 84 Email: nathan.weisz at uni-konstanz.de Homepage: coming soon Bob-wisdom: It's better to do one job well than two jobs... not so well. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.litvak at ION.UCL.AC.UK Tue Aug 5 10:10:10 2008 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Tue, 5 Aug 2008 09:10:10 +0100 Subject: DICS Localization Problem In-Reply-To: <9A794572-9406-497C-ADCE-22C7C1389F3C@mac.com> Message-ID: Dear Nathans, I think Nathan2 is in the right direction. I don't see anything in Nathan1's code that performs coregistration of the head model and the sensors, Robert and people at the Donders use CTF software to prepare their MRIs. In that software they specify the three fiducials and then the MRI is saved with transform from voxels to CTF head coordinates, the same coordinate system that the sensors are in. Thus when one uses MRI preprocessed with CTF software there is no need to coregrister. But this is not true in general, but rather an exception. Nathan1 uses MRI preprocessed with SPM. This MRI is most probably in MNI or some native coordinates in mm. The sensors are in head coordinates in cm (although I'm not sure about your particular system). The latest versions of FT, of the last month or so complain if there is a mismatch in units but they don't complain if your sensors are rotated 90 degrees for instance. So indeed you should become very well familiar with headmodelplot. Also look at volumerealign, electroderealign and interactiverealign. In general coregistration is quite tricky business, which is not very well reflected at the FT website because at the Donders they do it in one particular way, which makes it not so tricky for them. In SPM8 which will be released in October and is integrated with FT there will be a semi- automatic tool for coregistration that works with the 3 common MEG systems. But until then you have to figure it out. It's useful in the long run if you don't want to do things blindly. Best, Vladimir On Tue, Aug 5, 2008 at 6:34 AM, Nathan Weisz wrote: > dear nathan, > we see nice mu desynchronizations nicely localized to motor cortex when > subjects prepare responding to a target using a 4-D 2500 WH (the one with > 148 sensors). > Have you already done localizations with your MEG system using a segmented > brain? If not, then I suggest to check if you get the same results using a > more 'standard' headmodel, e.g. multisphere (like in the tutorial). this > assures you always are in the MEG-coordinate system, and have no weird > mixture between coordinate systems. you need a headshape for that (pretty > standard with 4D; i can provide you with one if you don't have one). also > you might want to check if your volume / grid makes sense relative to the > sensor position using 'headmodelplot'. > good luck, > yet-another-nathan > On 05.08.2008, at 02:45, Nathan Dees wrote: > > Dear Fieldtrippers, > > Have been struggling a long time to produce a viable image of beamforming > analysis. We are using a 4D-Magnes3600 Magnetometer MEG unit to record a > prompted finger tapping motor task with variable ISI of 2.5 - 3.0 seconds. > Our time-frequency plots show evident beta and alpha > desynchronization at movement onset. We are using the beamforming tutorial > as a guide. After calculating dataPre and dataPost, and verifying our mri > has been properly segmented by SPM, our code is: > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'powandcsd'; > cfg.tapsmofrq = 2; > cfg.foilim = [18 20]; > cfg.pad = 0.5; > freqPre = freqanalysis(cfg,dataPre); > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'powandcsd'; > cfg.tapsmofrq = 2; > cfg.foilim = [18 20];segmentedmriF.transform = mri.transform; > segmentedmriF.anatomy = mri.anatomy; > cfg.pad = 0.5; > freqPost = freqanalysis(cfg,dataPost); > > segmentedmri.transform = mri.transform; > segmentedmri.anatomy = mri.anatomy; > [vol, cfg] = prepare_singleshell([], segmentedmri); > > cfg = []; > cfg.grad = freqPre.grad; > cfg.vol = vol; > cfg.reducerank = 2; > cfg.channel = {'MEG'}; > cfg.xgrid = -30:1:30; % 'AUTO' does not work! > cfg.ygrid = -30:1:30; % 'AUTO' does not work! > cfg.zgrid = -40:1:40; % 'AUTO' does not work! > [grid] = prepare_leadfield(cfg); > > cfg = []; > cfg.frequency = 20; > cfg.method = 'dics'; > cfg.projectnoise = 'yes'; > cfg.grid = grid; > cfg.vol = vol; > cfg.lambda = 0; > > sourcePre = sourceanalysis(cfg,freqPre ); > sourcePost = sourceanalysis(cfg,freqPost); > > %Plot of deep sources in the center of the brain looks reasonable. > > sourceDiff = sourcePost; > sourceDiff.avg.pow = (sourcePre.avg.pow - sourcePost.avg.pow) ./ > sourcePost.avg.pow; > cfg = []; > cfg.downsample = 2; > sourceDiffInt = sourceinterpolate(cfg, sourceDiff , mri); > > cfg = []; > cfg.method = 'slice'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > cfg.funcolorlim = [0.0 .2]; > cfg.opacitylim = [0.0 .2]; > cfg.opacitymap = 'rampup'; > figure > sourceplot(cfg,sourceDiffInt); > > We expect localization of desynchronization to be in the motor cortex, > predominantly on the left side. The result we get is diffusely localized, > and with weak signal. I have images to possibly help diagnose the problem, > but for now, can anyone spot the errors? > > Thank you!! > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > > -------------------------------------------- > Attention: New Contact Details > -------------------------------------------- > Dr. Nathan Weisz > OBOB-Lab > University of Konstanz > Department of Psychology > P.O. Box D23 > 78457 Konstanz > Germany > Tel: ++49 - (0)7531 - 88 45 84 > Email: nathan.weisz at uni-konstanz.de > Homepage: coming soon > Bob-wisdom: It's better to do one job well than two jobs... not so well. > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and > EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Tue Aug 5 10:44:49 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Tue, 5 Aug 2008 10:44:49 +0200 Subject: DICS Localization Problem Message-ID: > Dear Nathan and Nathan, > > I'd like to add that I recently discovered some inconsistencies > with respect to the units in which gradiometer positions/dipole > positions etc. are expressed. > We are in the process of looking into this and making it > consistent. For now you should ensure yourself that the gradiometer > positions and grid locations and the mri-transformation matrix have > the same units (which is meters in our 4D-system). Moreover, the > singleshell method somewhere has a hard-coded assumption that the > units are centimeters (which is the default units for CTF systems) > so the solution might not be entirely correct if you use meters. > > Yours, > Jan-Mathijs > > On Aug 5, 2008, at 7:34 AM, Nathan Weisz wrote: > >> dear nathan, >> >> we see nice mu desynchronizations nicely localized to motor cortex >> when subjects prepare responding to a target using a 4-D 2500 WH >> (the one with 148 sensors). >> Have you already done localizations with your MEG system using a >> segmented brain? If not, then I suggest to check if you get the >> same results using a more 'standard' headmodel, e.g. multisphere >> (like in the tutorial). this assures you always are in the MEG- >> coordinate system, and have no weird mixture between coordinate >> systems. you need a headshape for that (pretty standard with 4D; i >> can provide you with one if you don't have one). also you might >> want to check if your volume / grid makes sense relative to the >> sensor position using 'headmodelplot'. >> >> good luck, >> yet-another-nathan >> >> On 05.08.2008, at 02:45, Nathan Dees wrote: >> >>> Dear Fieldtrippers, >>> >>> Have been struggling a long time to produce a viable image of >>> beamforming >>> analysis. We are using a 4D-Magnes3600 Magnetometer MEG unit to >>> record a >>> prompted finger tapping motor task with variable ISI of 2.5 - 3.0 >>> seconds. >>> Our time-frequency plots show evident beta and alpha >>> desynchronization at movement onset. We are using the >>> beamforming tutorial >>> as a guide. After calculating dataPre and dataPost, and >>> verifying our mri >>> has been properly segmented by SPM, our code is: >>> >>> cfg = []; >>> cfg.method = 'mtmfft'; >>> cfg.output = 'powandcsd'; >>> cfg.tapsmofrq = 2; >>> cfg.foilim = [18 20]; >>> cfg.pad = 0.5; >>> freqPre = freqanalysis(cfg,dataPre); >>> >>> cfg = []; >>> cfg.method = 'mtmfft'; >>> cfg.output = 'powandcsd'; >>> cfg.tapsmofrq = 2; >>> cfg.foilim = [18 20];segmentedmriF.transform = mri.transform; >>> segmentedmriF.anatomy = mri.anatomy; >>> cfg.pad = 0.5; >>> freqPost = freqanalysis(cfg,dataPost); >>> >>> segmentedmri.transform = mri.transform; >>> segmentedmri.anatomy = mri.anatomy; >>> [vol, cfg] = prepare_singleshell([], segmentedmri); >>> >>> cfg = []; >>> cfg.grad = freqPre.grad; >>> cfg.vol = vol; >>> cfg.reducerank = 2; >>> cfg.channel = {'MEG'}; >>> cfg.xgrid = -30:1:30; % 'AUTO' does not work! >>> cfg.ygrid = -30:1:30; % 'AUTO' does not work! >>> cfg.zgrid = -40:1:40; % 'AUTO' does not work! >>> [grid] = prepare_leadfield(cfg); >>> >>> cfg = []; >>> cfg.frequency = 20; >>> cfg.method = 'dics'; >>> cfg.projectnoise = 'yes'; >>> cfg.grid = grid; >>> cfg.vol = vol; >>> cfg.lambda = 0; >>> >>> sourcePre = sourceanalysis(cfg,freqPre ); >>> sourcePost = sourceanalysis(cfg,freqPost); >>> >>> %Plot of deep sources in the center of the brain looks reasonable. >>> >>> sourceDiff = sourcePost; >>> sourceDiff.avg.pow = (sourcePre.avg.pow - sourcePost.avg.pow) ./ >>> sourcePost.avg.pow; >>> cfg = []; >>> cfg.downsample = 2; >>> sourceDiffInt = sourceinterpolate(cfg, sourceDiff , mri); >>> >>> cfg = []; >>> cfg.method = 'slice'; >>> cfg.funparameter = 'avg.pow'; >>> cfg.maskparameter = cfg.funparameter; >>> cfg.funcolorlim = [0.0 .2]; >>> cfg.opacitylim = [0.0 .2]; >>> cfg.opacitymap = 'rampup'; >>> figure >>> sourceplot(cfg,sourceDiffInt); >>> >>> We expect localization of desynchronization to be in the motor >>> cortex, >>> predominantly on the left side. The result we get is diffusely >>> localized, >>> and with weak signal. I have images to possibly help diagnose >>> the problem, >>> but for now, can anyone spot the errors? >>> >>> Thank you!! >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between >>> users of the FieldTrip toolbox, to share experiences and to >>> discuss new ideas for MEG and EEG analysis. See also http:// >>> listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/ >>> fcdonders/fieldtrip. >> >> -------------------------------------------- >> Attention: New Contact Details >> -------------------------------------------- >> Dr. Nathan Weisz >> >> OBOB-Lab >> University of Konstanz >> Department of Psychology >> P.O. Box D23 >> 78457 Konstanz >> Germany >> >> Tel: ++49 - (0)7531 - 88 45 84 >> Email: nathan.weisz at uni-konstanz.de >> Homepage: coming soon >> >> Bob-wisdom: It's better to do one job well than two jobs... not so >> well. >> >> ---------------------------------- >> >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. >> >> http://listserv.surfnet.nl/archives/fieldtrip.html >> >> http://www.ru.nl/fcdonders/fieldtrip/ >> > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From michelic72 at GMAIL.COM Fri Aug 8 14:05:20 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Fri, 8 Aug 2008 14:05:20 +0200 Subject: Beamformer of correlated sources Message-ID: Dear all I have some questions about the use of DICS in the case of two correlated cortical activations. I am using an isometric contraction protocol and i localized the reference dipole through cortico-muscular coherence with external myography and (classic) DICS method. Now I have to calculate cortico-cortical activations and i use: cfg = []; cfg.grid = grid; cfg.method = 'dics'; cfg.projectnoise = 'yes'; cfg.lambda = 0; cfg.refdip = ref_dipole_position; cfg.frequency = 20; cfg.hdmfile = 'mymodel.hdm'; sourcecond = sourceanalysis(cfg, freq); According to Schoffelen et al. in order to disentangle the sources a modification of the classic DICS algorithm is necessary. Am i supposed to extract the two activations if they are correlated with the above written lines? If not, how would it be a FT implementation to get to correlated sources localization with DICS? I tried with simulation and apparently the above implemetation is able to localize only one source with a spread activation. Attachments show: '1sourceDICS.png' : simulation with an external reference channel correlated with a source in the left emisphere '2sourcesCCCDICS.png': simulation with reference dipole (same as above) whose activity is correlated to a simmetric one in the right emisphere Best Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: 1sourceDICS.png Type: image/png Size: 175531 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 2sourcesCCCDICS.png Type: image/png Size: 180189 bytes Desc: not available URL: From j.schoffelen at PSY.GLA.AC.UK Fri Aug 8 14:30:38 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Fri, 8 Aug 2008 14:30:38 +0200 Subject: Beamformer of correlated sources In-Reply-To: Message-ID: Dear Cristiano, Nice simulation in figure 1! The way you did the second simulation is just the 'traditional' DICS, giving you a huge mountain of coherence around the reference location. This will drown any other true cortico-cortical coherence to the right hemisphere dipole. (Note that a double dipole approach will not be of too much help here, if you do a ccc-analysis with respect to your reference: this is an important point in the paper you refer to. The double dipole approach will hopefully be able to unveil low coherence of the second dipole to the reference, which is masked by the high power + high coherence (one of these, or perhaps both) in the reference dipole.) As such, the double dipole approach is not yet implemented in a straightforward way in the release-version of fieldtrip, but I will be happy to give you some handles: I would suggest to include the leadfield of the reference location in the grid with precomputed leadfields which will be passed in the configuration to sourceanalysis. You have to concatenate the dipole-location specific leadfields with the reference dipole's leadfield. This will give you leadfields of dimensionality Nx6 (or Nx2 if you have a reason to assume a fixed orientation). Subsequently you can run sourceanalysis with cfg.keepfilter = 'yes' and without cfg.refdip, to extract the filter coefficients. These will have the dimensionality 6xN for each double dipole, the first 3 rows corresponding to the location specific location, and the last 3 rows corresponding to the reference dipole. To then compute your 'dipole pair and reference channel'-based cross- spectral density you have to sandwich the sensor-level cross-spectral density (take care to have the channel-order identical to the channel order in the filters) between the augmented filters. You can augment the filters to accommodate for the reference channel in the following way: [filter zeros(size(filter,1),1);zeros(1,size (filter,2)) 1]; (make sure to put the reference channel last in the channel csd. From each sandwiched csd (7x7) you should be able to extract anything you want. The top-left 6x6 block will contain the between dipole csd (diagonal 3x3 blocks contain the within dipole parameters from which power can be estimated: the off-diagonal blocks contain the between dipole csd). The bottom right value will contain the reference signal power, and the 6x1 and 1x6 remaining vectors contain the reference to dipole csds, in two groups of 3. The coherence can be estimated (according to Joachim's 2001 PNAS-paper) in this case by: svd( csd(1:3,7))./ sqrt(svd(csd(1:3,1:3)) *csd(7,7)); Good luck, Jan-Mathijs On Aug 8, 2008, at 2:05 PM, Cristiano Micheli wrote: > Dear all > I have some questions about the use of DICS in the case of two > correlated > cortical activations. > I am using an isometric contraction protocol and i localized the > reference > dipole through cortico-muscular coherence with external myography and > (classic) DICS method. Now I have to calculate cortico-cortical > activations > and i use: > > cfg = []; > cfg.grid = grid; > cfg.method = 'dics'; > cfg.projectnoise = 'yes'; > cfg.lambda = 0; > cfg.refdip = ref_dipole_position; > cfg.frequency = 20; > cfg.hdmfile = 'mymodel.hdm'; > sourcecond = sourceanalysis(cfg, freq); > > According to Schoffelen et al. in order to disentangle the sources a > modification of the classic DICS algorithm is necessary. > Am i supposed to extract the two activations if they are correlated > with the > above written lines? > If not, how would it be a FT implementation to get to correlated > sources > localization with DICS? > I tried with simulation and apparently the above implemetation is > able to > localize only one source with a spread activation. > Attachments show: > '1sourceDICS.png' : simulation with an external reference channel > correlated > with a source in the left emisphere > '2sourcesCCCDICS.png': simulation with reference dipole (same as > above) > whose activity is correlated to a simmetric one in the right emisphere > > Best > Cristiano > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/ > fieldtrip.<1sourceDICS.png><2sourcesCCCDICS.png> ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From venug001 at BAMA.UA.EDU Fri Aug 8 23:01:50 2008 From: venug001 at BAMA.UA.EDU (Gopakumar Venugopalan) Date: Fri, 8 Aug 2008 16:01:50 -0500 Subject: BIOMAG 2008 Message-ID: Hello are there folks here on their way to Biomag 2008 (Sapporo)? If so would you please email me. Thanks in advance. regards gopa ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From tony.w.wilson at GMAIL.COM Sat Aug 9 05:43:17 2008 From: tony.w.wilson at GMAIL.COM (Tony W. Wilson) Date: Fri, 8 Aug 2008 23:43:17 -0400 Subject: BIOMAG 2008 In-Reply-To: <1218229310.489cb43eecc84@bamamail.ua.edu> Message-ID: yeah, I am going to biomag On Fri, Aug 8, 2008 at 5:01 PM, Gopakumar Venugopalan wrote: > Hello are there folks here on their way to Biomag 2008 (Sapporo)? If so > would you please email me. Thanks in advance. > regards > gopa > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > -- _______________________________________________ Tony W. Wilson, Ph.D. Assistant Professor of Neurology Wake Forest University School of Medicine One Medical Center Blvd. Winston-Salem, NC 27157 (336) 716-5151 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From michelic72 at GMAIL.COM Sun Aug 10 17:29:18 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Sun, 10 Aug 2008 17:29:18 +0200 Subject: Beamformer of correlated sources Message-ID: Dear Jan-Mathijs I tried to implement the double dipole DICS but without success. I use a simulation with two correlated sources but I see only one in the power and two spread sources not where i expect them to be in the coherence. I performed the following step as suggested by you in the last email: 1) Calculation of cross spectral matrixes Cf (channel-channel), Cr (channel reference) and Power of the reference Pr for a specific frequency. 2) Concatenation of the local leadfield with one of the dipoles' leadfield for each point of the grid: lf = compute_leadfield(dip.pos(i,:), grad, vol, 'reducerank', reducerank, 'normalize', normalize); lf2 = compute_leadfield([0 5 10], grad, vol, 'reducerank', reducerank, 'normalize', normalize); lf = [lf lf2]; 3) Calculation of local spatial filter according to: filt = pinv(lf' * invCf * lf) * lf' * invCf; 4) Augmenting the filter according to: filt = [filt zeros(size(filt,1),1);zeros(1,size(filt,2)) 1]; 5) Augmenting the Cf by introducing the reference-channels csd and reference power: Cf_ = [Cf Cr;Cr' Pr]; 6) Sandwiching: csd = filt * Cf_ * ctranspose(filt); 7) Calculating power and coherence: pow = real(trace(csd(1:6,1:6))); coh = lambda1( csd(1:3,7))./ sqrt(lambda1(csd(1:3,1:3))*csd(7,7)); Where do i fail? Is there something I do not understand? According to this scheme the power of point 7 should take into account both dipoles and the coherence should not be masked by the chosen dipole. Regards Cristiano On Fri, 8 Aug 2008 14:30:38 +0200, jan-mathijs schoffelen wrote: >Dear Cristiano, > >Nice simulation in figure 1! >The way you did the second simulation is just the 'traditional' DICS, >giving you a huge mountain of coherence around the reference location. >This will drown any other true cortico-cortical coherence to the >right hemisphere dipole. (Note that a double dipole approach will not >be of too >much help here, if you do a ccc-analysis with respect to your >reference: this is an important point in the paper you refer to. The >double dipole approach >will hopefully be able to unveil low coherence of the second dipole >to the reference, which is masked by the high power + high coherence >(one of these, >or perhaps both) in the reference dipole.) > >As such, the double dipole approach is not yet implemented in a >straightforward way in the release-version of fieldtrip, but I will >be happy to give you some handles: > >I would suggest to include the leadfield of the reference location in >the grid with precomputed leadfields which will be passed in the >configuration to sourceanalysis. >You have to concatenate the dipole-location specific leadfields with >the reference dipole's leadfield. This will give you leadfields of >dimensionality Nx6 (or Nx2 if you >have a reason to assume a fixed orientation). >Subsequently you can run sourceanalysis with cfg.keepfilter = 'yes' >and without cfg.refdip, to extract the filter coefficients. These >will have the dimensionality 6xN for each >double dipole, the first 3 rows corresponding to the location >specific location, and the last 3 rows corresponding to the reference >dipole. >To then compute your 'dipole pair and reference channel'-based cross- >spectral density you have to sandwich the sensor-level cross-spectral >density (take care to have >the channel-order identical to the channel order in the filters) >between the augmented filters. You can augment the filters to >accommodate for the reference channel in >the following way: [filter zeros(size(filter,1),1);zeros(1,size >(filter,2)) 1]; (make sure to put the reference channel last in the >channel csd. > From each sandwiched csd (7x7) you should be able to extract >anything you want. The top-left 6x6 block will contain the between >dipole csd (diagonal 3x3 blocks contain >the within dipole parameters from which power can be estimated: the >off-diagonal blocks contain the between dipole csd). The bottom right >value will contain the reference >signal power, and the 6x1 and 1x6 remaining vectors contain the >reference to dipole csds, in two groups of 3. The coherence can be >estimated (according to Joachim's 2001 >PNAS-paper) in this case by: svd( csd(1:3,7))./ sqrt(svd(csd(1:3,1:3)) >*csd(7,7)); > >Good luck, > >Jan-Mathijs > > > > > >On Aug 8, 2008, at 2:05 PM, Cristiano Micheli wrote: > >> Dear all >> I have some questions about the use of DICS in the case of two >> correlated >> cortical activations. >> I am using an isometric contraction protocol and i localized the >> reference >> dipole through cortico-muscular coherence with external myography and >> (classic) DICS method. Now I have to calculate cortico-cortical >> activations >> and i use: >> >> cfg = []; >> cfg.grid = grid; >> cfg.method = 'dics'; >> cfg.projectnoise = 'yes'; >> cfg.lambda = 0; >> cfg.refdip = ref_dipole_position; >> cfg.frequency = 20; >> cfg.hdmfile = 'mymodel.hdm'; >> sourcecond = sourceanalysis(cfg, freq); >> >> According to Schoffelen et al. in order to disentangle the sources a >> modification of the classic DICS algorithm is necessary. >> Am i supposed to extract the two activations if they are correlated >> with the >> above written lines? >> If not, how would it be a FT implementation to get to correlated >> sources >> localization with DICS? >> I tried with simulation and apparently the above implemetation is >> able to >> localize only one source with a spread activation. >> Attachments show: >> '1sourceDICS.png' : simulation with an external reference channel >> correlated >> with a source in the left emisphere >> '2sourcesCCCDICS.png': simulation with reference dipole (same as >> above) >> whose activity is correlated to a simmetric one in the right emisphere >> >> Best >> Cristiano >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ >> archives/fieldtrip.html and http://www.ru.nl/fcdonders/ >> fieldtrip.<1sourceDICS.png><2sourcesCCCDICS.png> > >---------------------------------- >The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Mon Aug 11 10:13:30 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 11 Aug 2008 10:13:30 +0200 Subject: BIOMAG 2008 In-Reply-To: <1218229310.489cb43eecc84@bamamail.ua.edu> Message-ID: Hi Gopakumar I will also go to the BIOMAG conference in Saporro. See you there, Robert On 8 Aug 2008, at 23:01, Gopakumar Venugopalan wrote: > Hello are there folks here on their way to Biomag 2008 (Sapporo)? > If so > would you please email me. Thanks in advance. > regards > gopa > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From dsenkows at UKE.DE Wed Aug 13 12:19:40 2008 From: dsenkows at UKE.DE (Daniel Senkowski) Date: Wed, 13 Aug 2008 12:19:40 +0200 Subject: channelselection.m Message-ID: Dear all, using data from a CTF 275 channel system, I am facing some minor issues with the current channelselection.m script (see error message below). I am therefore still using an older version of the channelselection.m script but would be interested if anyone else had a similar problem and possibly solved it. Regards, Daniel Senkowski -------- Here is the error message: Multitaper: PVh Subject: vp03... the input is raw data with 274 channels and 124 trials ??? Undefined function or method 'senstype' for input arguments of type 'cell'. Error in ==> channelselection at 104 isctf = senstype(datachannel, 'ctf'); Error in ==> freqanalysis_mtmconvol at 277 cfg.channel = channelselection(cfg.channel, data.label); Error in ==> freqanalysis at 200 [freq] = feval(sprintf('freqanalysis_%s',lower(cfg.method)), cfg, data); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Wed Aug 13 13:50:23 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 13 Aug 2008 13:50:23 +0200 Subject: channelselection.m In-Reply-To: Message-ID: Hi Daniel On 13 Aug 2008, at 12:19, Daniel Senkowski wrote: > using data from a CTF 275 channel system, I am facing some minor > issues with > the current channelselection.m script (see error message below). I am > therefore still using an older version of the channelselection.m > script but > would be interested if anyone else had a similar problem and > possibly solved it. > ... > Here is the error message: > > Multitaper: PVh Subject: vp03... > the input is raw data with 274 channels and 124 trials > ??? Undefined function or method 'senstype' for input arguments of > type 'cell'. > > Error in ==> channelselection at 104 > isctf = senstype(datachannel, 'ctf'); There should be a function senstype (fieldtrip/private/senstype.m) which is used here and which in your case cannot be found. As far as I can tell, that function is included in the ftp release. Please search for the senstype function in your fieldtrip directory. best regards, Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Thu Aug 14 12:11:17 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Thu, 14 Aug 2008 12:11:17 +0200 Subject: DICS power Message-ID: Hi All I have a problem with DICS's power and my simulations. I simulate an external virtual channel coupled with MEG activity in a specific frequency band (around 20 Hz). I use DICS and submethod 'ref_chan' and i can localize 1 source (even 2 if they are distant) but only if I use coherence as a functional parameter and reducerank=2. With power i always see a bright spot in the middle of the brain. Should i select some options to account for decreased sensors' sensibility in depth? Since I used anyway coherence parameter for localization I did not pay attention to this before but somehow it looks strange to me. I attach the code and power image. Regards cfg = []; cfg.grid = grid_; cfg.method = 'dics'; cfg.projectnoise = 'yes'; cfg.reducerank = 2; cfg.lambda = 0; cfg.refchan = refch; cfg.frequency = 20; cfg.hdmfile = 'myheadmodel.hdm'; sourcecond = sourceanalysis(cfg, freqcond); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: power.png Type: image/png Size: 157338 bytes Desc: not available URL: From j.schoffelen at PSY.GLA.AC.UK Thu Aug 14 12:18:43 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Thu, 14 Aug 2008 12:18:43 +0200 Subject: DICS power In-Reply-To: Message-ID: Dear Cristiano, This issue is covered in the 'applying beamforming techniques in the frequency domain'-tutorial on the fieldtrip-website. This is perfectly normal behaviour of the beamformer, when you use non-normalized leadfields (which I would do in the first place). In order to make sense out of the power-images you can do two things: -plot the power relative to another 'condition' (this is explained in the tutorial) -compute the 'neural-activity-index' (this is also explained in the tutorial) Please have a look there, it might already clear things up for you. Yours, Jan-Mathijs On Aug 14, 2008, at 12:11 PM, Cristiano Micheli wrote: > Hi All > I have a problem with DICS's power and my simulations. I simulate an > external virtual channel coupled with MEG activity in a specific > frequency > band (around 20 Hz). > I use DICS and submethod 'ref_chan' and i can localize 1 source > (even 2 if > they are distant) but only if I use coherence as a functional > parameter and > reducerank=2. > With power i always see a bright spot in the middle of the brain. > Should i select some options to account for decreased sensors' > sensibility > in depth? > Since I used anyway coherence parameter for localization I did not pay > attention to this before but somehow it looks strange to me. > I attach the code and power image. > Regards > > cfg = []; > cfg.grid = grid_; > cfg.method = 'dics'; > cfg.projectnoise = 'yes'; > cfg.reducerank = 2; > cfg.lambda = 0; > cfg.refchan = refch; > cfg.frequency = 20; > cfg.hdmfile = 'myheadmodel.hdm'; > sourcecond = sourceanalysis(cfg, freqcond); > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/ > fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From djs32 at BUFFALO.EDU Thu Aug 14 13:15:23 2008 From: djs32 at BUFFALO.EDU (Daniel Stolzberg) Date: Thu, 14 Aug 2008 13:15:23 +0200 Subject: Tucker-Davis Technologies and PLX Message-ID: Hello, I have acquired multichannel continuous data using Tucker-Davis Technologies (TDT) equipment and the OpenEx software. I have been unable to directly import the TDT 'tanks' into fieldtrip so I created a very roundabout way by first using the OpenEx software to export the data to a comma separated values (csv) file format and then import it into Matlab using a script. This is time consuming and limiting. Does anyone have more detailed information on how TDT formats their data tanks? TDT support was not very helpful with this issue (although they are usually helpful). TDT's OpenEx software also allows one to export to PLX data format. I have been unable to open PLX files with FieldTrip because the function 'read_plexon_plx' does not exist. Does anyone have information on this function? Thank you! -Dan ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From alexander.roth at MED.UNI-HEIDELBERG.DE Fri Aug 15 10:02:05 2008 From: alexander.roth at MED.UNI-HEIDELBERG.DE (Alexander Roth) Date: Fri, 15 Aug 2008 10:02:05 +0200 Subject: Bug? Message-ID: I downloaded the latest version of fieldtrip (fieldtrip-20080814) this morning. I tried to create a headmodel via: cfg=[]; cfg.headshape='LTM_VP011_pic.sfp' [vol]=prepare_singleshell(cfg); An error occured: ??? Undefined function or method 'read_headshape' for input arguments of type 'char'. Error in ==> prepare_singleshell at 164 shape = read_headshape(cfg.headshape); There's a note in the changelog saying that from now on the function 'read_headshape()' should be used to read head model data. However, it seems that this file isn't included in the fieldtrip package. Best, Alex ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Fri Aug 15 11:10:18 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Fri, 15 Aug 2008 11:10:18 +0200 Subject: Bug? In-Reply-To: Message-ID: Dear Alex, Thanks for the quick bug report. I added read_headshape to the release version. It will be available tonight. Yours, Jan-Mathijs On Aug 15, 2008, at 10:02 AM, Alexander Roth wrote: > I downloaded the latest version of fieldtrip (fieldtrip-20080814) this > morning. I tried to create a headmodel via: > > cfg=[]; > cfg.headshape='LTM_VP011_pic.sfp' > [vol]=prepare_singleshell(cfg); > > An error occured: > > ??? Undefined function or method 'read_headshape' for input > arguments of > type 'char'. > > Error in ==> prepare_singleshell at 164 > shape = read_headshape(cfg.headshape); > > There's a note in the changelog saying that from now on the function > 'read_headshape()' should be used to read head model data. However, > it seems > that this file isn't included in the fieldtrip package. > > Best, > > Alex > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Fri Aug 15 15:08:29 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Fri, 15 Aug 2008 15:08:29 +0200 Subject: Beamformer of correlated sources Message-ID: About your last email: On Fri, 8 Aug 2008 14:30:38 +0200, jan-mathijs schoffelen wrote: >Dear Cristiano, > >Nice simulation in figure 1! >The way you did the second simulation is just the 'traditional' DICS, >giving you a huge mountain of coherence around the reference location. >This will drown any other true cortico-cortical coherence to the >right hemisphere dipole. (Note that a double dipole approach will not >be of too >much help here, if you do a ccc-analysis with respect to your >reference: this is an important point in the paper you refer to. The >double dipole approach >will hopefully be able to unveil low coherence of the second dipole >to the reference, which is masked by the high power + high coherence >(one of these, >or perhaps both) in the reference dipole.) > >As such, the double dipole approach is not yet implemented in a >straightforward way in the release-version of fieldtrip, but I will >be happy to give you some handles: > >I would suggest to include the leadfield of the reference location in >the grid with precomputed leadfields which will be passed in the >configuration to sourceanalysis. >You have to concatenate the dipole-location specific leadfields with >the reference dipole's leadfield. This will give you leadfields of >dimensionality Nx6 (or Nx2 if you >have a reason to assume a fixed orientation). >Subsequently you can run sourceanalysis with cfg.keepfilter = 'yes' >and without cfg.refdip, to extract the filter coefficients. These >will have the dimensionality 6xN for each >double dipole, the first 3 rows corresponding to the location >specific location, and the last 3 rows corresponding to the reference >dipole. I created a file named 'my_prepare_leadfield.m' and i concatenated the lead field as written (line 235): % grid.leadfield{dipindx} = lf; %old %%%%%%%%%%%%%%%%%%% new lf2 = compute_leadfield([0 5 10], sens, vol, 'reducerank', cfg.reducerank, 'normalize', cfg.normalize,'normalizeparam',cfg.normalizeparam); grid.leadfield{dipindx} = [lf lf2]; %%%%%%%%%%%%%%%%%%% new Then I run the DICS with the following settings as you adviced: cfg = []; cfg.grid = grid_; cfg.method = 'dics'; cfg.projectnoise = 'yes'; cfg.reducerank = 2; cfg.lambda = 0; cfg.refchan = refch; cfg.frequency = 20; cfg.hdmfile = 'mymodel.hdm'; cfg.keepfilter= 'yes'; sourcecond = sourceanalysis(cfg, freqcond); >To then compute your 'dipole pair and reference channel'-based cross- >spectral density you have to sandwich the sensor-level cross-spectral >density (take care to have >the channel-order identical to the channel order in the filters) >between the augmented filters. You can augment the filters to >accommodate for the reference channel in >the following way: [filter zeros(size(filter,1),1);zeros(1,size >(filter,2)) 1]; (make sure to put the reference channel last in the >channel csd. Before doing it I think I will have to include Cf and Cr and Pr in the same matrix, but i am not sure. Namely: csd = filter * Cf_ * ctranspose(filter) with filt of dimensions 6X(N+1) channels after augmenting, and Cf_ made of the contributions of MEG channel-channels cross-variance plus the contribution of MEG-EMG channels crossvariance Cr (column vector): Cf_ = [Cf,Cr;Cr' Pr]; > From each sandwiched csd (7x7) you should be able to extract >anything you want. The top-left 6x6 block will contain the between >dipole csd (diagonal 3x3 blocks contain >the within dipole parameters from which power can be estimated: the >off-diagonal blocks contain the between dipole csd). The bottom right >value will contain the reference >signal power, and the 6x1 and 1x6 remaining vectors contain the >reference to dipole csds, in two groups of 3. The coherence can be >estimated (according to Joachim's 2001 >PNAS-paper) in this case by: svd( csd(1:3,7))./ sqrt(svd(csd(1:3,1:3)) >*csd(7,7)); > >Good luck, > >Jan-Mathijs This makes sense to me, considering also the literature (Dalal et al. 2006, Brookes et al. 2007), but I weight equally the contributions of two correlated dipoles, which can also have different amplitudes. This is why maybe my simulations are not able to attenuate the main dipole? Best Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Fri Aug 15 15:27:47 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Fri, 15 Aug 2008 15:27:47 +0200 Subject: Beamformer of correlated sources In-Reply-To: Message-ID: Dear Cristiano, What do you exactly mean by 'not able to attenuate the main dipole'? Do you mean attenuation of power, or of coherence? The purpose of using several dipoles in your source model (be it one location fixed and the other moving, or a symmetric dipole pair, or whatever) before computing the beamformer weights will not lead to attenuation. The underlying idea of allowing the two locations in the spatial pass- band, is to prevent the 'main dipole' from distorting the reconstructed signal. Distortion of the reconstructed signal at the second location of interest, will critically affect the cross- spectral density with the reference signal, and thus the reconstructed coherence. Importantly, the double dipole approach does still not take the problem of filter leakage away and therefore will generally not lead to a clear ccc-map. There will still be a 'dome' of coherence around the reference location, unless you have a well- specified condition to be able to compute a contrast (although this poses problems in itself, because differences in estimated power lead to different shapes of the 'domes'). As a remark on the side, recent work I did in this direction actually made me realize that the absolute value of the simulated coherence between a target dipole pair can be estimated quite accurately with a beamformer (given appropriate snr, leadfield correlations etc), but problems arise from the fact that other regions in the brain will show even higher values of correlation. I realize I did not provide any answers here but hopefully some food for thought. Yours, Jan-Mathijs On Aug 15, 2008, at 3:08 PM, Cristiano Micheli wrote: > About your last email: > > On Fri, 8 Aug 2008 14:30:38 +0200, jan-mathijs schoffelen > wrote: > >> Dear Cristiano, >> >> Nice simulation in figure 1! >> The way you did the second simulation is just the 'traditional' DICS, >> giving you a huge mountain of coherence around the reference >> location. >> This will drown any other true cortico-cortical coherence to the >> right hemisphere dipole. (Note that a double dipole approach will not >> be of too >> much help here, if you do a ccc-analysis with respect to your >> reference: this is an important point in the paper you refer to. The >> double dipole approach >> will hopefully be able to unveil low coherence of the second dipole >> to the reference, which is masked by the high power + high coherence >> (one of these, >> or perhaps both) in the reference dipole.) >> >> As such, the double dipole approach is not yet implemented in a >> straightforward way in the release-version of fieldtrip, but I will >> be happy to give you some handles: >> >> I would suggest to include the leadfield of the reference location in >> the grid with precomputed leadfields which will be passed in the >> configuration to sourceanalysis. >> You have to concatenate the dipole-location specific leadfields with >> the reference dipole's leadfield. This will give you leadfields of >> dimensionality Nx6 (or Nx2 if you >> have a reason to assume a fixed orientation). >> Subsequently you can run sourceanalysis with cfg.keepfilter = 'yes' >> and without cfg.refdip, to extract the filter coefficients. These >> will have the dimensionality 6xN for each >> double dipole, the first 3 rows corresponding to the location >> specific location, and the last 3 rows corresponding to the reference >> dipole. > > I created a file named 'my_prepare_leadfield.m' and i > concatenated the > lead field as written (line 235): > > % grid.leadfield{dipindx} = lf; %old > %%%%%%%%%%%%%%%%%%% new > lf2 = compute_leadfield([0 5 10], sens, vol, 'reducerank', > cfg.reducerank, > 'normalize', cfg.normalize,'normalizeparam',cfg.normalizeparam); > grid.leadfield{dipindx} = [lf lf2]; > %%%%%%%%%%%%%%%%%%% new > > Then I run the DICS with the following settings as you adviced: > > cfg = []; > cfg.grid = grid_; > cfg.method = 'dics'; > cfg.projectnoise = 'yes'; > cfg.reducerank = 2; > cfg.lambda = 0; > cfg.refchan = refch; > cfg.frequency = 20; > cfg.hdmfile = 'mymodel.hdm'; > cfg.keepfilter= 'yes'; > sourcecond = sourceanalysis(cfg, freqcond); > >> To then compute your 'dipole pair and reference channel'-based cross- >> spectral density you have to sandwich the sensor-level cross-spectral >> density (take care to have >> the channel-order identical to the channel order in the filters) >> between the augmented filters. You can augment the filters to >> accommodate for the reference channel in >> the following way: [filter zeros(size(filter,1),1);zeros(1,size >> (filter,2)) 1]; (make sure to put the reference channel last in the >> channel csd. > > Before doing it I think I will have to include Cf and Cr and Pr in > the same > matrix, but i am not sure. > Namely: csd = filter * Cf_ * ctranspose(filter) > with filt of dimensions 6X(N+1) channels after augmenting, and Cf_ > made of > the contributions of MEG channel-channels cross-variance plus the > contribution of MEG-EMG channels crossvariance Cr (column vector): > > Cf_ = [Cf,Cr;Cr' Pr]; > >> From each sandwiched csd (7x7) you should be able to extract >> anything you want. The top-left 6x6 block will contain the between >> dipole csd (diagonal 3x3 blocks contain >> the within dipole parameters from which power can be estimated: the >> off-diagonal blocks contain the between dipole csd). The bottom right >> value will contain the reference >> signal power, and the 6x1 and 1x6 remaining vectors contain the >> reference to dipole csds, in two groups of 3. The coherence can be >> estimated (according to Joachim's 2001 >> PNAS-paper) in this case by: svd( csd(1:3,7))./ sqrt(svd(csd >> (1:3,1:3)) >> *csd(7,7)); >> >> Good luck, >> >> Jan-Mathijs > > This makes sense to me, considering also the literature (Dalal et > al. 2006, > Brookes et al. 2007), but I weight equally the contributions of two > correlated dipoles, which can also have different amplitudes. > This is why maybe my simulations are not able to attenuate the main > dipole? > Best > > > Cristiano > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From thomas.hartmann at UNI-KONSTANZ.DE Fri Aug 15 16:42:32 2008 From: thomas.hartmann at UNI-KONSTANZ.DE (Thomas Hartmann) Date: Fri, 15 Aug 2008 16:42:32 +0200 Subject: reject components with less components than channels in matrix Message-ID: hi y'all! i am trying to use the ica to correct my data for artifacts. as i do an average-reference on the data prior to calculating the weights using fastica, only 63 components are computed from my 64 channels. if i then try to run componentanalysis on the real data using the former calculated weights, componentanalysis gives an error because the function expects as many components as channels in the input. i fixed this in the file. but rejectcomponent also seems to expect as many components as channels, as it tells me that it e.g. removed 2 components and kept 62, although there are only 63 components in the matrix. any help? cheers and thanks, thomas ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From enteka at HOTMAIL.COM Fri Aug 15 17:22:24 2008 From: enteka at HOTMAIL.COM (Nicolas Robitaille) Date: Fri, 15 Aug 2008 15:22:24 +0000 Subject: reject components with less components than channels in matrix In-Reply-To: <48A595D8.6080706@uni-konstanz.de> Message-ID: Hi Thomas I ran into the same kind of problem running PCA reduction in binica. I end up with an unstable workaround, so I won't send it, but you may like to know that: 1- in rejectcomponent.m, the number of component is determine by the length of the comp.label list, which is created in componentanalysis.m. [line 75 of rejectcomponent.m] % determine the number of channels and the number of components Nchan = length(comp.topolabel); Ncomp = length(comp.label); I needed to fix the creation of this list, I guess you may have to. 2- In order to actually do the rejection, I created an empty square matrix (full of 0) and stick in it the components to-be-kept.: [line 99 of rejectcomponent.m] comp.topo(:,cfg.component) = 0; w = zeros(Nchan,Nchan); w(:,1:Ncomp) = comp.topo; for ii=1:ntrials data.trial(ii,:,:) = w * squeeze(data.trial(ii,:,:)); end Hope this help Nic ************************************ Nicolas Robitaille, candidat Ph.D Département de Psychologie Université de Montréal C.P. 6128, succursale Centre-ville Montréal, Québec H3C 3J7 Tel.: 514-343-6111 x2631 Fax: 514-343-5787 ************************************ > Date: Fri, 15 Aug 2008 16:42:32 +0200 > From: thomas.hartmann at UNI-KONSTANZ.DE > Subject: [FIELDTRIP] reject components with less components than channels in matrix > To: FIELDTRIP at NIC.SURFNET.NL > > hi y'all! > > i am trying to use the ica to correct my data for artifacts. as i do an > average-reference on the data prior to calculating the weights using > fastica, only 63 components are computed from my 64 channels. > > if i then try to run componentanalysis on the real data using the former > calculated weights, componentanalysis gives an error because the > function expects as many components as channels in the input. > > i fixed this in the file. but rejectcomponent also seems to expect as > many components as channels, as it tells me that it e.g. removed 2 > components and kept 62, although there are only 63 components in the matrix. > > any help? > > cheers and thanks, > thomas > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. _________________________________________________________________ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From amrgermany at YAHOO.COM Sat Aug 16 12:02:20 2008 From: amrgermany at YAHOO.COM (A. Ayoub) Date: Sat, 16 Aug 2008 12:02:20 +0200 Subject: Fieldtrip-0.9.7 Mapping CTF151 Message-ID: Hello, I am trying to map CTF151 MEG data using the electrode position option. The result is rotated 90 degrees clock wise with respect to the nose. The rotation was confirmed by plotting the layout. It looks something went wrong in stereographic projection. Is there a way around this bug? Best regards, Amr PS: I have used topoplotER.m which intern calls createlayout.m ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From dsenkows at UKE.DE Mon Aug 18 13:36:17 2008 From: dsenkows at UKE.DE (Daniel Senkowski) Date: Mon, 18 Aug 2008 13:36:17 +0200 Subject: setfield issue and sourcestatistics Message-ID: Hi, I am trying to run the sourcestatistic.m script on the ouput files from sourcegrandaverage.m and receive an error message with refers to the setfield and setsubfield scripts. Did anyone had similar issues or has an idea how to solve it? Thank you very much and best greetings, Daniel >> test test = pos: [11466x3 double] dim: [21 26 21] transform: [4x4 double] avg: [1x1 struct] var: [1x1 struct] dimord: 'voxel' trial: [1x16 struct] inside: [5759x1 double] outside: [5707x1 double] df: [11466x1 double] cfg: [1x1 struct] >> test.trial ans = 1x16 struct array with fields: pow >> test2 test2 = pos: [11466x3 double] dim: [21 26 21] transform: [4x4 double] avg: [1x1 struct] var: [1x1 struct] dimord: 'voxel' trial: [1x16 struct] inside: [5759x1 double] outside: [5707x1 double] df: [11466x1 double] cfg: [1x1 struct] >> cfg = []; cfg.method = 'parametric'; cfg.statistic = 'difference'; cfg.parameter = 'pow'; cfg.bonferoni = 'no'; cfg.threshold = 0.05; stat = sourcestatistics(cfg, test, test2); ??? Error using ==> setfield at 58 Insufficient outputs from right hand side to satisfy comma separated list expansion on left hand side. Missing [] are the most likely cause. Error in ==> setsubfield at 33 s = setfield(s, t{:}, v); Error in ==> checkdata at 403 data = setsubfield(data, param{i}, tmp); Error in ==> sourcestatistics at 113 varargin{i} = checkdata(varargin{i}, 'datatype', {'source', 'volume'}, 'feedback', 'no', 'inside', 'index'); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Wed Aug 20 21:03:40 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Wed, 20 Aug 2008 21:03:40 +0200 Subject: setfield issue and sourcestatistics In-Reply-To: Message-ID: Dear Daniel, The problem was hard to track down, but I noticed that an easy workaround can be achieved, when you remove the .transform field from your grandaveraged source (test = rmfield(test, 'transform'); Alternatively, you can download the latest version of fieldtrip (available as of tomorrow) in which I (hopefully) fixed the problem. Yours, JM PS: Robert, maybe we could discuss this issue, because this is due to recent changes which were made to make the difference between volumetric and source-metric data more explicit. On Aug 18, 2008, at 1:36 PM, Daniel Senkowski wrote: > Hi, > > I am trying to run the sourcestatistic.m script on the ouput files > from > sourcegrandaverage.m and receive an error message with refers to the > setfield and setsubfield scripts. > > Did anyone had similar issues or has an idea how to solve it? > > Thank you very much and best greetings, > > Daniel > > > >>> test > > test = > > pos: [11466x3 double] > dim: [21 26 21] > transform: [4x4 double] > avg: [1x1 struct] > var: [1x1 struct] > dimord: 'voxel' > trial: [1x16 struct] > inside: [5759x1 double] > outside: [5707x1 double] > df: [11466x1 double] > cfg: [1x1 struct] > >>> test.trial > > ans = > > 1x16 struct array with fields: > pow > > >>> test2 > > test2 = > > pos: [11466x3 double] > dim: [21 26 21] > transform: [4x4 double] > avg: [1x1 struct] > var: [1x1 struct] > dimord: 'voxel' > trial: [1x16 struct] > inside: [5759x1 double] > outside: [5707x1 double] > df: [11466x1 double] > cfg: [1x1 struct] > >>> cfg = []; > cfg.method = 'parametric'; > cfg.statistic = 'difference'; > cfg.parameter = 'pow'; > cfg.bonferoni = 'no'; > cfg.threshold = 0.05; > > stat = sourcestatistics(cfg, test, test2); > ??? Error using ==> setfield at 58 > Insufficient outputs from right hand side to satisfy comma separated > list expansion on left hand side. Missing [] are the most likely > cause. > > Error in ==> setsubfield at 33 > s = setfield(s, t{:}, v); > > Error in ==> checkdata at 403 > data = setsubfield(data, param{i}, tmp); > > Error in ==> sourcestatistics at 113 > varargin{i} = checkdata(varargin{i}, 'datatype', {'source', > 'volume'}, > 'feedback', 'no', 'inside', 'index'); > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From alihena_ at HOTMAIL.COM Wed Aug 27 15:40:31 2008 From: alihena_ at HOTMAIL.COM (A. Rodrigo) Date: Wed, 27 Aug 2008 15:40:31 +0200 Subject: Problems with volumesegment Message-ID: Hi, When I run >> mri = read_fcdc_mri('Subject01.mri'); cfg = []; cfg.write = 'no'; cfg.coordinates = 'ctf'; [segmentedmri] = volumesegment(cfg, mri); The error message is : ??? Error using ==> spm_create_vol>create_vol "dim" field is the wrong size (1 4). Error in ==> spm_create_vol at 16 v = create_vol(V(i)); Error in ==> fieldtrip-20080511\private\volumewrite_spm at 61 Va = spm_create_vol(Va); Error in ==> volumesegment at 226 Va = volumewrite_spm([cfg.name,'.img'], mri.anatomy, mri.transform); Can you help me? Thanks a lot. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From K.Nazarpour at BHAM.AC.UK Wed Aug 27 17:21:20 2008 From: K.Nazarpour at BHAM.AC.UK (Kianoush Nazarpour) Date: Wed, 27 Aug 2008 16:21:20 +0100 Subject: Problems with volumesegment In-Reply-To: Message-ID: Hello there, This problem is so strange. Basically, as I understood all depends on your Matlab Version and SPM. I used 5 different versions of Matlab to get it work. The easiest solution sould be using MATLAB Version 7.2.0.232 (R2006a) along with the original SPM2 (without using the SPM2_updates files). Hope that helps, Kia ------------------------------------- Kianoush Nazarpour Research Fellow Behavioural Brain Sciences School of Psychology, University of Birmingham, Birmingham B15 2TT UK Tel: +44 121 414 7201 Email: K.Nazarpour at bham.ac.uk Web: http://prism.bham.ac.uk/~nazarpok A. Rodrigo wrote: > Hi, > > When I run >>> mri = read_fcdc_mri('Subject01.mri'); > cfg = []; > cfg.write = 'no'; > cfg.coordinates = 'ctf'; > [segmentedmri] = volumesegment(cfg, mri); > > The error message is : > > ??? Error using ==> spm_create_vol>create_vol > "dim" field is the wrong size (1 4). > > Error in ==> spm_create_vol at 16 > v = create_vol(V(i)); > > Error in ==> fieldtrip-20080511\private\volumewrite_spm at 61 > Va = spm_create_vol(Va); > > Error in ==> volumesegment at 226 > Va = volumewrite_spm([cfg.name,'.img'], mri.anatomy, mri.transform); > > > > Can you help me? Thanks a lot. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From dsenkows at UKE.DE Wed Aug 27 17:43:44 2008 From: dsenkows at UKE.DE (Daniel Senkowski) Date: Wed, 27 Aug 2008 17:43:44 +0200 Subject: topoplotER and timelockstatistics output Message-ID: Dear all, I am receiving a "Index exceeds matrix dimensions" error message when trying to plot the output (e.g., stat.mask) of the cluster-based non-parametric statistic and the very last value of the stat.mask is a "1". Temporarily, this problem could be solved when setting the last value to "0" (e.g., stat.mask(274) = 0). Regards, Daniel >> cfg = []; cfg.style = 'blank'; cfg.layout = '/home/senk/PROGRAMS/fieldtrip-20080826/CTF274.lay'; cfg.highlight = find(stat.mask); cfg.comment = 'no'; figure; topoplotER(cfg, GA19_ERF_P) title('Nonparametric: significant with cluster multiple comparison correction') reading layout from file /home/senk/PROGRAMS/fieldtrip-20080826/CTF274.lay ??? Index exceeds matrix dimensions. Error in ==> topoplot at 549 hp2 = plot(y(cfg.highlight), x(cfg.highlight), cfg.hlmarker, 'Color', cfg.hlcolor, 'markersize', cfg.hlmarkersize, ... Error in ==> topoplotER at 371 topoplot(tmpcfg,chanX,chanY,datavector,chanLabels); >> stat stat = prob: [274x1 double] posclusters: [1x2 struct] posclusterslabelmat: [274x1 double] posdistribution: [1x100 double] negclusters: [] negclusterslabelmat: [274x1 double] negdistribution: [1x100 double] mask: [274x1 logical] stat: [274x1 double] dimord: 'chan' label: {274x1 cell} cfg: [1x1 struct] >> stat.mask(274) = 0; ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From wibral at BIC.UNI-FRANKFURT.DE Fri Aug 1 10:00:01 2008 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Fri, 1 Aug 2008 10:00:01 +0200 Subject: Logical problem with CTF 3rd order gra diometers correction Message-ID: Dear Robert, thank you very much for your answer. What I tried to do is invoke reject artefact after denoise_synthetic so that it works on the already denoised data (which is of course useless as it reads the data anew as I see now) . The aim of this procedure was to keep more trials. Is there any way to achieve this? The only thing I can think of right now is to run 3rd grads in the CTF software, save these data, then read them in with the new functions (Fieldtrip should know then that data are already in 3rd grad, shouldn't it?) and proceed as usual (i.e. run rejectartefact + preprocessing). Best Regards, Michael > -----Ursprüngliche Nachricht----- > Von: "Robert Oostenveld" > Gesendet: 31.07.08 23:01:00 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] Logical problem with CTF 3rd order gradiometers correction > Hi Michael > > On 31 Jul 2008, at 18:11, Michael Wibral wrote: > > Dear listusers, > > I have a logical problem with denoise-synthetic. > > > > here's what I want to do: > > > > 1. use definetrial to make cfg.trl (works fine) > > 2. use preprocessing with the new cfg. headerfile='ctf_new' , > > cfg.datafile='ctf_new' options to read the reference gradiometer > > information and the data into a fieldtrip structure (works fine) > > 3. use denoise_synthetic to denoise the data (works fine ?) > > In the (sofar limited) experiences that I heard there are noticeable > differences mainly on the central/vertex sensors (which are also the > closest to the reference sensors). > > > 4. un artefact detection on these data (-> this works fine and > > updates cfg.trl) > > after artifact_xxx and rejectartifact you should read the data using > preprocessing. Or are you using rejectvisual? If so, then you don't > have to call preprocessing a second time, because the output of > rejectvisual is again your data with the bad trials removed. > > > 5. run preprocessing a second time for filtering and actually > > applying the results of artefact corrcetion,... i.e. those things > > that I didn't want to do before denoise_synthetic. > > After rejectartifact, you should be calling it here like preprocessing > (cfg), and not with a second input argument. > > If you call it like preprocessing(cfg, data), then the cfg should not > contain cfg.dataset and cfg.trl but only filtering options, because > the data should not be read from file. > > > BUT preprocessing complains that cfg shouldn't contain the cfg.trl > > field when no data are read - which is the case because I am > > invoking preprocessing a second time here on an existing fieldtrip > > structure. > > I suspect that you are mixing up rejectartifact and preprocessing. > Calling preprocessing with a 2nd data input argument is only meant to > apply another set of filters on that data (i.e. if you forgot to do > it in the first run, or if you sequentially want to bandstopfilter > some line noise or CRT artifacts). > > > Therefore all information from artefact rejection is lost. > > > > Somehow it seems that I can run denoise_synthetic only after > > artefact rejection, because I need a fieldtrip dataset to run it, > > but NO dataset for preprocessing to perform artefact correction, > > i.e. accept cfg.trl. This would be a pity. > > I must say that I had not considered sofar the interaction between > denoising and artifact detectoin and removal. The artfifact_xxx > functions perform detection on data from disk(*), i.e. prior to > reading the data into memory. The historical reason for (*) is to > save on memory when a lot of filter padding is used and when there is > a lot of overlap between padded trials. The padded regions should be > checked for artifacts (esp jump artifacts which cause a lot of filter > rinning), but in the end we don't need them in memory. The denoising > only happens after the data is read into memory. > > > Any suggestion how to solve this? > > For the moment I suggest to use the following sequence > > definetrial > preprocessing > denoise_synthetic > rejectvisual > > and not use artifact_xxx combined with rejectartifact. We are > revising the automatic artifact detection functions at the moment, > since computers nowadays have much more RAM than when we started > implementing it 5 years ago, and reading the padded data into memory > is now much less of a concern. So in the near future, it will be > possible to do autodetection of artifacts also on data that is in > memory, which means that then you could also do the autodetection > after denoise_synthetic. > > best regards > Robert > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 443 bytes Desc: not available URL: From michael.wibral at WEB.DE Fri Aug 1 11:18:05 2008 From: michael.wibral at WEB.DE (Michael Wibral) Date: Fri, 1 Aug 2008 11:18:05 +0200 Subject: Logical problem with CTF 3rd order gra diometers correction Message-ID: Dear Robert, thank you very much for your answer. What I tried to do is invoke reject artefact after denoise_synthetic so that it works on the already denoised data (which is of course useless as it reads the data anew as I see now) . The aim of this procedure was to keep more trials. Is there any way to achieve this? The only thing I can think of right now is to run 3rd grads in the CTF software, save these data, then read them in with the new functions (Fieldtrip should know then that data are already in 3rd grad, shouldn't it?) and proceed as usual (i.e. run rejectartefact + preprocessing). Best Regards, Michael > -----Ursprüngliche Nachricht----- > Von: "Robert Oostenveld" > Gesendet: 31.07.08 23:01:00 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] Logical problem with CTF 3rd order gradiometers correction > Hi Michael > > On 31 Jul 2008, at 18:11, Michael Wibral wrote: > > Dear listusers, > > I have a logical problem with denoise-synthetic. > > > > here's what I want to do: > > > > 1. use definetrial to make cfg.trl (works fine) > > 2. use preprocessing with the new cfg. headerfile='ctf_new' , > > cfg.datafile='ctf_new' options to read the reference gradiometer > > information and the data into a fieldtrip structure (works fine) > > 3. use denoise_synthetic to denoise the data (works fine ?) > > In the (sofar limited) experiences that I heard there are noticeable > differences mainly on the central/vertex sensors (which are also the > closest to the reference sensors). > > > 4. un artefact detection on these data (-> this works fine and > > updates cfg.trl) > > after artifact_xxx and rejectartifact you should read the data using > preprocessing. Or are you using rejectvisual? If so, then you don't > have to call preprocessing a second time, because the output of > rejectvisual is again your data with the bad trials removed. > > > 5. run preprocessing a second time for filtering and actually > > applying the results of artefact corrcetion,... i.e. those things > > that I didn't want to do before denoise_synthetic. > > After rejectartifact, you should be calling it here like preprocessing > (cfg), and not with a second input argument. > > If you call it like preprocessing(cfg, data), then the cfg should not > contain cfg.dataset and cfg.trl but only filtering options, because > the data should not be read from file. > > > BUT preprocessing complains that cfg shouldn't contain the cfg.trl > > field when no data are read - which is the case because I am > > invoking preprocessing a second time here on an existing fieldtrip > > structure. > > I suspect that you are mixing up rejectartifact and preprocessing. > Calling preprocessing with a 2nd data input argument is only meant to > apply another set of filters on that data (i.e. if you forgot to do > it in the first run, or if you sequentially want to bandstopfilter > some line noise or CRT artifacts). > > > Therefore all information from artefact rejection is lost. > > > > Somehow it seems that I can run denoise_synthetic only after > > artefact rejection, because I need a fieldtrip dataset to run it, > > but NO dataset for preprocessing to perform artefact correction, > > i.e. accept cfg.trl. This would be a pity. > > I must say that I had not considered sofar the interaction between > denoising and artifact detectoin and removal. The artfifact_xxx > functions perform detection on data from disk(*), i.e. prior to > reading the data into memory. The historical reason for (*) is to > save on memory when a lot of filter padding is used and when there is > a lot of overlap between padded trials. The padded regions should be > checked for artifacts (esp jump artifacts which cause a lot of filter > rinning), but in the end we don't need them in memory. The denoising > only happens after the data is read into memory. > > > Any suggestion how to solve this? > > For the moment I suggest to use the following sequence > > definetrial > preprocessing > denoise_synthetic > rejectvisual > > and not use artifact_xxx combined with rejectartifact. We are > revising the automatic artifact detection functions at the moment, > since computers nowadays have much more RAM than when we started > implementing it 5 years ago, and reading the padded data into memory > is now much less of a concern. So in the near future, it will be > possible to do autodetection of artifacts also on data that is in > memory, which means that then you could also do the autodetection > after denoise_synthetic. > > best regards > Robert > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 443 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 443 bytes Desc: not available URL: From michelic72 at GMAIL.COM Sat Aug 2 17:26:06 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Sat, 2 Aug 2008 17:26:06 +0200 Subject: Logical problem with CTF 3rd order gradiometers correction Message-ID: About point 2 and 3 of Michael's email Is it unimportant if I apply denoise_synthetic before or after preprocessing? I thought denoise_synthetic applies a non linear transformation of the data so that any filtering preprocessing should be done immediately after this. If this is the case i propose the following schema: 1) 'read-in' preprocessing: simply reads the dataset in a structure without doing anything 2) denoise_synthetic 3) filtering In code: 1) cfg = []; cfg.dataset = 'Mydata.ds'; cfg.datatype = 'continuous'; cfg.channel = 'all'; cfg.trl = 'Mytrialfunction'; cfg.headerformat = 'ctf_new'; cfg.dataformat = 'ctf_new'; meg = preprocessing(cfg); 2) cfg = []; cfg.gradient = 'G3BR'; cfg.trials = 'all'; meg_d = denoise_synthetic(cfg, meg); 3) cfg = []; cfg.channel = 'MEG'; cfg.hpfilter = 'yes'; cfg.hpfreq = 1; meg_df = preprocessing(cfg, megd); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Sat Aug 2 17:42:03 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Sat, 2 Aug 2008 17:42:03 +0200 Subject: Logical problem with CTF 3rd order gradiometers correction Message-ID: I tested the routine denoise_synthetic on some dataset and compared with the downloaded denoise CTF routines for matlab. Taking care not to apply any filtering or baseline correction in the data reading/preprocessing, it works fine. Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From nathan.dees at UMSL.EDU Tue Aug 5 02:45:58 2008 From: nathan.dees at UMSL.EDU (Nathan Dees) Date: Tue, 5 Aug 2008 02:45:58 +0200 Subject: DICS Localization Problem Message-ID: Dear Fieldtrippers, Have been struggling a long time to produce a viable image of beamforming analysis. We are using a 4D-Magnes3600 Magnetometer MEG unit to record a prompted finger tapping motor task with variable ISI of 2.5 - 3.0 seconds. Our time-frequency plots show evident beta and alpha desynchronization at movement onset. We are using the beamforming tutorial as a guide. After calculating dataPre and dataPost, and verifying our mri has been properly segmented by SPM, our code is: cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 2; cfg.foilim = [18 20]; cfg.pad = 0.5; freqPre = freqanalysis(cfg,dataPre); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 2; cfg.foilim = [18 20];segmentedmriF.transform = mri.transform; segmentedmriF.anatomy = mri.anatomy; cfg.pad = 0.5; freqPost = freqanalysis(cfg,dataPost); segmentedmri.transform = mri.transform; segmentedmri.anatomy = mri.anatomy; [vol, cfg] = prepare_singleshell([], segmentedmri); cfg = []; cfg.grad = freqPre.grad; cfg.vol = vol; cfg.reducerank = 2; cfg.channel = {'MEG'}; cfg.xgrid = -30:1:30; % 'AUTO' does not work! cfg.ygrid = -30:1:30; % 'AUTO' does not work! cfg.zgrid = -40:1:40; % 'AUTO' does not work! [grid] = prepare_leadfield(cfg); cfg = []; cfg.frequency = 20; cfg.method = 'dics'; cfg.projectnoise = 'yes'; cfg.grid = grid; cfg.vol = vol; cfg.lambda = 0; sourcePre = sourceanalysis(cfg,freqPre ); sourcePost = sourceanalysis(cfg,freqPost); %Plot of deep sources in the center of the brain looks reasonable. sourceDiff = sourcePost; sourceDiff.avg.pow = (sourcePre.avg.pow - sourcePost.avg.pow) ./ sourcePost.avg.pow; cfg = []; cfg.downsample = 2; sourceDiffInt = sourceinterpolate(cfg, sourceDiff , mri); cfg = []; cfg.method = 'slice'; cfg.funparameter = 'avg.pow'; cfg.maskparameter = cfg.funparameter; cfg.funcolorlim = [0.0 .2]; cfg.opacitylim = [0.0 .2]; cfg.opacitymap = 'rampup'; figure sourceplot(cfg,sourceDiffInt); We expect localization of desynchronization to be in the motor cortex, predominantly on the left side. The result we get is diffusely localized, and with weak signal. I have images to possibly help diagnose the problem, but for now, can anyone spot the errors? Thank you!! ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From nathanweisz at MAC.COM Tue Aug 5 07:34:34 2008 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Tue, 5 Aug 2008 07:34:34 +0200 Subject: DICS Localization Problem In-Reply-To: Message-ID: dear nathan, we see nice mu desynchronizations nicely localized to motor cortex when subjects prepare responding to a target using a 4-D 2500 WH (the one with 148 sensors). Have you already done localizations with your MEG system using a segmented brain? If not, then I suggest to check if you get the same results using a more 'standard' headmodel, e.g. multisphere (like in the tutorial). this assures you always are in the MEG-coordinate system, and have no weird mixture between coordinate systems. you need a headshape for that (pretty standard with 4D; i can provide you with one if you don't have one). also you might want to check if your volume / grid makes sense relative to the sensor position using 'headmodelplot'. good luck, yet-another-nathan On 05.08.2008, at 02:45, Nathan Dees wrote: > Dear Fieldtrippers, > > Have been struggling a long time to produce a viable image of > beamforming > analysis. We are using a 4D-Magnes3600 Magnetometer MEG unit to > record a > prompted finger tapping motor task with variable ISI of 2.5 - 3.0 > seconds. > Our time-frequency plots show evident beta and alpha > desynchronization at movement onset. We are using the beamforming > tutorial > as a guide. After calculating dataPre and dataPost, and verifying > our mri > has been properly segmented by SPM, our code is: > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'powandcsd'; > cfg.tapsmofrq = 2; > cfg.foilim = [18 20]; > cfg.pad = 0.5; > freqPre = freqanalysis(cfg,dataPre); > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'powandcsd'; > cfg.tapsmofrq = 2; > cfg.foilim = [18 20];segmentedmriF.transform = mri.transform; > segmentedmriF.anatomy = mri.anatomy; > cfg.pad = 0.5; > freqPost = freqanalysis(cfg,dataPost); > > segmentedmri.transform = mri.transform; > segmentedmri.anatomy = mri.anatomy; > [vol, cfg] = prepare_singleshell([], segmentedmri); > > cfg = []; > cfg.grad = freqPre.grad; > cfg.vol = vol; > cfg.reducerank = 2; > cfg.channel = {'MEG'}; > cfg.xgrid = -30:1:30; % 'AUTO' does not work! > cfg.ygrid = -30:1:30; % 'AUTO' does not work! > cfg.zgrid = -40:1:40; % 'AUTO' does not work! > [grid] = prepare_leadfield(cfg); > > cfg = []; > cfg.frequency = 20; > cfg.method = 'dics'; > cfg.projectnoise = 'yes'; > cfg.grid = grid; > cfg.vol = vol; > cfg.lambda = 0; > > sourcePre = sourceanalysis(cfg,freqPre ); > sourcePost = sourceanalysis(cfg,freqPost); > > %Plot of deep sources in the center of the brain looks reasonable. > > sourceDiff = sourcePost; > sourceDiff.avg.pow = (sourcePre.avg.pow - sourcePost.avg.pow) ./ > sourcePost.avg.pow; > cfg = []; > cfg.downsample = 2; > sourceDiffInt = sourceinterpolate(cfg, sourceDiff , mri); > > cfg = []; > cfg.method = 'slice'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > cfg.funcolorlim = [0.0 .2]; > cfg.opacitylim = [0.0 .2]; > cfg.opacitymap = 'rampup'; > figure > sourceplot(cfg,sourceDiffInt); > > We expect localization of desynchronization to be in the motor cortex, > predominantly on the left side. The result we get is diffusely > localized, > and with weak signal. I have images to possibly help diagnose the > problem, > but for now, can anyone spot the errors? > > Thank you!! > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/fcdonders/fieldtrip. -------------------------------------------- Attention: New Contact Details -------------------------------------------- Dr. Nathan Weisz OBOB-Lab University of Konstanz Department of Psychology P.O. Box D23 78457 Konstanz Germany Tel: ++49 - (0)7531 - 88 45 84 Email: nathan.weisz at uni-konstanz.de Homepage: coming soon Bob-wisdom: It's better to do one job well than two jobs... not so well. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.litvak at ION.UCL.AC.UK Tue Aug 5 10:10:10 2008 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Tue, 5 Aug 2008 09:10:10 +0100 Subject: DICS Localization Problem In-Reply-To: <9A794572-9406-497C-ADCE-22C7C1389F3C@mac.com> Message-ID: Dear Nathans, I think Nathan2 is in the right direction. I don't see anything in Nathan1's code that performs coregistration of the head model and the sensors, Robert and people at the Donders use CTF software to prepare their MRIs. In that software they specify the three fiducials and then the MRI is saved with transform from voxels to CTF head coordinates, the same coordinate system that the sensors are in. Thus when one uses MRI preprocessed with CTF software there is no need to coregrister. But this is not true in general, but rather an exception. Nathan1 uses MRI preprocessed with SPM. This MRI is most probably in MNI or some native coordinates in mm. The sensors are in head coordinates in cm (although I'm not sure about your particular system). The latest versions of FT, of the last month or so complain if there is a mismatch in units but they don't complain if your sensors are rotated 90 degrees for instance. So indeed you should become very well familiar with headmodelplot. Also look at volumerealign, electroderealign and interactiverealign. In general coregistration is quite tricky business, which is not very well reflected at the FT website because at the Donders they do it in one particular way, which makes it not so tricky for them. In SPM8 which will be released in October and is integrated with FT there will be a semi- automatic tool for coregistration that works with the 3 common MEG systems. But until then you have to figure it out. It's useful in the long run if you don't want to do things blindly. Best, Vladimir On Tue, Aug 5, 2008 at 6:34 AM, Nathan Weisz wrote: > dear nathan, > we see nice mu desynchronizations nicely localized to motor cortex when > subjects prepare responding to a target using a 4-D 2500 WH (the one with > 148 sensors). > Have you already done localizations with your MEG system using a segmented > brain? If not, then I suggest to check if you get the same results using a > more 'standard' headmodel, e.g. multisphere (like in the tutorial). this > assures you always are in the MEG-coordinate system, and have no weird > mixture between coordinate systems. you need a headshape for that (pretty > standard with 4D; i can provide you with one if you don't have one). also > you might want to check if your volume / grid makes sense relative to the > sensor position using 'headmodelplot'. > good luck, > yet-another-nathan > On 05.08.2008, at 02:45, Nathan Dees wrote: > > Dear Fieldtrippers, > > Have been struggling a long time to produce a viable image of beamforming > analysis. We are using a 4D-Magnes3600 Magnetometer MEG unit to record a > prompted finger tapping motor task with variable ISI of 2.5 - 3.0 seconds. > Our time-frequency plots show evident beta and alpha > desynchronization at movement onset. We are using the beamforming tutorial > as a guide. After calculating dataPre and dataPost, and verifying our mri > has been properly segmented by SPM, our code is: > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'powandcsd'; > cfg.tapsmofrq = 2; > cfg.foilim = [18 20]; > cfg.pad = 0.5; > freqPre = freqanalysis(cfg,dataPre); > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'powandcsd'; > cfg.tapsmofrq = 2; > cfg.foilim = [18 20];segmentedmriF.transform = mri.transform; > segmentedmriF.anatomy = mri.anatomy; > cfg.pad = 0.5; > freqPost = freqanalysis(cfg,dataPost); > > segmentedmri.transform = mri.transform; > segmentedmri.anatomy = mri.anatomy; > [vol, cfg] = prepare_singleshell([], segmentedmri); > > cfg = []; > cfg.grad = freqPre.grad; > cfg.vol = vol; > cfg.reducerank = 2; > cfg.channel = {'MEG'}; > cfg.xgrid = -30:1:30; % 'AUTO' does not work! > cfg.ygrid = -30:1:30; % 'AUTO' does not work! > cfg.zgrid = -40:1:40; % 'AUTO' does not work! > [grid] = prepare_leadfield(cfg); > > cfg = []; > cfg.frequency = 20; > cfg.method = 'dics'; > cfg.projectnoise = 'yes'; > cfg.grid = grid; > cfg.vol = vol; > cfg.lambda = 0; > > sourcePre = sourceanalysis(cfg,freqPre ); > sourcePost = sourceanalysis(cfg,freqPost); > > %Plot of deep sources in the center of the brain looks reasonable. > > sourceDiff = sourcePost; > sourceDiff.avg.pow = (sourcePre.avg.pow - sourcePost.avg.pow) ./ > sourcePost.avg.pow; > cfg = []; > cfg.downsample = 2; > sourceDiffInt = sourceinterpolate(cfg, sourceDiff , mri); > > cfg = []; > cfg.method = 'slice'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > cfg.funcolorlim = [0.0 .2]; > cfg.opacitylim = [0.0 .2]; > cfg.opacitymap = 'rampup'; > figure > sourceplot(cfg,sourceDiffInt); > > We expect localization of desynchronization to be in the motor cortex, > predominantly on the left side. The result we get is diffusely localized, > and with weak signal. I have images to possibly help diagnose the problem, > but for now, can anyone spot the errors? > > Thank you!! > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > > -------------------------------------------- > Attention: New Contact Details > -------------------------------------------- > Dr. Nathan Weisz > OBOB-Lab > University of Konstanz > Department of Psychology > P.O. Box D23 > 78457 Konstanz > Germany > Tel: ++49 - (0)7531 - 88 45 84 > Email: nathan.weisz at uni-konstanz.de > Homepage: coming soon > Bob-wisdom: It's better to do one job well than two jobs... not so well. > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and > EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Tue Aug 5 10:44:49 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Tue, 5 Aug 2008 10:44:49 +0200 Subject: DICS Localization Problem Message-ID: > Dear Nathan and Nathan, > > I'd like to add that I recently discovered some inconsistencies > with respect to the units in which gradiometer positions/dipole > positions etc. are expressed. > We are in the process of looking into this and making it > consistent. For now you should ensure yourself that the gradiometer > positions and grid locations and the mri-transformation matrix have > the same units (which is meters in our 4D-system). Moreover, the > singleshell method somewhere has a hard-coded assumption that the > units are centimeters (which is the default units for CTF systems) > so the solution might not be entirely correct if you use meters. > > Yours, > Jan-Mathijs > > On Aug 5, 2008, at 7:34 AM, Nathan Weisz wrote: > >> dear nathan, >> >> we see nice mu desynchronizations nicely localized to motor cortex >> when subjects prepare responding to a target using a 4-D 2500 WH >> (the one with 148 sensors). >> Have you already done localizations with your MEG system using a >> segmented brain? If not, then I suggest to check if you get the >> same results using a more 'standard' headmodel, e.g. multisphere >> (like in the tutorial). this assures you always are in the MEG- >> coordinate system, and have no weird mixture between coordinate >> systems. you need a headshape for that (pretty standard with 4D; i >> can provide you with one if you don't have one). also you might >> want to check if your volume / grid makes sense relative to the >> sensor position using 'headmodelplot'. >> >> good luck, >> yet-another-nathan >> >> On 05.08.2008, at 02:45, Nathan Dees wrote: >> >>> Dear Fieldtrippers, >>> >>> Have been struggling a long time to produce a viable image of >>> beamforming >>> analysis. We are using a 4D-Magnes3600 Magnetometer MEG unit to >>> record a >>> prompted finger tapping motor task with variable ISI of 2.5 - 3.0 >>> seconds. >>> Our time-frequency plots show evident beta and alpha >>> desynchronization at movement onset. We are using the >>> beamforming tutorial >>> as a guide. After calculating dataPre and dataPost, and >>> verifying our mri >>> has been properly segmented by SPM, our code is: >>> >>> cfg = []; >>> cfg.method = 'mtmfft'; >>> cfg.output = 'powandcsd'; >>> cfg.tapsmofrq = 2; >>> cfg.foilim = [18 20]; >>> cfg.pad = 0.5; >>> freqPre = freqanalysis(cfg,dataPre); >>> >>> cfg = []; >>> cfg.method = 'mtmfft'; >>> cfg.output = 'powandcsd'; >>> cfg.tapsmofrq = 2; >>> cfg.foilim = [18 20];segmentedmriF.transform = mri.transform; >>> segmentedmriF.anatomy = mri.anatomy; >>> cfg.pad = 0.5; >>> freqPost = freqanalysis(cfg,dataPost); >>> >>> segmentedmri.transform = mri.transform; >>> segmentedmri.anatomy = mri.anatomy; >>> [vol, cfg] = prepare_singleshell([], segmentedmri); >>> >>> cfg = []; >>> cfg.grad = freqPre.grad; >>> cfg.vol = vol; >>> cfg.reducerank = 2; >>> cfg.channel = {'MEG'}; >>> cfg.xgrid = -30:1:30; % 'AUTO' does not work! >>> cfg.ygrid = -30:1:30; % 'AUTO' does not work! >>> cfg.zgrid = -40:1:40; % 'AUTO' does not work! >>> [grid] = prepare_leadfield(cfg); >>> >>> cfg = []; >>> cfg.frequency = 20; >>> cfg.method = 'dics'; >>> cfg.projectnoise = 'yes'; >>> cfg.grid = grid; >>> cfg.vol = vol; >>> cfg.lambda = 0; >>> >>> sourcePre = sourceanalysis(cfg,freqPre ); >>> sourcePost = sourceanalysis(cfg,freqPost); >>> >>> %Plot of deep sources in the center of the brain looks reasonable. >>> >>> sourceDiff = sourcePost; >>> sourceDiff.avg.pow = (sourcePre.avg.pow - sourcePost.avg.pow) ./ >>> sourcePost.avg.pow; >>> cfg = []; >>> cfg.downsample = 2; >>> sourceDiffInt = sourceinterpolate(cfg, sourceDiff , mri); >>> >>> cfg = []; >>> cfg.method = 'slice'; >>> cfg.funparameter = 'avg.pow'; >>> cfg.maskparameter = cfg.funparameter; >>> cfg.funcolorlim = [0.0 .2]; >>> cfg.opacitylim = [0.0 .2]; >>> cfg.opacitymap = 'rampup'; >>> figure >>> sourceplot(cfg,sourceDiffInt); >>> >>> We expect localization of desynchronization to be in the motor >>> cortex, >>> predominantly on the left side. The result we get is diffusely >>> localized, >>> and with weak signal. I have images to possibly help diagnose >>> the problem, >>> but for now, can anyone spot the errors? >>> >>> Thank you!! >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between >>> users of the FieldTrip toolbox, to share experiences and to >>> discuss new ideas for MEG and EEG analysis. See also http:// >>> listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/ >>> fcdonders/fieldtrip. >> >> -------------------------------------------- >> Attention: New Contact Details >> -------------------------------------------- >> Dr. Nathan Weisz >> >> OBOB-Lab >> University of Konstanz >> Department of Psychology >> P.O. Box D23 >> 78457 Konstanz >> Germany >> >> Tel: ++49 - (0)7531 - 88 45 84 >> Email: nathan.weisz at uni-konstanz.de >> Homepage: coming soon >> >> Bob-wisdom: It's better to do one job well than two jobs... not so >> well. >> >> ---------------------------------- >> >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. >> >> http://listserv.surfnet.nl/archives/fieldtrip.html >> >> http://www.ru.nl/fcdonders/fieldtrip/ >> > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From michelic72 at GMAIL.COM Fri Aug 8 14:05:20 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Fri, 8 Aug 2008 14:05:20 +0200 Subject: Beamformer of correlated sources Message-ID: Dear all I have some questions about the use of DICS in the case of two correlated cortical activations. I am using an isometric contraction protocol and i localized the reference dipole through cortico-muscular coherence with external myography and (classic) DICS method. Now I have to calculate cortico-cortical activations and i use: cfg = []; cfg.grid = grid; cfg.method = 'dics'; cfg.projectnoise = 'yes'; cfg.lambda = 0; cfg.refdip = ref_dipole_position; cfg.frequency = 20; cfg.hdmfile = 'mymodel.hdm'; sourcecond = sourceanalysis(cfg, freq); According to Schoffelen et al. in order to disentangle the sources a modification of the classic DICS algorithm is necessary. Am i supposed to extract the two activations if they are correlated with the above written lines? If not, how would it be a FT implementation to get to correlated sources localization with DICS? I tried with simulation and apparently the above implemetation is able to localize only one source with a spread activation. Attachments show: '1sourceDICS.png' : simulation with an external reference channel correlated with a source in the left emisphere '2sourcesCCCDICS.png': simulation with reference dipole (same as above) whose activity is correlated to a simmetric one in the right emisphere Best Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: 1sourceDICS.png Type: image/png Size: 175531 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 2sourcesCCCDICS.png Type: image/png Size: 180189 bytes Desc: not available URL: From j.schoffelen at PSY.GLA.AC.UK Fri Aug 8 14:30:38 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Fri, 8 Aug 2008 14:30:38 +0200 Subject: Beamformer of correlated sources In-Reply-To: Message-ID: Dear Cristiano, Nice simulation in figure 1! The way you did the second simulation is just the 'traditional' DICS, giving you a huge mountain of coherence around the reference location. This will drown any other true cortico-cortical coherence to the right hemisphere dipole. (Note that a double dipole approach will not be of too much help here, if you do a ccc-analysis with respect to your reference: this is an important point in the paper you refer to. The double dipole approach will hopefully be able to unveil low coherence of the second dipole to the reference, which is masked by the high power + high coherence (one of these, or perhaps both) in the reference dipole.) As such, the double dipole approach is not yet implemented in a straightforward way in the release-version of fieldtrip, but I will be happy to give you some handles: I would suggest to include the leadfield of the reference location in the grid with precomputed leadfields which will be passed in the configuration to sourceanalysis. You have to concatenate the dipole-location specific leadfields with the reference dipole's leadfield. This will give you leadfields of dimensionality Nx6 (or Nx2 if you have a reason to assume a fixed orientation). Subsequently you can run sourceanalysis with cfg.keepfilter = 'yes' and without cfg.refdip, to extract the filter coefficients. These will have the dimensionality 6xN for each double dipole, the first 3 rows corresponding to the location specific location, and the last 3 rows corresponding to the reference dipole. To then compute your 'dipole pair and reference channel'-based cross- spectral density you have to sandwich the sensor-level cross-spectral density (take care to have the channel-order identical to the channel order in the filters) between the augmented filters. You can augment the filters to accommodate for the reference channel in the following way: [filter zeros(size(filter,1),1);zeros(1,size (filter,2)) 1]; (make sure to put the reference channel last in the channel csd. From each sandwiched csd (7x7) you should be able to extract anything you want. The top-left 6x6 block will contain the between dipole csd (diagonal 3x3 blocks contain the within dipole parameters from which power can be estimated: the off-diagonal blocks contain the between dipole csd). The bottom right value will contain the reference signal power, and the 6x1 and 1x6 remaining vectors contain the reference to dipole csds, in two groups of 3. The coherence can be estimated (according to Joachim's 2001 PNAS-paper) in this case by: svd( csd(1:3,7))./ sqrt(svd(csd(1:3,1:3)) *csd(7,7)); Good luck, Jan-Mathijs On Aug 8, 2008, at 2:05 PM, Cristiano Micheli wrote: > Dear all > I have some questions about the use of DICS in the case of two > correlated > cortical activations. > I am using an isometric contraction protocol and i localized the > reference > dipole through cortico-muscular coherence with external myography and > (classic) DICS method. Now I have to calculate cortico-cortical > activations > and i use: > > cfg = []; > cfg.grid = grid; > cfg.method = 'dics'; > cfg.projectnoise = 'yes'; > cfg.lambda = 0; > cfg.refdip = ref_dipole_position; > cfg.frequency = 20; > cfg.hdmfile = 'mymodel.hdm'; > sourcecond = sourceanalysis(cfg, freq); > > According to Schoffelen et al. in order to disentangle the sources a > modification of the classic DICS algorithm is necessary. > Am i supposed to extract the two activations if they are correlated > with the > above written lines? > If not, how would it be a FT implementation to get to correlated > sources > localization with DICS? > I tried with simulation and apparently the above implemetation is > able to > localize only one source with a spread activation. > Attachments show: > '1sourceDICS.png' : simulation with an external reference channel > correlated > with a source in the left emisphere > '2sourcesCCCDICS.png': simulation with reference dipole (same as > above) > whose activity is correlated to a simmetric one in the right emisphere > > Best > Cristiano > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/ > fieldtrip.<1sourceDICS.png><2sourcesCCCDICS.png> ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From venug001 at BAMA.UA.EDU Fri Aug 8 23:01:50 2008 From: venug001 at BAMA.UA.EDU (Gopakumar Venugopalan) Date: Fri, 8 Aug 2008 16:01:50 -0500 Subject: BIOMAG 2008 Message-ID: Hello are there folks here on their way to Biomag 2008 (Sapporo)? If so would you please email me. Thanks in advance. regards gopa ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From tony.w.wilson at GMAIL.COM Sat Aug 9 05:43:17 2008 From: tony.w.wilson at GMAIL.COM (Tony W. Wilson) Date: Fri, 8 Aug 2008 23:43:17 -0400 Subject: BIOMAG 2008 In-Reply-To: <1218229310.489cb43eecc84@bamamail.ua.edu> Message-ID: yeah, I am going to biomag On Fri, Aug 8, 2008 at 5:01 PM, Gopakumar Venugopalan wrote: > Hello are there folks here on their way to Biomag 2008 (Sapporo)? If so > would you please email me. Thanks in advance. > regards > gopa > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > -- _______________________________________________ Tony W. Wilson, Ph.D. Assistant Professor of Neurology Wake Forest University School of Medicine One Medical Center Blvd. Winston-Salem, NC 27157 (336) 716-5151 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From michelic72 at GMAIL.COM Sun Aug 10 17:29:18 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Sun, 10 Aug 2008 17:29:18 +0200 Subject: Beamformer of correlated sources Message-ID: Dear Jan-Mathijs I tried to implement the double dipole DICS but without success. I use a simulation with two correlated sources but I see only one in the power and two spread sources not where i expect them to be in the coherence. I performed the following step as suggested by you in the last email: 1) Calculation of cross spectral matrixes Cf (channel-channel), Cr (channel reference) and Power of the reference Pr for a specific frequency. 2) Concatenation of the local leadfield with one of the dipoles' leadfield for each point of the grid: lf = compute_leadfield(dip.pos(i,:), grad, vol, 'reducerank', reducerank, 'normalize', normalize); lf2 = compute_leadfield([0 5 10], grad, vol, 'reducerank', reducerank, 'normalize', normalize); lf = [lf lf2]; 3) Calculation of local spatial filter according to: filt = pinv(lf' * invCf * lf) * lf' * invCf; 4) Augmenting the filter according to: filt = [filt zeros(size(filt,1),1);zeros(1,size(filt,2)) 1]; 5) Augmenting the Cf by introducing the reference-channels csd and reference power: Cf_ = [Cf Cr;Cr' Pr]; 6) Sandwiching: csd = filt * Cf_ * ctranspose(filt); 7) Calculating power and coherence: pow = real(trace(csd(1:6,1:6))); coh = lambda1( csd(1:3,7))./ sqrt(lambda1(csd(1:3,1:3))*csd(7,7)); Where do i fail? Is there something I do not understand? According to this scheme the power of point 7 should take into account both dipoles and the coherence should not be masked by the chosen dipole. Regards Cristiano On Fri, 8 Aug 2008 14:30:38 +0200, jan-mathijs schoffelen wrote: >Dear Cristiano, > >Nice simulation in figure 1! >The way you did the second simulation is just the 'traditional' DICS, >giving you a huge mountain of coherence around the reference location. >This will drown any other true cortico-cortical coherence to the >right hemisphere dipole. (Note that a double dipole approach will not >be of too >much help here, if you do a ccc-analysis with respect to your >reference: this is an important point in the paper you refer to. The >double dipole approach >will hopefully be able to unveil low coherence of the second dipole >to the reference, which is masked by the high power + high coherence >(one of these, >or perhaps both) in the reference dipole.) > >As such, the double dipole approach is not yet implemented in a >straightforward way in the release-version of fieldtrip, but I will >be happy to give you some handles: > >I would suggest to include the leadfield of the reference location in >the grid with precomputed leadfields which will be passed in the >configuration to sourceanalysis. >You have to concatenate the dipole-location specific leadfields with >the reference dipole's leadfield. This will give you leadfields of >dimensionality Nx6 (or Nx2 if you >have a reason to assume a fixed orientation). >Subsequently you can run sourceanalysis with cfg.keepfilter = 'yes' >and without cfg.refdip, to extract the filter coefficients. These >will have the dimensionality 6xN for each >double dipole, the first 3 rows corresponding to the location >specific location, and the last 3 rows corresponding to the reference >dipole. >To then compute your 'dipole pair and reference channel'-based cross- >spectral density you have to sandwich the sensor-level cross-spectral >density (take care to have >the channel-order identical to the channel order in the filters) >between the augmented filters. You can augment the filters to >accommodate for the reference channel in >the following way: [filter zeros(size(filter,1),1);zeros(1,size >(filter,2)) 1]; (make sure to put the reference channel last in the >channel csd. > From each sandwiched csd (7x7) you should be able to extract >anything you want. The top-left 6x6 block will contain the between >dipole csd (diagonal 3x3 blocks contain >the within dipole parameters from which power can be estimated: the >off-diagonal blocks contain the between dipole csd). The bottom right >value will contain the reference >signal power, and the 6x1 and 1x6 remaining vectors contain the >reference to dipole csds, in two groups of 3. The coherence can be >estimated (according to Joachim's 2001 >PNAS-paper) in this case by: svd( csd(1:3,7))./ sqrt(svd(csd(1:3,1:3)) >*csd(7,7)); > >Good luck, > >Jan-Mathijs > > > > > >On Aug 8, 2008, at 2:05 PM, Cristiano Micheli wrote: > >> Dear all >> I have some questions about the use of DICS in the case of two >> correlated >> cortical activations. >> I am using an isometric contraction protocol and i localized the >> reference >> dipole through cortico-muscular coherence with external myography and >> (classic) DICS method. Now I have to calculate cortico-cortical >> activations >> and i use: >> >> cfg = []; >> cfg.grid = grid; >> cfg.method = 'dics'; >> cfg.projectnoise = 'yes'; >> cfg.lambda = 0; >> cfg.refdip = ref_dipole_position; >> cfg.frequency = 20; >> cfg.hdmfile = 'mymodel.hdm'; >> sourcecond = sourceanalysis(cfg, freq); >> >> According to Schoffelen et al. in order to disentangle the sources a >> modification of the classic DICS algorithm is necessary. >> Am i supposed to extract the two activations if they are correlated >> with the >> above written lines? >> If not, how would it be a FT implementation to get to correlated >> sources >> localization with DICS? >> I tried with simulation and apparently the above implemetation is >> able to >> localize only one source with a spread activation. >> Attachments show: >> '1sourceDICS.png' : simulation with an external reference channel >> correlated >> with a source in the left emisphere >> '2sourcesCCCDICS.png': simulation with reference dipole (same as >> above) >> whose activity is correlated to a simmetric one in the right emisphere >> >> Best >> Cristiano >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ >> archives/fieldtrip.html and http://www.ru.nl/fcdonders/ >> fieldtrip.<1sourceDICS.png><2sourcesCCCDICS.png> > >---------------------------------- >The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Mon Aug 11 10:13:30 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 11 Aug 2008 10:13:30 +0200 Subject: BIOMAG 2008 In-Reply-To: <1218229310.489cb43eecc84@bamamail.ua.edu> Message-ID: Hi Gopakumar I will also go to the BIOMAG conference in Saporro. See you there, Robert On 8 Aug 2008, at 23:01, Gopakumar Venugopalan wrote: > Hello are there folks here on their way to Biomag 2008 (Sapporo)? > If so > would you please email me. Thanks in advance. > regards > gopa > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From dsenkows at UKE.DE Wed Aug 13 12:19:40 2008 From: dsenkows at UKE.DE (Daniel Senkowski) Date: Wed, 13 Aug 2008 12:19:40 +0200 Subject: channelselection.m Message-ID: Dear all, using data from a CTF 275 channel system, I am facing some minor issues with the current channelselection.m script (see error message below). I am therefore still using an older version of the channelselection.m script but would be interested if anyone else had a similar problem and possibly solved it. Regards, Daniel Senkowski -------- Here is the error message: Multitaper: PVh Subject: vp03... the input is raw data with 274 channels and 124 trials ??? Undefined function or method 'senstype' for input arguments of type 'cell'. Error in ==> channelselection at 104 isctf = senstype(datachannel, 'ctf'); Error in ==> freqanalysis_mtmconvol at 277 cfg.channel = channelselection(cfg.channel, data.label); Error in ==> freqanalysis at 200 [freq] = feval(sprintf('freqanalysis_%s',lower(cfg.method)), cfg, data); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Wed Aug 13 13:50:23 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 13 Aug 2008 13:50:23 +0200 Subject: channelselection.m In-Reply-To: Message-ID: Hi Daniel On 13 Aug 2008, at 12:19, Daniel Senkowski wrote: > using data from a CTF 275 channel system, I am facing some minor > issues with > the current channelselection.m script (see error message below). I am > therefore still using an older version of the channelselection.m > script but > would be interested if anyone else had a similar problem and > possibly solved it. > ... > Here is the error message: > > Multitaper: PVh Subject: vp03... > the input is raw data with 274 channels and 124 trials > ??? Undefined function or method 'senstype' for input arguments of > type 'cell'. > > Error in ==> channelselection at 104 > isctf = senstype(datachannel, 'ctf'); There should be a function senstype (fieldtrip/private/senstype.m) which is used here and which in your case cannot be found. As far as I can tell, that function is included in the ftp release. Please search for the senstype function in your fieldtrip directory. best regards, Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Thu Aug 14 12:11:17 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Thu, 14 Aug 2008 12:11:17 +0200 Subject: DICS power Message-ID: Hi All I have a problem with DICS's power and my simulations. I simulate an external virtual channel coupled with MEG activity in a specific frequency band (around 20 Hz). I use DICS and submethod 'ref_chan' and i can localize 1 source (even 2 if they are distant) but only if I use coherence as a functional parameter and reducerank=2. With power i always see a bright spot in the middle of the brain. Should i select some options to account for decreased sensors' sensibility in depth? Since I used anyway coherence parameter for localization I did not pay attention to this before but somehow it looks strange to me. I attach the code and power image. Regards cfg = []; cfg.grid = grid_; cfg.method = 'dics'; cfg.projectnoise = 'yes'; cfg.reducerank = 2; cfg.lambda = 0; cfg.refchan = refch; cfg.frequency = 20; cfg.hdmfile = 'myheadmodel.hdm'; sourcecond = sourceanalysis(cfg, freqcond); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: power.png Type: image/png Size: 157338 bytes Desc: not available URL: From j.schoffelen at PSY.GLA.AC.UK Thu Aug 14 12:18:43 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Thu, 14 Aug 2008 12:18:43 +0200 Subject: DICS power In-Reply-To: Message-ID: Dear Cristiano, This issue is covered in the 'applying beamforming techniques in the frequency domain'-tutorial on the fieldtrip-website. This is perfectly normal behaviour of the beamformer, when you use non-normalized leadfields (which I would do in the first place). In order to make sense out of the power-images you can do two things: -plot the power relative to another 'condition' (this is explained in the tutorial) -compute the 'neural-activity-index' (this is also explained in the tutorial) Please have a look there, it might already clear things up for you. Yours, Jan-Mathijs On Aug 14, 2008, at 12:11 PM, Cristiano Micheli wrote: > Hi All > I have a problem with DICS's power and my simulations. I simulate an > external virtual channel coupled with MEG activity in a specific > frequency > band (around 20 Hz). > I use DICS and submethod 'ref_chan' and i can localize 1 source > (even 2 if > they are distant) but only if I use coherence as a functional > parameter and > reducerank=2. > With power i always see a bright spot in the middle of the brain. > Should i select some options to account for decreased sensors' > sensibility > in depth? > Since I used anyway coherence parameter for localization I did not pay > attention to this before but somehow it looks strange to me. > I attach the code and power image. > Regards > > cfg = []; > cfg.grid = grid_; > cfg.method = 'dics'; > cfg.projectnoise = 'yes'; > cfg.reducerank = 2; > cfg.lambda = 0; > cfg.refchan = refch; > cfg.frequency = 20; > cfg.hdmfile = 'myheadmodel.hdm'; > sourcecond = sourceanalysis(cfg, freqcond); > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/ > fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From djs32 at BUFFALO.EDU Thu Aug 14 13:15:23 2008 From: djs32 at BUFFALO.EDU (Daniel Stolzberg) Date: Thu, 14 Aug 2008 13:15:23 +0200 Subject: Tucker-Davis Technologies and PLX Message-ID: Hello, I have acquired multichannel continuous data using Tucker-Davis Technologies (TDT) equipment and the OpenEx software. I have been unable to directly import the TDT 'tanks' into fieldtrip so I created a very roundabout way by first using the OpenEx software to export the data to a comma separated values (csv) file format and then import it into Matlab using a script. This is time consuming and limiting. Does anyone have more detailed information on how TDT formats their data tanks? TDT support was not very helpful with this issue (although they are usually helpful). TDT's OpenEx software also allows one to export to PLX data format. I have been unable to open PLX files with FieldTrip because the function 'read_plexon_plx' does not exist. Does anyone have information on this function? Thank you! -Dan ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From alexander.roth at MED.UNI-HEIDELBERG.DE Fri Aug 15 10:02:05 2008 From: alexander.roth at MED.UNI-HEIDELBERG.DE (Alexander Roth) Date: Fri, 15 Aug 2008 10:02:05 +0200 Subject: Bug? Message-ID: I downloaded the latest version of fieldtrip (fieldtrip-20080814) this morning. I tried to create a headmodel via: cfg=[]; cfg.headshape='LTM_VP011_pic.sfp' [vol]=prepare_singleshell(cfg); An error occured: ??? Undefined function or method 'read_headshape' for input arguments of type 'char'. Error in ==> prepare_singleshell at 164 shape = read_headshape(cfg.headshape); There's a note in the changelog saying that from now on the function 'read_headshape()' should be used to read head model data. However, it seems that this file isn't included in the fieldtrip package. Best, Alex ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Fri Aug 15 11:10:18 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Fri, 15 Aug 2008 11:10:18 +0200 Subject: Bug? In-Reply-To: Message-ID: Dear Alex, Thanks for the quick bug report. I added read_headshape to the release version. It will be available tonight. Yours, Jan-Mathijs On Aug 15, 2008, at 10:02 AM, Alexander Roth wrote: > I downloaded the latest version of fieldtrip (fieldtrip-20080814) this > morning. I tried to create a headmodel via: > > cfg=[]; > cfg.headshape='LTM_VP011_pic.sfp' > [vol]=prepare_singleshell(cfg); > > An error occured: > > ??? Undefined function or method 'read_headshape' for input > arguments of > type 'char'. > > Error in ==> prepare_singleshell at 164 > shape = read_headshape(cfg.headshape); > > There's a note in the changelog saying that from now on the function > 'read_headshape()' should be used to read head model data. However, > it seems > that this file isn't included in the fieldtrip package. > > Best, > > Alex > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Fri Aug 15 15:08:29 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Fri, 15 Aug 2008 15:08:29 +0200 Subject: Beamformer of correlated sources Message-ID: About your last email: On Fri, 8 Aug 2008 14:30:38 +0200, jan-mathijs schoffelen wrote: >Dear Cristiano, > >Nice simulation in figure 1! >The way you did the second simulation is just the 'traditional' DICS, >giving you a huge mountain of coherence around the reference location. >This will drown any other true cortico-cortical coherence to the >right hemisphere dipole. (Note that a double dipole approach will not >be of too >much help here, if you do a ccc-analysis with respect to your >reference: this is an important point in the paper you refer to. The >double dipole approach >will hopefully be able to unveil low coherence of the second dipole >to the reference, which is masked by the high power + high coherence >(one of these, >or perhaps both) in the reference dipole.) > >As such, the double dipole approach is not yet implemented in a >straightforward way in the release-version of fieldtrip, but I will >be happy to give you some handles: > >I would suggest to include the leadfield of the reference location in >the grid with precomputed leadfields which will be passed in the >configuration to sourceanalysis. >You have to concatenate the dipole-location specific leadfields with >the reference dipole's leadfield. This will give you leadfields of >dimensionality Nx6 (or Nx2 if you >have a reason to assume a fixed orientation). >Subsequently you can run sourceanalysis with cfg.keepfilter = 'yes' >and without cfg.refdip, to extract the filter coefficients. These >will have the dimensionality 6xN for each >double dipole, the first 3 rows corresponding to the location >specific location, and the last 3 rows corresponding to the reference >dipole. I created a file named 'my_prepare_leadfield.m' and i concatenated the lead field as written (line 235): % grid.leadfield{dipindx} = lf; %old %%%%%%%%%%%%%%%%%%% new lf2 = compute_leadfield([0 5 10], sens, vol, 'reducerank', cfg.reducerank, 'normalize', cfg.normalize,'normalizeparam',cfg.normalizeparam); grid.leadfield{dipindx} = [lf lf2]; %%%%%%%%%%%%%%%%%%% new Then I run the DICS with the following settings as you adviced: cfg = []; cfg.grid = grid_; cfg.method = 'dics'; cfg.projectnoise = 'yes'; cfg.reducerank = 2; cfg.lambda = 0; cfg.refchan = refch; cfg.frequency = 20; cfg.hdmfile = 'mymodel.hdm'; cfg.keepfilter= 'yes'; sourcecond = sourceanalysis(cfg, freqcond); >To then compute your 'dipole pair and reference channel'-based cross- >spectral density you have to sandwich the sensor-level cross-spectral >density (take care to have >the channel-order identical to the channel order in the filters) >between the augmented filters. You can augment the filters to >accommodate for the reference channel in >the following way: [filter zeros(size(filter,1),1);zeros(1,size >(filter,2)) 1]; (make sure to put the reference channel last in the >channel csd. Before doing it I think I will have to include Cf and Cr and Pr in the same matrix, but i am not sure. Namely: csd = filter * Cf_ * ctranspose(filter) with filt of dimensions 6X(N+1) channels after augmenting, and Cf_ made of the contributions of MEG channel-channels cross-variance plus the contribution of MEG-EMG channels crossvariance Cr (column vector): Cf_ = [Cf,Cr;Cr' Pr]; > From each sandwiched csd (7x7) you should be able to extract >anything you want. The top-left 6x6 block will contain the between >dipole csd (diagonal 3x3 blocks contain >the within dipole parameters from which power can be estimated: the >off-diagonal blocks contain the between dipole csd). The bottom right >value will contain the reference >signal power, and the 6x1 and 1x6 remaining vectors contain the >reference to dipole csds, in two groups of 3. The coherence can be >estimated (according to Joachim's 2001 >PNAS-paper) in this case by: svd( csd(1:3,7))./ sqrt(svd(csd(1:3,1:3)) >*csd(7,7)); > >Good luck, > >Jan-Mathijs This makes sense to me, considering also the literature (Dalal et al. 2006, Brookes et al. 2007), but I weight equally the contributions of two correlated dipoles, which can also have different amplitudes. This is why maybe my simulations are not able to attenuate the main dipole? Best Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Fri Aug 15 15:27:47 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Fri, 15 Aug 2008 15:27:47 +0200 Subject: Beamformer of correlated sources In-Reply-To: Message-ID: Dear Cristiano, What do you exactly mean by 'not able to attenuate the main dipole'? Do you mean attenuation of power, or of coherence? The purpose of using several dipoles in your source model (be it one location fixed and the other moving, or a symmetric dipole pair, or whatever) before computing the beamformer weights will not lead to attenuation. The underlying idea of allowing the two locations in the spatial pass- band, is to prevent the 'main dipole' from distorting the reconstructed signal. Distortion of the reconstructed signal at the second location of interest, will critically affect the cross- spectral density with the reference signal, and thus the reconstructed coherence. Importantly, the double dipole approach does still not take the problem of filter leakage away and therefore will generally not lead to a clear ccc-map. There will still be a 'dome' of coherence around the reference location, unless you have a well- specified condition to be able to compute a contrast (although this poses problems in itself, because differences in estimated power lead to different shapes of the 'domes'). As a remark on the side, recent work I did in this direction actually made me realize that the absolute value of the simulated coherence between a target dipole pair can be estimated quite accurately with a beamformer (given appropriate snr, leadfield correlations etc), but problems arise from the fact that other regions in the brain will show even higher values of correlation. I realize I did not provide any answers here but hopefully some food for thought. Yours, Jan-Mathijs On Aug 15, 2008, at 3:08 PM, Cristiano Micheli wrote: > About your last email: > > On Fri, 8 Aug 2008 14:30:38 +0200, jan-mathijs schoffelen > wrote: > >> Dear Cristiano, >> >> Nice simulation in figure 1! >> The way you did the second simulation is just the 'traditional' DICS, >> giving you a huge mountain of coherence around the reference >> location. >> This will drown any other true cortico-cortical coherence to the >> right hemisphere dipole. (Note that a double dipole approach will not >> be of too >> much help here, if you do a ccc-analysis with respect to your >> reference: this is an important point in the paper you refer to. The >> double dipole approach >> will hopefully be able to unveil low coherence of the second dipole >> to the reference, which is masked by the high power + high coherence >> (one of these, >> or perhaps both) in the reference dipole.) >> >> As such, the double dipole approach is not yet implemented in a >> straightforward way in the release-version of fieldtrip, but I will >> be happy to give you some handles: >> >> I would suggest to include the leadfield of the reference location in >> the grid with precomputed leadfields which will be passed in the >> configuration to sourceanalysis. >> You have to concatenate the dipole-location specific leadfields with >> the reference dipole's leadfield. This will give you leadfields of >> dimensionality Nx6 (or Nx2 if you >> have a reason to assume a fixed orientation). >> Subsequently you can run sourceanalysis with cfg.keepfilter = 'yes' >> and without cfg.refdip, to extract the filter coefficients. These >> will have the dimensionality 6xN for each >> double dipole, the first 3 rows corresponding to the location >> specific location, and the last 3 rows corresponding to the reference >> dipole. > > I created a file named 'my_prepare_leadfield.m' and i > concatenated the > lead field as written (line 235): > > % grid.leadfield{dipindx} = lf; %old > %%%%%%%%%%%%%%%%%%% new > lf2 = compute_leadfield([0 5 10], sens, vol, 'reducerank', > cfg.reducerank, > 'normalize', cfg.normalize,'normalizeparam',cfg.normalizeparam); > grid.leadfield{dipindx} = [lf lf2]; > %%%%%%%%%%%%%%%%%%% new > > Then I run the DICS with the following settings as you adviced: > > cfg = []; > cfg.grid = grid_; > cfg.method = 'dics'; > cfg.projectnoise = 'yes'; > cfg.reducerank = 2; > cfg.lambda = 0; > cfg.refchan = refch; > cfg.frequency = 20; > cfg.hdmfile = 'mymodel.hdm'; > cfg.keepfilter= 'yes'; > sourcecond = sourceanalysis(cfg, freqcond); > >> To then compute your 'dipole pair and reference channel'-based cross- >> spectral density you have to sandwich the sensor-level cross-spectral >> density (take care to have >> the channel-order identical to the channel order in the filters) >> between the augmented filters. You can augment the filters to >> accommodate for the reference channel in >> the following way: [filter zeros(size(filter,1),1);zeros(1,size >> (filter,2)) 1]; (make sure to put the reference channel last in the >> channel csd. > > Before doing it I think I will have to include Cf and Cr and Pr in > the same > matrix, but i am not sure. > Namely: csd = filter * Cf_ * ctranspose(filter) > with filt of dimensions 6X(N+1) channels after augmenting, and Cf_ > made of > the contributions of MEG channel-channels cross-variance plus the > contribution of MEG-EMG channels crossvariance Cr (column vector): > > Cf_ = [Cf,Cr;Cr' Pr]; > >> From each sandwiched csd (7x7) you should be able to extract >> anything you want. The top-left 6x6 block will contain the between >> dipole csd (diagonal 3x3 blocks contain >> the within dipole parameters from which power can be estimated: the >> off-diagonal blocks contain the between dipole csd). The bottom right >> value will contain the reference >> signal power, and the 6x1 and 1x6 remaining vectors contain the >> reference to dipole csds, in two groups of 3. The coherence can be >> estimated (according to Joachim's 2001 >> PNAS-paper) in this case by: svd( csd(1:3,7))./ sqrt(svd(csd >> (1:3,1:3)) >> *csd(7,7)); >> >> Good luck, >> >> Jan-Mathijs > > This makes sense to me, considering also the literature (Dalal et > al. 2006, > Brookes et al. 2007), but I weight equally the contributions of two > correlated dipoles, which can also have different amplitudes. > This is why maybe my simulations are not able to attenuate the main > dipole? > Best > > > Cristiano > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From thomas.hartmann at UNI-KONSTANZ.DE Fri Aug 15 16:42:32 2008 From: thomas.hartmann at UNI-KONSTANZ.DE (Thomas Hartmann) Date: Fri, 15 Aug 2008 16:42:32 +0200 Subject: reject components with less components than channels in matrix Message-ID: hi y'all! i am trying to use the ica to correct my data for artifacts. as i do an average-reference on the data prior to calculating the weights using fastica, only 63 components are computed from my 64 channels. if i then try to run componentanalysis on the real data using the former calculated weights, componentanalysis gives an error because the function expects as many components as channels in the input. i fixed this in the file. but rejectcomponent also seems to expect as many components as channels, as it tells me that it e.g. removed 2 components and kept 62, although there are only 63 components in the matrix. any help? cheers and thanks, thomas ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From enteka at HOTMAIL.COM Fri Aug 15 17:22:24 2008 From: enteka at HOTMAIL.COM (Nicolas Robitaille) Date: Fri, 15 Aug 2008 15:22:24 +0000 Subject: reject components with less components than channels in matrix In-Reply-To: <48A595D8.6080706@uni-konstanz.de> Message-ID: Hi Thomas I ran into the same kind of problem running PCA reduction in binica. I end up with an unstable workaround, so I won't send it, but you may like to know that: 1- in rejectcomponent.m, the number of component is determine by the length of the comp.label list, which is created in componentanalysis.m. [line 75 of rejectcomponent.m] % determine the number of channels and the number of components Nchan = length(comp.topolabel); Ncomp = length(comp.label); I needed to fix the creation of this list, I guess you may have to. 2- In order to actually do the rejection, I created an empty square matrix (full of 0) and stick in it the components to-be-kept.: [line 99 of rejectcomponent.m] comp.topo(:,cfg.component) = 0; w = zeros(Nchan,Nchan); w(:,1:Ncomp) = comp.topo; for ii=1:ntrials data.trial(ii,:,:) = w * squeeze(data.trial(ii,:,:)); end Hope this help Nic ************************************ Nicolas Robitaille, candidat Ph.D Département de Psychologie Université de Montréal C.P. 6128, succursale Centre-ville Montréal, Québec H3C 3J7 Tel.: 514-343-6111 x2631 Fax: 514-343-5787 ************************************ > Date: Fri, 15 Aug 2008 16:42:32 +0200 > From: thomas.hartmann at UNI-KONSTANZ.DE > Subject: [FIELDTRIP] reject components with less components than channels in matrix > To: FIELDTRIP at NIC.SURFNET.NL > > hi y'all! > > i am trying to use the ica to correct my data for artifacts. as i do an > average-reference on the data prior to calculating the weights using > fastica, only 63 components are computed from my 64 channels. > > if i then try to run componentanalysis on the real data using the former > calculated weights, componentanalysis gives an error because the > function expects as many components as channels in the input. > > i fixed this in the file. but rejectcomponent also seems to expect as > many components as channels, as it tells me that it e.g. removed 2 > components and kept 62, although there are only 63 components in the matrix. > > any help? > > cheers and thanks, > thomas > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. _________________________________________________________________ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From amrgermany at YAHOO.COM Sat Aug 16 12:02:20 2008 From: amrgermany at YAHOO.COM (A. Ayoub) Date: Sat, 16 Aug 2008 12:02:20 +0200 Subject: Fieldtrip-0.9.7 Mapping CTF151 Message-ID: Hello, I am trying to map CTF151 MEG data using the electrode position option. The result is rotated 90 degrees clock wise with respect to the nose. The rotation was confirmed by plotting the layout. It looks something went wrong in stereographic projection. Is there a way around this bug? Best regards, Amr PS: I have used topoplotER.m which intern calls createlayout.m ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From dsenkows at UKE.DE Mon Aug 18 13:36:17 2008 From: dsenkows at UKE.DE (Daniel Senkowski) Date: Mon, 18 Aug 2008 13:36:17 +0200 Subject: setfield issue and sourcestatistics Message-ID: Hi, I am trying to run the sourcestatistic.m script on the ouput files from sourcegrandaverage.m and receive an error message with refers to the setfield and setsubfield scripts. Did anyone had similar issues or has an idea how to solve it? Thank you very much and best greetings, Daniel >> test test = pos: [11466x3 double] dim: [21 26 21] transform: [4x4 double] avg: [1x1 struct] var: [1x1 struct] dimord: 'voxel' trial: [1x16 struct] inside: [5759x1 double] outside: [5707x1 double] df: [11466x1 double] cfg: [1x1 struct] >> test.trial ans = 1x16 struct array with fields: pow >> test2 test2 = pos: [11466x3 double] dim: [21 26 21] transform: [4x4 double] avg: [1x1 struct] var: [1x1 struct] dimord: 'voxel' trial: [1x16 struct] inside: [5759x1 double] outside: [5707x1 double] df: [11466x1 double] cfg: [1x1 struct] >> cfg = []; cfg.method = 'parametric'; cfg.statistic = 'difference'; cfg.parameter = 'pow'; cfg.bonferoni = 'no'; cfg.threshold = 0.05; stat = sourcestatistics(cfg, test, test2); ??? Error using ==> setfield at 58 Insufficient outputs from right hand side to satisfy comma separated list expansion on left hand side. Missing [] are the most likely cause. Error in ==> setsubfield at 33 s = setfield(s, t{:}, v); Error in ==> checkdata at 403 data = setsubfield(data, param{i}, tmp); Error in ==> sourcestatistics at 113 varargin{i} = checkdata(varargin{i}, 'datatype', {'source', 'volume'}, 'feedback', 'no', 'inside', 'index'); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Wed Aug 20 21:03:40 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Wed, 20 Aug 2008 21:03:40 +0200 Subject: setfield issue and sourcestatistics In-Reply-To: Message-ID: Dear Daniel, The problem was hard to track down, but I noticed that an easy workaround can be achieved, when you remove the .transform field from your grandaveraged source (test = rmfield(test, 'transform'); Alternatively, you can download the latest version of fieldtrip (available as of tomorrow) in which I (hopefully) fixed the problem. Yours, JM PS: Robert, maybe we could discuss this issue, because this is due to recent changes which were made to make the difference between volumetric and source-metric data more explicit. On Aug 18, 2008, at 1:36 PM, Daniel Senkowski wrote: > Hi, > > I am trying to run the sourcestatistic.m script on the ouput files > from > sourcegrandaverage.m and receive an error message with refers to the > setfield and setsubfield scripts. > > Did anyone had similar issues or has an idea how to solve it? > > Thank you very much and best greetings, > > Daniel > > > >>> test > > test = > > pos: [11466x3 double] > dim: [21 26 21] > transform: [4x4 double] > avg: [1x1 struct] > var: [1x1 struct] > dimord: 'voxel' > trial: [1x16 struct] > inside: [5759x1 double] > outside: [5707x1 double] > df: [11466x1 double] > cfg: [1x1 struct] > >>> test.trial > > ans = > > 1x16 struct array with fields: > pow > > >>> test2 > > test2 = > > pos: [11466x3 double] > dim: [21 26 21] > transform: [4x4 double] > avg: [1x1 struct] > var: [1x1 struct] > dimord: 'voxel' > trial: [1x16 struct] > inside: [5759x1 double] > outside: [5707x1 double] > df: [11466x1 double] > cfg: [1x1 struct] > >>> cfg = []; > cfg.method = 'parametric'; > cfg.statistic = 'difference'; > cfg.parameter = 'pow'; > cfg.bonferoni = 'no'; > cfg.threshold = 0.05; > > stat = sourcestatistics(cfg, test, test2); > ??? Error using ==> setfield at 58 > Insufficient outputs from right hand side to satisfy comma separated > list expansion on left hand side. Missing [] are the most likely > cause. > > Error in ==> setsubfield at 33 > s = setfield(s, t{:}, v); > > Error in ==> checkdata at 403 > data = setsubfield(data, param{i}, tmp); > > Error in ==> sourcestatistics at 113 > varargin{i} = checkdata(varargin{i}, 'datatype', {'source', > 'volume'}, > 'feedback', 'no', 'inside', 'index'); > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From alihena_ at HOTMAIL.COM Wed Aug 27 15:40:31 2008 From: alihena_ at HOTMAIL.COM (A. Rodrigo) Date: Wed, 27 Aug 2008 15:40:31 +0200 Subject: Problems with volumesegment Message-ID: Hi, When I run >> mri = read_fcdc_mri('Subject01.mri'); cfg = []; cfg.write = 'no'; cfg.coordinates = 'ctf'; [segmentedmri] = volumesegment(cfg, mri); The error message is : ??? Error using ==> spm_create_vol>create_vol "dim" field is the wrong size (1 4). Error in ==> spm_create_vol at 16 v = create_vol(V(i)); Error in ==> fieldtrip-20080511\private\volumewrite_spm at 61 Va = spm_create_vol(Va); Error in ==> volumesegment at 226 Va = volumewrite_spm([cfg.name,'.img'], mri.anatomy, mri.transform); Can you help me? Thanks a lot. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From K.Nazarpour at BHAM.AC.UK Wed Aug 27 17:21:20 2008 From: K.Nazarpour at BHAM.AC.UK (Kianoush Nazarpour) Date: Wed, 27 Aug 2008 16:21:20 +0100 Subject: Problems with volumesegment In-Reply-To: Message-ID: Hello there, This problem is so strange. Basically, as I understood all depends on your Matlab Version and SPM. I used 5 different versions of Matlab to get it work. The easiest solution sould be using MATLAB Version 7.2.0.232 (R2006a) along with the original SPM2 (without using the SPM2_updates files). Hope that helps, Kia ------------------------------------- Kianoush Nazarpour Research Fellow Behavioural Brain Sciences School of Psychology, University of Birmingham, Birmingham B15 2TT UK Tel: +44 121 414 7201 Email: K.Nazarpour at bham.ac.uk Web: http://prism.bham.ac.uk/~nazarpok A. Rodrigo wrote: > Hi, > > When I run >>> mri = read_fcdc_mri('Subject01.mri'); > cfg = []; > cfg.write = 'no'; > cfg.coordinates = 'ctf'; > [segmentedmri] = volumesegment(cfg, mri); > > The error message is : > > ??? Error using ==> spm_create_vol>create_vol > "dim" field is the wrong size (1 4). > > Error in ==> spm_create_vol at 16 > v = create_vol(V(i)); > > Error in ==> fieldtrip-20080511\private\volumewrite_spm at 61 > Va = spm_create_vol(Va); > > Error in ==> volumesegment at 226 > Va = volumewrite_spm([cfg.name,'.img'], mri.anatomy, mri.transform); > > > > Can you help me? Thanks a lot. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From dsenkows at UKE.DE Wed Aug 27 17:43:44 2008 From: dsenkows at UKE.DE (Daniel Senkowski) Date: Wed, 27 Aug 2008 17:43:44 +0200 Subject: topoplotER and timelockstatistics output Message-ID: Dear all, I am receiving a "Index exceeds matrix dimensions" error message when trying to plot the output (e.g., stat.mask) of the cluster-based non-parametric statistic and the very last value of the stat.mask is a "1". Temporarily, this problem could be solved when setting the last value to "0" (e.g., stat.mask(274) = 0). Regards, Daniel >> cfg = []; cfg.style = 'blank'; cfg.layout = '/home/senk/PROGRAMS/fieldtrip-20080826/CTF274.lay'; cfg.highlight = find(stat.mask); cfg.comment = 'no'; figure; topoplotER(cfg, GA19_ERF_P) title('Nonparametric: significant with cluster multiple comparison correction') reading layout from file /home/senk/PROGRAMS/fieldtrip-20080826/CTF274.lay ??? Index exceeds matrix dimensions. Error in ==> topoplot at 549 hp2 = plot(y(cfg.highlight), x(cfg.highlight), cfg.hlmarker, 'Color', cfg.hlcolor, 'markersize', cfg.hlmarkersize, ... Error in ==> topoplotER at 371 topoplot(tmpcfg,chanX,chanY,datavector,chanLabels); >> stat stat = prob: [274x1 double] posclusters: [1x2 struct] posclusterslabelmat: [274x1 double] posdistribution: [1x100 double] negclusters: [] negclusterslabelmat: [274x1 double] negdistribution: [1x100 double] mask: [274x1 logical] stat: [274x1 double] dimord: 'chan' label: {274x1 cell} cfg: [1x1 struct] >> stat.mask(274) = 0; ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From wibral at BIC.UNI-FRANKFURT.DE Fri Aug 1 10:00:01 2008 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Fri, 1 Aug 2008 10:00:01 +0200 Subject: Logical problem with CTF 3rd order gra diometers correction Message-ID: Dear Robert, thank you very much for your answer. What I tried to do is invoke reject artefact after denoise_synthetic so that it works on the already denoised data (which is of course useless as it reads the data anew as I see now) . The aim of this procedure was to keep more trials. Is there any way to achieve this? The only thing I can think of right now is to run 3rd grads in the CTF software, save these data, then read them in with the new functions (Fieldtrip should know then that data are already in 3rd grad, shouldn't it?) and proceed as usual (i.e. run rejectartefact + preprocessing). Best Regards, Michael > -----Ursprüngliche Nachricht----- > Von: "Robert Oostenveld" > Gesendet: 31.07.08 23:01:00 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] Logical problem with CTF 3rd order gradiometers correction > Hi Michael > > On 31 Jul 2008, at 18:11, Michael Wibral wrote: > > Dear listusers, > > I have a logical problem with denoise-synthetic. > > > > here's what I want to do: > > > > 1. use definetrial to make cfg.trl (works fine) > > 2. use preprocessing with the new cfg. headerfile='ctf_new' , > > cfg.datafile='ctf_new' options to read the reference gradiometer > > information and the data into a fieldtrip structure (works fine) > > 3. use denoise_synthetic to denoise the data (works fine ?) > > In the (sofar limited) experiences that I heard there are noticeable > differences mainly on the central/vertex sensors (which are also the > closest to the reference sensors). > > > 4. un artefact detection on these data (-> this works fine and > > updates cfg.trl) > > after artifact_xxx and rejectartifact you should read the data using > preprocessing. Or are you using rejectvisual? If so, then you don't > have to call preprocessing a second time, because the output of > rejectvisual is again your data with the bad trials removed. > > > 5. run preprocessing a second time for filtering and actually > > applying the results of artefact corrcetion,... i.e. those things > > that I didn't want to do before denoise_synthetic. > > After rejectartifact, you should be calling it here like preprocessing > (cfg), and not with a second input argument. > > If you call it like preprocessing(cfg, data), then the cfg should not > contain cfg.dataset and cfg.trl but only filtering options, because > the data should not be read from file. > > > BUT preprocessing complains that cfg shouldn't contain the cfg.trl > > field when no data are read - which is the case because I am > > invoking preprocessing a second time here on an existing fieldtrip > > structure. > > I suspect that you are mixing up rejectartifact and preprocessing. > Calling preprocessing with a 2nd data input argument is only meant to > apply another set of filters on that data (i.e. if you forgot to do > it in the first run, or if you sequentially want to bandstopfilter > some line noise or CRT artifacts). > > > Therefore all information from artefact rejection is lost. > > > > Somehow it seems that I can run denoise_synthetic only after > > artefact rejection, because I need a fieldtrip dataset to run it, > > but NO dataset for preprocessing to perform artefact correction, > > i.e. accept cfg.trl. This would be a pity. > > I must say that I had not considered sofar the interaction between > denoising and artifact detectoin and removal. The artfifact_xxx > functions perform detection on data from disk(*), i.e. prior to > reading the data into memory. The historical reason for (*) is to > save on memory when a lot of filter padding is used and when there is > a lot of overlap between padded trials. The padded regions should be > checked for artifacts (esp jump artifacts which cause a lot of filter > rinning), but in the end we don't need them in memory. The denoising > only happens after the data is read into memory. > > > Any suggestion how to solve this? > > For the moment I suggest to use the following sequence > > definetrial > preprocessing > denoise_synthetic > rejectvisual > > and not use artifact_xxx combined with rejectartifact. We are > revising the automatic artifact detection functions at the moment, > since computers nowadays have much more RAM than when we started > implementing it 5 years ago, and reading the padded data into memory > is now much less of a concern. So in the near future, it will be > possible to do autodetection of artifacts also on data that is in > memory, which means that then you could also do the autodetection > after denoise_synthetic. > > best regards > Robert > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 443 bytes Desc: not available URL: From michael.wibral at WEB.DE Fri Aug 1 11:18:05 2008 From: michael.wibral at WEB.DE (Michael Wibral) Date: Fri, 1 Aug 2008 11:18:05 +0200 Subject: Logical problem with CTF 3rd order gra diometers correction Message-ID: Dear Robert, thank you very much for your answer. What I tried to do is invoke reject artefact after denoise_synthetic so that it works on the already denoised data (which is of course useless as it reads the data anew as I see now) . The aim of this procedure was to keep more trials. Is there any way to achieve this? The only thing I can think of right now is to run 3rd grads in the CTF software, save these data, then read them in with the new functions (Fieldtrip should know then that data are already in 3rd grad, shouldn't it?) and proceed as usual (i.e. run rejectartefact + preprocessing). Best Regards, Michael > -----Ursprüngliche Nachricht----- > Von: "Robert Oostenveld" > Gesendet: 31.07.08 23:01:00 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] Logical problem with CTF 3rd order gradiometers correction > Hi Michael > > On 31 Jul 2008, at 18:11, Michael Wibral wrote: > > Dear listusers, > > I have a logical problem with denoise-synthetic. > > > > here's what I want to do: > > > > 1. use definetrial to make cfg.trl (works fine) > > 2. use preprocessing with the new cfg. headerfile='ctf_new' , > > cfg.datafile='ctf_new' options to read the reference gradiometer > > information and the data into a fieldtrip structure (works fine) > > 3. use denoise_synthetic to denoise the data (works fine ?) > > In the (sofar limited) experiences that I heard there are noticeable > differences mainly on the central/vertex sensors (which are also the > closest to the reference sensors). > > > 4. un artefact detection on these data (-> this works fine and > > updates cfg.trl) > > after artifact_xxx and rejectartifact you should read the data using > preprocessing. Or are you using rejectvisual? If so, then you don't > have to call preprocessing a second time, because the output of > rejectvisual is again your data with the bad trials removed. > > > 5. run preprocessing a second time for filtering and actually > > applying the results of artefact corrcetion,... i.e. those things > > that I didn't want to do before denoise_synthetic. > > After rejectartifact, you should be calling it here like preprocessing > (cfg), and not with a second input argument. > > If you call it like preprocessing(cfg, data), then the cfg should not > contain cfg.dataset and cfg.trl but only filtering options, because > the data should not be read from file. > > > BUT preprocessing complains that cfg shouldn't contain the cfg.trl > > field when no data are read - which is the case because I am > > invoking preprocessing a second time here on an existing fieldtrip > > structure. > > I suspect that you are mixing up rejectartifact and preprocessing. > Calling preprocessing with a 2nd data input argument is only meant to > apply another set of filters on that data (i.e. if you forgot to do > it in the first run, or if you sequentially want to bandstopfilter > some line noise or CRT artifacts). > > > Therefore all information from artefact rejection is lost. > > > > Somehow it seems that I can run denoise_synthetic only after > > artefact rejection, because I need a fieldtrip dataset to run it, > > but NO dataset for preprocessing to perform artefact correction, > > i.e. accept cfg.trl. This would be a pity. > > I must say that I had not considered sofar the interaction between > denoising and artifact detectoin and removal. The artfifact_xxx > functions perform detection on data from disk(*), i.e. prior to > reading the data into memory. The historical reason for (*) is to > save on memory when a lot of filter padding is used and when there is > a lot of overlap between padded trials. The padded regions should be > checked for artifacts (esp jump artifacts which cause a lot of filter > rinning), but in the end we don't need them in memory. The denoising > only happens after the data is read into memory. > > > Any suggestion how to solve this? > > For the moment I suggest to use the following sequence > > definetrial > preprocessing > denoise_synthetic > rejectvisual > > and not use artifact_xxx combined with rejectartifact. We are > revising the automatic artifact detection functions at the moment, > since computers nowadays have much more RAM than when we started > implementing it 5 years ago, and reading the padded data into memory > is now much less of a concern. So in the near future, it will be > possible to do autodetection of artifacts also on data that is in > memory, which means that then you could also do the autodetection > after denoise_synthetic. > > best regards > Robert > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 443 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 443 bytes Desc: not available URL: From michelic72 at GMAIL.COM Sat Aug 2 17:26:06 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Sat, 2 Aug 2008 17:26:06 +0200 Subject: Logical problem with CTF 3rd order gradiometers correction Message-ID: About point 2 and 3 of Michael's email Is it unimportant if I apply denoise_synthetic before or after preprocessing? I thought denoise_synthetic applies a non linear transformation of the data so that any filtering preprocessing should be done immediately after this. If this is the case i propose the following schema: 1) 'read-in' preprocessing: simply reads the dataset in a structure without doing anything 2) denoise_synthetic 3) filtering In code: 1) cfg = []; cfg.dataset = 'Mydata.ds'; cfg.datatype = 'continuous'; cfg.channel = 'all'; cfg.trl = 'Mytrialfunction'; cfg.headerformat = 'ctf_new'; cfg.dataformat = 'ctf_new'; meg = preprocessing(cfg); 2) cfg = []; cfg.gradient = 'G3BR'; cfg.trials = 'all'; meg_d = denoise_synthetic(cfg, meg); 3) cfg = []; cfg.channel = 'MEG'; cfg.hpfilter = 'yes'; cfg.hpfreq = 1; meg_df = preprocessing(cfg, megd); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Sat Aug 2 17:42:03 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Sat, 2 Aug 2008 17:42:03 +0200 Subject: Logical problem with CTF 3rd order gradiometers correction Message-ID: I tested the routine denoise_synthetic on some dataset and compared with the downloaded denoise CTF routines for matlab. Taking care not to apply any filtering or baseline correction in the data reading/preprocessing, it works fine. Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From nathan.dees at UMSL.EDU Tue Aug 5 02:45:58 2008 From: nathan.dees at UMSL.EDU (Nathan Dees) Date: Tue, 5 Aug 2008 02:45:58 +0200 Subject: DICS Localization Problem Message-ID: Dear Fieldtrippers, Have been struggling a long time to produce a viable image of beamforming analysis. We are using a 4D-Magnes3600 Magnetometer MEG unit to record a prompted finger tapping motor task with variable ISI of 2.5 - 3.0 seconds. Our time-frequency plots show evident beta and alpha desynchronization at movement onset. We are using the beamforming tutorial as a guide. After calculating dataPre and dataPost, and verifying our mri has been properly segmented by SPM, our code is: cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 2; cfg.foilim = [18 20]; cfg.pad = 0.5; freqPre = freqanalysis(cfg,dataPre); cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 2; cfg.foilim = [18 20];segmentedmriF.transform = mri.transform; segmentedmriF.anatomy = mri.anatomy; cfg.pad = 0.5; freqPost = freqanalysis(cfg,dataPost); segmentedmri.transform = mri.transform; segmentedmri.anatomy = mri.anatomy; [vol, cfg] = prepare_singleshell([], segmentedmri); cfg = []; cfg.grad = freqPre.grad; cfg.vol = vol; cfg.reducerank = 2; cfg.channel = {'MEG'}; cfg.xgrid = -30:1:30; % 'AUTO' does not work! cfg.ygrid = -30:1:30; % 'AUTO' does not work! cfg.zgrid = -40:1:40; % 'AUTO' does not work! [grid] = prepare_leadfield(cfg); cfg = []; cfg.frequency = 20; cfg.method = 'dics'; cfg.projectnoise = 'yes'; cfg.grid = grid; cfg.vol = vol; cfg.lambda = 0; sourcePre = sourceanalysis(cfg,freqPre ); sourcePost = sourceanalysis(cfg,freqPost); %Plot of deep sources in the center of the brain looks reasonable. sourceDiff = sourcePost; sourceDiff.avg.pow = (sourcePre.avg.pow - sourcePost.avg.pow) ./ sourcePost.avg.pow; cfg = []; cfg.downsample = 2; sourceDiffInt = sourceinterpolate(cfg, sourceDiff , mri); cfg = []; cfg.method = 'slice'; cfg.funparameter = 'avg.pow'; cfg.maskparameter = cfg.funparameter; cfg.funcolorlim = [0.0 .2]; cfg.opacitylim = [0.0 .2]; cfg.opacitymap = 'rampup'; figure sourceplot(cfg,sourceDiffInt); We expect localization of desynchronization to be in the motor cortex, predominantly on the left side. The result we get is diffusely localized, and with weak signal. I have images to possibly help diagnose the problem, but for now, can anyone spot the errors? Thank you!! ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From nathanweisz at MAC.COM Tue Aug 5 07:34:34 2008 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Tue, 5 Aug 2008 07:34:34 +0200 Subject: DICS Localization Problem In-Reply-To: Message-ID: dear nathan, we see nice mu desynchronizations nicely localized to motor cortex when subjects prepare responding to a target using a 4-D 2500 WH (the one with 148 sensors). Have you already done localizations with your MEG system using a segmented brain? If not, then I suggest to check if you get the same results using a more 'standard' headmodel, e.g. multisphere (like in the tutorial). this assures you always are in the MEG-coordinate system, and have no weird mixture between coordinate systems. you need a headshape for that (pretty standard with 4D; i can provide you with one if you don't have one). also you might want to check if your volume / grid makes sense relative to the sensor position using 'headmodelplot'. good luck, yet-another-nathan On 05.08.2008, at 02:45, Nathan Dees wrote: > Dear Fieldtrippers, > > Have been struggling a long time to produce a viable image of > beamforming > analysis. We are using a 4D-Magnes3600 Magnetometer MEG unit to > record a > prompted finger tapping motor task with variable ISI of 2.5 - 3.0 > seconds. > Our time-frequency plots show evident beta and alpha > desynchronization at movement onset. We are using the beamforming > tutorial > as a guide. After calculating dataPre and dataPost, and verifying > our mri > has been properly segmented by SPM, our code is: > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'powandcsd'; > cfg.tapsmofrq = 2; > cfg.foilim = [18 20]; > cfg.pad = 0.5; > freqPre = freqanalysis(cfg,dataPre); > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'powandcsd'; > cfg.tapsmofrq = 2; > cfg.foilim = [18 20];segmentedmriF.transform = mri.transform; > segmentedmriF.anatomy = mri.anatomy; > cfg.pad = 0.5; > freqPost = freqanalysis(cfg,dataPost); > > segmentedmri.transform = mri.transform; > segmentedmri.anatomy = mri.anatomy; > [vol, cfg] = prepare_singleshell([], segmentedmri); > > cfg = []; > cfg.grad = freqPre.grad; > cfg.vol = vol; > cfg.reducerank = 2; > cfg.channel = {'MEG'}; > cfg.xgrid = -30:1:30; % 'AUTO' does not work! > cfg.ygrid = -30:1:30; % 'AUTO' does not work! > cfg.zgrid = -40:1:40; % 'AUTO' does not work! > [grid] = prepare_leadfield(cfg); > > cfg = []; > cfg.frequency = 20; > cfg.method = 'dics'; > cfg.projectnoise = 'yes'; > cfg.grid = grid; > cfg.vol = vol; > cfg.lambda = 0; > > sourcePre = sourceanalysis(cfg,freqPre ); > sourcePost = sourceanalysis(cfg,freqPost); > > %Plot of deep sources in the center of the brain looks reasonable. > > sourceDiff = sourcePost; > sourceDiff.avg.pow = (sourcePre.avg.pow - sourcePost.avg.pow) ./ > sourcePost.avg.pow; > cfg = []; > cfg.downsample = 2; > sourceDiffInt = sourceinterpolate(cfg, sourceDiff , mri); > > cfg = []; > cfg.method = 'slice'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > cfg.funcolorlim = [0.0 .2]; > cfg.opacitylim = [0.0 .2]; > cfg.opacitymap = 'rampup'; > figure > sourceplot(cfg,sourceDiffInt); > > We expect localization of desynchronization to be in the motor cortex, > predominantly on the left side. The result we get is diffusely > localized, > and with weak signal. I have images to possibly help diagnose the > problem, > but for now, can anyone spot the errors? > > Thank you!! > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/fcdonders/fieldtrip. -------------------------------------------- Attention: New Contact Details -------------------------------------------- Dr. Nathan Weisz OBOB-Lab University of Konstanz Department of Psychology P.O. Box D23 78457 Konstanz Germany Tel: ++49 - (0)7531 - 88 45 84 Email: nathan.weisz at uni-konstanz.de Homepage: coming soon Bob-wisdom: It's better to do one job well than two jobs... not so well. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.litvak at ION.UCL.AC.UK Tue Aug 5 10:10:10 2008 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Tue, 5 Aug 2008 09:10:10 +0100 Subject: DICS Localization Problem In-Reply-To: <9A794572-9406-497C-ADCE-22C7C1389F3C@mac.com> Message-ID: Dear Nathans, I think Nathan2 is in the right direction. I don't see anything in Nathan1's code that performs coregistration of the head model and the sensors, Robert and people at the Donders use CTF software to prepare their MRIs. In that software they specify the three fiducials and then the MRI is saved with transform from voxels to CTF head coordinates, the same coordinate system that the sensors are in. Thus when one uses MRI preprocessed with CTF software there is no need to coregrister. But this is not true in general, but rather an exception. Nathan1 uses MRI preprocessed with SPM. This MRI is most probably in MNI or some native coordinates in mm. The sensors are in head coordinates in cm (although I'm not sure about your particular system). The latest versions of FT, of the last month or so complain if there is a mismatch in units but they don't complain if your sensors are rotated 90 degrees for instance. So indeed you should become very well familiar with headmodelplot. Also look at volumerealign, electroderealign and interactiverealign. In general coregistration is quite tricky business, which is not very well reflected at the FT website because at the Donders they do it in one particular way, which makes it not so tricky for them. In SPM8 which will be released in October and is integrated with FT there will be a semi- automatic tool for coregistration that works with the 3 common MEG systems. But until then you have to figure it out. It's useful in the long run if you don't want to do things blindly. Best, Vladimir On Tue, Aug 5, 2008 at 6:34 AM, Nathan Weisz wrote: > dear nathan, > we see nice mu desynchronizations nicely localized to motor cortex when > subjects prepare responding to a target using a 4-D 2500 WH (the one with > 148 sensors). > Have you already done localizations with your MEG system using a segmented > brain? If not, then I suggest to check if you get the same results using a > more 'standard' headmodel, e.g. multisphere (like in the tutorial). this > assures you always are in the MEG-coordinate system, and have no weird > mixture between coordinate systems. you need a headshape for that (pretty > standard with 4D; i can provide you with one if you don't have one). also > you might want to check if your volume / grid makes sense relative to the > sensor position using 'headmodelplot'. > good luck, > yet-another-nathan > On 05.08.2008, at 02:45, Nathan Dees wrote: > > Dear Fieldtrippers, > > Have been struggling a long time to produce a viable image of beamforming > analysis. We are using a 4D-Magnes3600 Magnetometer MEG unit to record a > prompted finger tapping motor task with variable ISI of 2.5 - 3.0 seconds. > Our time-frequency plots show evident beta and alpha > desynchronization at movement onset. We are using the beamforming tutorial > as a guide. After calculating dataPre and dataPost, and verifying our mri > has been properly segmented by SPM, our code is: > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'powandcsd'; > cfg.tapsmofrq = 2; > cfg.foilim = [18 20]; > cfg.pad = 0.5; > freqPre = freqanalysis(cfg,dataPre); > > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'powandcsd'; > cfg.tapsmofrq = 2; > cfg.foilim = [18 20];segmentedmriF.transform = mri.transform; > segmentedmriF.anatomy = mri.anatomy; > cfg.pad = 0.5; > freqPost = freqanalysis(cfg,dataPost); > > segmentedmri.transform = mri.transform; > segmentedmri.anatomy = mri.anatomy; > [vol, cfg] = prepare_singleshell([], segmentedmri); > > cfg = []; > cfg.grad = freqPre.grad; > cfg.vol = vol; > cfg.reducerank = 2; > cfg.channel = {'MEG'}; > cfg.xgrid = -30:1:30; % 'AUTO' does not work! > cfg.ygrid = -30:1:30; % 'AUTO' does not work! > cfg.zgrid = -40:1:40; % 'AUTO' does not work! > [grid] = prepare_leadfield(cfg); > > cfg = []; > cfg.frequency = 20; > cfg.method = 'dics'; > cfg.projectnoise = 'yes'; > cfg.grid = grid; > cfg.vol = vol; > cfg.lambda = 0; > > sourcePre = sourceanalysis(cfg,freqPre ); > sourcePost = sourceanalysis(cfg,freqPost); > > %Plot of deep sources in the center of the brain looks reasonable. > > sourceDiff = sourcePost; > sourceDiff.avg.pow = (sourcePre.avg.pow - sourcePost.avg.pow) ./ > sourcePost.avg.pow; > cfg = []; > cfg.downsample = 2; > sourceDiffInt = sourceinterpolate(cfg, sourceDiff , mri); > > cfg = []; > cfg.method = 'slice'; > cfg.funparameter = 'avg.pow'; > cfg.maskparameter = cfg.funparameter; > cfg.funcolorlim = [0.0 .2]; > cfg.opacitylim = [0.0 .2]; > cfg.opacitymap = 'rampup'; > figure > sourceplot(cfg,sourceDiffInt); > > We expect localization of desynchronization to be in the motor cortex, > predominantly on the left side. The result we get is diffusely localized, > and with weak signal. I have images to possibly help diagnose the problem, > but for now, can anyone spot the errors? > > Thank you!! > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > > -------------------------------------------- > Attention: New Contact Details > -------------------------------------------- > Dr. Nathan Weisz > OBOB-Lab > University of Konstanz > Department of Psychology > P.O. Box D23 > 78457 Konstanz > Germany > Tel: ++49 - (0)7531 - 88 45 84 > Email: nathan.weisz at uni-konstanz.de > Homepage: coming soon > Bob-wisdom: It's better to do one job well than two jobs... not so well. > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and > EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Tue Aug 5 10:44:49 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Tue, 5 Aug 2008 10:44:49 +0200 Subject: DICS Localization Problem Message-ID: > Dear Nathan and Nathan, > > I'd like to add that I recently discovered some inconsistencies > with respect to the units in which gradiometer positions/dipole > positions etc. are expressed. > We are in the process of looking into this and making it > consistent. For now you should ensure yourself that the gradiometer > positions and grid locations and the mri-transformation matrix have > the same units (which is meters in our 4D-system). Moreover, the > singleshell method somewhere has a hard-coded assumption that the > units are centimeters (which is the default units for CTF systems) > so the solution might not be entirely correct if you use meters. > > Yours, > Jan-Mathijs > > On Aug 5, 2008, at 7:34 AM, Nathan Weisz wrote: > >> dear nathan, >> >> we see nice mu desynchronizations nicely localized to motor cortex >> when subjects prepare responding to a target using a 4-D 2500 WH >> (the one with 148 sensors). >> Have you already done localizations with your MEG system using a >> segmented brain? If not, then I suggest to check if you get the >> same results using a more 'standard' headmodel, e.g. multisphere >> (like in the tutorial). this assures you always are in the MEG- >> coordinate system, and have no weird mixture between coordinate >> systems. you need a headshape for that (pretty standard with 4D; i >> can provide you with one if you don't have one). also you might >> want to check if your volume / grid makes sense relative to the >> sensor position using 'headmodelplot'. >> >> good luck, >> yet-another-nathan >> >> On 05.08.2008, at 02:45, Nathan Dees wrote: >> >>> Dear Fieldtrippers, >>> >>> Have been struggling a long time to produce a viable image of >>> beamforming >>> analysis. We are using a 4D-Magnes3600 Magnetometer MEG unit to >>> record a >>> prompted finger tapping motor task with variable ISI of 2.5 - 3.0 >>> seconds. >>> Our time-frequency plots show evident beta and alpha >>> desynchronization at movement onset. We are using the >>> beamforming tutorial >>> as a guide. After calculating dataPre and dataPost, and >>> verifying our mri >>> has been properly segmented by SPM, our code is: >>> >>> cfg = []; >>> cfg.method = 'mtmfft'; >>> cfg.output = 'powandcsd'; >>> cfg.tapsmofrq = 2; >>> cfg.foilim = [18 20]; >>> cfg.pad = 0.5; >>> freqPre = freqanalysis(cfg,dataPre); >>> >>> cfg = []; >>> cfg.method = 'mtmfft'; >>> cfg.output = 'powandcsd'; >>> cfg.tapsmofrq = 2; >>> cfg.foilim = [18 20];segmentedmriF.transform = mri.transform; >>> segmentedmriF.anatomy = mri.anatomy; >>> cfg.pad = 0.5; >>> freqPost = freqanalysis(cfg,dataPost); >>> >>> segmentedmri.transform = mri.transform; >>> segmentedmri.anatomy = mri.anatomy; >>> [vol, cfg] = prepare_singleshell([], segmentedmri); >>> >>> cfg = []; >>> cfg.grad = freqPre.grad; >>> cfg.vol = vol; >>> cfg.reducerank = 2; >>> cfg.channel = {'MEG'}; >>> cfg.xgrid = -30:1:30; % 'AUTO' does not work! >>> cfg.ygrid = -30:1:30; % 'AUTO' does not work! >>> cfg.zgrid = -40:1:40; % 'AUTO' does not work! >>> [grid] = prepare_leadfield(cfg); >>> >>> cfg = []; >>> cfg.frequency = 20; >>> cfg.method = 'dics'; >>> cfg.projectnoise = 'yes'; >>> cfg.grid = grid; >>> cfg.vol = vol; >>> cfg.lambda = 0; >>> >>> sourcePre = sourceanalysis(cfg,freqPre ); >>> sourcePost = sourceanalysis(cfg,freqPost); >>> >>> %Plot of deep sources in the center of the brain looks reasonable. >>> >>> sourceDiff = sourcePost; >>> sourceDiff.avg.pow = (sourcePre.avg.pow - sourcePost.avg.pow) ./ >>> sourcePost.avg.pow; >>> cfg = []; >>> cfg.downsample = 2; >>> sourceDiffInt = sourceinterpolate(cfg, sourceDiff , mri); >>> >>> cfg = []; >>> cfg.method = 'slice'; >>> cfg.funparameter = 'avg.pow'; >>> cfg.maskparameter = cfg.funparameter; >>> cfg.funcolorlim = [0.0 .2]; >>> cfg.opacitylim = [0.0 .2]; >>> cfg.opacitymap = 'rampup'; >>> figure >>> sourceplot(cfg,sourceDiffInt); >>> >>> We expect localization of desynchronization to be in the motor >>> cortex, >>> predominantly on the left side. The result we get is diffusely >>> localized, >>> and with weak signal. I have images to possibly help diagnose >>> the problem, >>> but for now, can anyone spot the errors? >>> >>> Thank you!! >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between >>> users of the FieldTrip toolbox, to share experiences and to >>> discuss new ideas for MEG and EEG analysis. See also http:// >>> listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/ >>> fcdonders/fieldtrip. >> >> -------------------------------------------- >> Attention: New Contact Details >> -------------------------------------------- >> Dr. Nathan Weisz >> >> OBOB-Lab >> University of Konstanz >> Department of Psychology >> P.O. Box D23 >> 78457 Konstanz >> Germany >> >> Tel: ++49 - (0)7531 - 88 45 84 >> Email: nathan.weisz at uni-konstanz.de >> Homepage: coming soon >> >> Bob-wisdom: It's better to do one job well than two jobs... not so >> well. >> >> ---------------------------------- >> >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. >> >> http://listserv.surfnet.nl/archives/fieldtrip.html >> >> http://www.ru.nl/fcdonders/fieldtrip/ >> > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From michelic72 at GMAIL.COM Fri Aug 8 14:05:20 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Fri, 8 Aug 2008 14:05:20 +0200 Subject: Beamformer of correlated sources Message-ID: Dear all I have some questions about the use of DICS in the case of two correlated cortical activations. I am using an isometric contraction protocol and i localized the reference dipole through cortico-muscular coherence with external myography and (classic) DICS method. Now I have to calculate cortico-cortical activations and i use: cfg = []; cfg.grid = grid; cfg.method = 'dics'; cfg.projectnoise = 'yes'; cfg.lambda = 0; cfg.refdip = ref_dipole_position; cfg.frequency = 20; cfg.hdmfile = 'mymodel.hdm'; sourcecond = sourceanalysis(cfg, freq); According to Schoffelen et al. in order to disentangle the sources a modification of the classic DICS algorithm is necessary. Am i supposed to extract the two activations if they are correlated with the above written lines? If not, how would it be a FT implementation to get to correlated sources localization with DICS? I tried with simulation and apparently the above implemetation is able to localize only one source with a spread activation. Attachments show: '1sourceDICS.png' : simulation with an external reference channel correlated with a source in the left emisphere '2sourcesCCCDICS.png': simulation with reference dipole (same as above) whose activity is correlated to a simmetric one in the right emisphere Best Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: 1sourceDICS.png Type: image/png Size: 175531 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 2sourcesCCCDICS.png Type: image/png Size: 180189 bytes Desc: not available URL: From j.schoffelen at PSY.GLA.AC.UK Fri Aug 8 14:30:38 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Fri, 8 Aug 2008 14:30:38 +0200 Subject: Beamformer of correlated sources In-Reply-To: Message-ID: Dear Cristiano, Nice simulation in figure 1! The way you did the second simulation is just the 'traditional' DICS, giving you a huge mountain of coherence around the reference location. This will drown any other true cortico-cortical coherence to the right hemisphere dipole. (Note that a double dipole approach will not be of too much help here, if you do a ccc-analysis with respect to your reference: this is an important point in the paper you refer to. The double dipole approach will hopefully be able to unveil low coherence of the second dipole to the reference, which is masked by the high power + high coherence (one of these, or perhaps both) in the reference dipole.) As such, the double dipole approach is not yet implemented in a straightforward way in the release-version of fieldtrip, but I will be happy to give you some handles: I would suggest to include the leadfield of the reference location in the grid with precomputed leadfields which will be passed in the configuration to sourceanalysis. You have to concatenate the dipole-location specific leadfields with the reference dipole's leadfield. This will give you leadfields of dimensionality Nx6 (or Nx2 if you have a reason to assume a fixed orientation). Subsequently you can run sourceanalysis with cfg.keepfilter = 'yes' and without cfg.refdip, to extract the filter coefficients. These will have the dimensionality 6xN for each double dipole, the first 3 rows corresponding to the location specific location, and the last 3 rows corresponding to the reference dipole. To then compute your 'dipole pair and reference channel'-based cross- spectral density you have to sandwich the sensor-level cross-spectral density (take care to have the channel-order identical to the channel order in the filters) between the augmented filters. You can augment the filters to accommodate for the reference channel in the following way: [filter zeros(size(filter,1),1);zeros(1,size (filter,2)) 1]; (make sure to put the reference channel last in the channel csd. From each sandwiched csd (7x7) you should be able to extract anything you want. The top-left 6x6 block will contain the between dipole csd (diagonal 3x3 blocks contain the within dipole parameters from which power can be estimated: the off-diagonal blocks contain the between dipole csd). The bottom right value will contain the reference signal power, and the 6x1 and 1x6 remaining vectors contain the reference to dipole csds, in two groups of 3. The coherence can be estimated (according to Joachim's 2001 PNAS-paper) in this case by: svd( csd(1:3,7))./ sqrt(svd(csd(1:3,1:3)) *csd(7,7)); Good luck, Jan-Mathijs On Aug 8, 2008, at 2:05 PM, Cristiano Micheli wrote: > Dear all > I have some questions about the use of DICS in the case of two > correlated > cortical activations. > I am using an isometric contraction protocol and i localized the > reference > dipole through cortico-muscular coherence with external myography and > (classic) DICS method. Now I have to calculate cortico-cortical > activations > and i use: > > cfg = []; > cfg.grid = grid; > cfg.method = 'dics'; > cfg.projectnoise = 'yes'; > cfg.lambda = 0; > cfg.refdip = ref_dipole_position; > cfg.frequency = 20; > cfg.hdmfile = 'mymodel.hdm'; > sourcecond = sourceanalysis(cfg, freq); > > According to Schoffelen et al. in order to disentangle the sources a > modification of the classic DICS algorithm is necessary. > Am i supposed to extract the two activations if they are correlated > with the > above written lines? > If not, how would it be a FT implementation to get to correlated > sources > localization with DICS? > I tried with simulation and apparently the above implemetation is > able to > localize only one source with a spread activation. > Attachments show: > '1sourceDICS.png' : simulation with an external reference channel > correlated > with a source in the left emisphere > '2sourcesCCCDICS.png': simulation with reference dipole (same as > above) > whose activity is correlated to a simmetric one in the right emisphere > > Best > Cristiano > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/ > fieldtrip.<1sourceDICS.png><2sourcesCCCDICS.png> ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From venug001 at BAMA.UA.EDU Fri Aug 8 23:01:50 2008 From: venug001 at BAMA.UA.EDU (Gopakumar Venugopalan) Date: Fri, 8 Aug 2008 16:01:50 -0500 Subject: BIOMAG 2008 Message-ID: Hello are there folks here on their way to Biomag 2008 (Sapporo)? If so would you please email me. Thanks in advance. regards gopa ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From tony.w.wilson at GMAIL.COM Sat Aug 9 05:43:17 2008 From: tony.w.wilson at GMAIL.COM (Tony W. Wilson) Date: Fri, 8 Aug 2008 23:43:17 -0400 Subject: BIOMAG 2008 In-Reply-To: <1218229310.489cb43eecc84@bamamail.ua.edu> Message-ID: yeah, I am going to biomag On Fri, Aug 8, 2008 at 5:01 PM, Gopakumar Venugopalan wrote: > Hello are there folks here on their way to Biomag 2008 (Sapporo)? If so > would you please email me. Thanks in advance. > regards > gopa > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > -- _______________________________________________ Tony W. Wilson, Ph.D. Assistant Professor of Neurology Wake Forest University School of Medicine One Medical Center Blvd. Winston-Salem, NC 27157 (336) 716-5151 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From michelic72 at GMAIL.COM Sun Aug 10 17:29:18 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Sun, 10 Aug 2008 17:29:18 +0200 Subject: Beamformer of correlated sources Message-ID: Dear Jan-Mathijs I tried to implement the double dipole DICS but without success. I use a simulation with two correlated sources but I see only one in the power and two spread sources not where i expect them to be in the coherence. I performed the following step as suggested by you in the last email: 1) Calculation of cross spectral matrixes Cf (channel-channel), Cr (channel reference) and Power of the reference Pr for a specific frequency. 2) Concatenation of the local leadfield with one of the dipoles' leadfield for each point of the grid: lf = compute_leadfield(dip.pos(i,:), grad, vol, 'reducerank', reducerank, 'normalize', normalize); lf2 = compute_leadfield([0 5 10], grad, vol, 'reducerank', reducerank, 'normalize', normalize); lf = [lf lf2]; 3) Calculation of local spatial filter according to: filt = pinv(lf' * invCf * lf) * lf' * invCf; 4) Augmenting the filter according to: filt = [filt zeros(size(filt,1),1);zeros(1,size(filt,2)) 1]; 5) Augmenting the Cf by introducing the reference-channels csd and reference power: Cf_ = [Cf Cr;Cr' Pr]; 6) Sandwiching: csd = filt * Cf_ * ctranspose(filt); 7) Calculating power and coherence: pow = real(trace(csd(1:6,1:6))); coh = lambda1( csd(1:3,7))./ sqrt(lambda1(csd(1:3,1:3))*csd(7,7)); Where do i fail? Is there something I do not understand? According to this scheme the power of point 7 should take into account both dipoles and the coherence should not be masked by the chosen dipole. Regards Cristiano On Fri, 8 Aug 2008 14:30:38 +0200, jan-mathijs schoffelen wrote: >Dear Cristiano, > >Nice simulation in figure 1! >The way you did the second simulation is just the 'traditional' DICS, >giving you a huge mountain of coherence around the reference location. >This will drown any other true cortico-cortical coherence to the >right hemisphere dipole. (Note that a double dipole approach will not >be of too >much help here, if you do a ccc-analysis with respect to your >reference: this is an important point in the paper you refer to. The >double dipole approach >will hopefully be able to unveil low coherence of the second dipole >to the reference, which is masked by the high power + high coherence >(one of these, >or perhaps both) in the reference dipole.) > >As such, the double dipole approach is not yet implemented in a >straightforward way in the release-version of fieldtrip, but I will >be happy to give you some handles: > >I would suggest to include the leadfield of the reference location in >the grid with precomputed leadfields which will be passed in the >configuration to sourceanalysis. >You have to concatenate the dipole-location specific leadfields with >the reference dipole's leadfield. This will give you leadfields of >dimensionality Nx6 (or Nx2 if you >have a reason to assume a fixed orientation). >Subsequently you can run sourceanalysis with cfg.keepfilter = 'yes' >and without cfg.refdip, to extract the filter coefficients. These >will have the dimensionality 6xN for each >double dipole, the first 3 rows corresponding to the location >specific location, and the last 3 rows corresponding to the reference >dipole. >To then compute your 'dipole pair and reference channel'-based cross- >spectral density you have to sandwich the sensor-level cross-spectral >density (take care to have >the channel-order identical to the channel order in the filters) >between the augmented filters. You can augment the filters to >accommodate for the reference channel in >the following way: [filter zeros(size(filter,1),1);zeros(1,size >(filter,2)) 1]; (make sure to put the reference channel last in the >channel csd. > From each sandwiched csd (7x7) you should be able to extract >anything you want. The top-left 6x6 block will contain the between >dipole csd (diagonal 3x3 blocks contain >the within dipole parameters from which power can be estimated: the >off-diagonal blocks contain the between dipole csd). The bottom right >value will contain the reference >signal power, and the 6x1 and 1x6 remaining vectors contain the >reference to dipole csds, in two groups of 3. The coherence can be >estimated (according to Joachim's 2001 >PNAS-paper) in this case by: svd( csd(1:3,7))./ sqrt(svd(csd(1:3,1:3)) >*csd(7,7)); > >Good luck, > >Jan-Mathijs > > > > > >On Aug 8, 2008, at 2:05 PM, Cristiano Micheli wrote: > >> Dear all >> I have some questions about the use of DICS in the case of two >> correlated >> cortical activations. >> I am using an isometric contraction protocol and i localized the >> reference >> dipole through cortico-muscular coherence with external myography and >> (classic) DICS method. Now I have to calculate cortico-cortical >> activations >> and i use: >> >> cfg = []; >> cfg.grid = grid; >> cfg.method = 'dics'; >> cfg.projectnoise = 'yes'; >> cfg.lambda = 0; >> cfg.refdip = ref_dipole_position; >> cfg.frequency = 20; >> cfg.hdmfile = 'mymodel.hdm'; >> sourcecond = sourceanalysis(cfg, freq); >> >> According to Schoffelen et al. in order to disentangle the sources a >> modification of the classic DICS algorithm is necessary. >> Am i supposed to extract the two activations if they are correlated >> with the >> above written lines? >> If not, how would it be a FT implementation to get to correlated >> sources >> localization with DICS? >> I tried with simulation and apparently the above implemetation is >> able to >> localize only one source with a spread activation. >> Attachments show: >> '1sourceDICS.png' : simulation with an external reference channel >> correlated >> with a source in the left emisphere >> '2sourcesCCCDICS.png': simulation with reference dipole (same as >> above) >> whose activity is correlated to a simmetric one in the right emisphere >> >> Best >> Cristiano >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ >> archives/fieldtrip.html and http://www.ru.nl/fcdonders/ >> fieldtrip.<1sourceDICS.png><2sourcesCCCDICS.png> > >---------------------------------- >The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Mon Aug 11 10:13:30 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 11 Aug 2008 10:13:30 +0200 Subject: BIOMAG 2008 In-Reply-To: <1218229310.489cb43eecc84@bamamail.ua.edu> Message-ID: Hi Gopakumar I will also go to the BIOMAG conference in Saporro. See you there, Robert On 8 Aug 2008, at 23:01, Gopakumar Venugopalan wrote: > Hello are there folks here on their way to Biomag 2008 (Sapporo)? > If so > would you please email me. Thanks in advance. > regards > gopa > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From dsenkows at UKE.DE Wed Aug 13 12:19:40 2008 From: dsenkows at UKE.DE (Daniel Senkowski) Date: Wed, 13 Aug 2008 12:19:40 +0200 Subject: channelselection.m Message-ID: Dear all, using data from a CTF 275 channel system, I am facing some minor issues with the current channelselection.m script (see error message below). I am therefore still using an older version of the channelselection.m script but would be interested if anyone else had a similar problem and possibly solved it. Regards, Daniel Senkowski -------- Here is the error message: Multitaper: PVh Subject: vp03... the input is raw data with 274 channels and 124 trials ??? Undefined function or method 'senstype' for input arguments of type 'cell'. Error in ==> channelselection at 104 isctf = senstype(datachannel, 'ctf'); Error in ==> freqanalysis_mtmconvol at 277 cfg.channel = channelselection(cfg.channel, data.label); Error in ==> freqanalysis at 200 [freq] = feval(sprintf('freqanalysis_%s',lower(cfg.method)), cfg, data); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Wed Aug 13 13:50:23 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 13 Aug 2008 13:50:23 +0200 Subject: channelselection.m In-Reply-To: Message-ID: Hi Daniel On 13 Aug 2008, at 12:19, Daniel Senkowski wrote: > using data from a CTF 275 channel system, I am facing some minor > issues with > the current channelselection.m script (see error message below). I am > therefore still using an older version of the channelselection.m > script but > would be interested if anyone else had a similar problem and > possibly solved it. > ... > Here is the error message: > > Multitaper: PVh Subject: vp03... > the input is raw data with 274 channels and 124 trials > ??? Undefined function or method 'senstype' for input arguments of > type 'cell'. > > Error in ==> channelselection at 104 > isctf = senstype(datachannel, 'ctf'); There should be a function senstype (fieldtrip/private/senstype.m) which is used here and which in your case cannot be found. As far as I can tell, that function is included in the ftp release. Please search for the senstype function in your fieldtrip directory. best regards, Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Thu Aug 14 12:11:17 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Thu, 14 Aug 2008 12:11:17 +0200 Subject: DICS power Message-ID: Hi All I have a problem with DICS's power and my simulations. I simulate an external virtual channel coupled with MEG activity in a specific frequency band (around 20 Hz). I use DICS and submethod 'ref_chan' and i can localize 1 source (even 2 if they are distant) but only if I use coherence as a functional parameter and reducerank=2. With power i always see a bright spot in the middle of the brain. Should i select some options to account for decreased sensors' sensibility in depth? Since I used anyway coherence parameter for localization I did not pay attention to this before but somehow it looks strange to me. I attach the code and power image. Regards cfg = []; cfg.grid = grid_; cfg.method = 'dics'; cfg.projectnoise = 'yes'; cfg.reducerank = 2; cfg.lambda = 0; cfg.refchan = refch; cfg.frequency = 20; cfg.hdmfile = 'myheadmodel.hdm'; sourcecond = sourceanalysis(cfg, freqcond); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: power.png Type: image/png Size: 157338 bytes Desc: not available URL: From j.schoffelen at PSY.GLA.AC.UK Thu Aug 14 12:18:43 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Thu, 14 Aug 2008 12:18:43 +0200 Subject: DICS power In-Reply-To: Message-ID: Dear Cristiano, This issue is covered in the 'applying beamforming techniques in the frequency domain'-tutorial on the fieldtrip-website. This is perfectly normal behaviour of the beamformer, when you use non-normalized leadfields (which I would do in the first place). In order to make sense out of the power-images you can do two things: -plot the power relative to another 'condition' (this is explained in the tutorial) -compute the 'neural-activity-index' (this is also explained in the tutorial) Please have a look there, it might already clear things up for you. Yours, Jan-Mathijs On Aug 14, 2008, at 12:11 PM, Cristiano Micheli wrote: > Hi All > I have a problem with DICS's power and my simulations. I simulate an > external virtual channel coupled with MEG activity in a specific > frequency > band (around 20 Hz). > I use DICS and submethod 'ref_chan' and i can localize 1 source > (even 2 if > they are distant) but only if I use coherence as a functional > parameter and > reducerank=2. > With power i always see a bright spot in the middle of the brain. > Should i select some options to account for decreased sensors' > sensibility > in depth? > Since I used anyway coherence parameter for localization I did not pay > attention to this before but somehow it looks strange to me. > I attach the code and power image. > Regards > > cfg = []; > cfg.grid = grid_; > cfg.method = 'dics'; > cfg.projectnoise = 'yes'; > cfg.reducerank = 2; > cfg.lambda = 0; > cfg.refchan = refch; > cfg.frequency = 20; > cfg.hdmfile = 'myheadmodel.hdm'; > sourcecond = sourceanalysis(cfg, freqcond); > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/ > fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From djs32 at BUFFALO.EDU Thu Aug 14 13:15:23 2008 From: djs32 at BUFFALO.EDU (Daniel Stolzberg) Date: Thu, 14 Aug 2008 13:15:23 +0200 Subject: Tucker-Davis Technologies and PLX Message-ID: Hello, I have acquired multichannel continuous data using Tucker-Davis Technologies (TDT) equipment and the OpenEx software. I have been unable to directly import the TDT 'tanks' into fieldtrip so I created a very roundabout way by first using the OpenEx software to export the data to a comma separated values (csv) file format and then import it into Matlab using a script. This is time consuming and limiting. Does anyone have more detailed information on how TDT formats their data tanks? TDT support was not very helpful with this issue (although they are usually helpful). TDT's OpenEx software also allows one to export to PLX data format. I have been unable to open PLX files with FieldTrip because the function 'read_plexon_plx' does not exist. Does anyone have information on this function? Thank you! -Dan ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From alexander.roth at MED.UNI-HEIDELBERG.DE Fri Aug 15 10:02:05 2008 From: alexander.roth at MED.UNI-HEIDELBERG.DE (Alexander Roth) Date: Fri, 15 Aug 2008 10:02:05 +0200 Subject: Bug? Message-ID: I downloaded the latest version of fieldtrip (fieldtrip-20080814) this morning. I tried to create a headmodel via: cfg=[]; cfg.headshape='LTM_VP011_pic.sfp' [vol]=prepare_singleshell(cfg); An error occured: ??? Undefined function or method 'read_headshape' for input arguments of type 'char'. Error in ==> prepare_singleshell at 164 shape = read_headshape(cfg.headshape); There's a note in the changelog saying that from now on the function 'read_headshape()' should be used to read head model data. However, it seems that this file isn't included in the fieldtrip package. Best, Alex ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Fri Aug 15 11:10:18 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Fri, 15 Aug 2008 11:10:18 +0200 Subject: Bug? In-Reply-To: Message-ID: Dear Alex, Thanks for the quick bug report. I added read_headshape to the release version. It will be available tonight. Yours, Jan-Mathijs On Aug 15, 2008, at 10:02 AM, Alexander Roth wrote: > I downloaded the latest version of fieldtrip (fieldtrip-20080814) this > morning. I tried to create a headmodel via: > > cfg=[]; > cfg.headshape='LTM_VP011_pic.sfp' > [vol]=prepare_singleshell(cfg); > > An error occured: > > ??? Undefined function or method 'read_headshape' for input > arguments of > type 'char'. > > Error in ==> prepare_singleshell at 164 > shape = read_headshape(cfg.headshape); > > There's a note in the changelog saying that from now on the function > 'read_headshape()' should be used to read head model data. However, > it seems > that this file isn't included in the fieldtrip package. > > Best, > > Alex > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From michelic72 at GMAIL.COM Fri Aug 15 15:08:29 2008 From: michelic72 at GMAIL.COM (Cristiano Micheli) Date: Fri, 15 Aug 2008 15:08:29 +0200 Subject: Beamformer of correlated sources Message-ID: About your last email: On Fri, 8 Aug 2008 14:30:38 +0200, jan-mathijs schoffelen wrote: >Dear Cristiano, > >Nice simulation in figure 1! >The way you did the second simulation is just the 'traditional' DICS, >giving you a huge mountain of coherence around the reference location. >This will drown any other true cortico-cortical coherence to the >right hemisphere dipole. (Note that a double dipole approach will not >be of too >much help here, if you do a ccc-analysis with respect to your >reference: this is an important point in the paper you refer to. The >double dipole approach >will hopefully be able to unveil low coherence of the second dipole >to the reference, which is masked by the high power + high coherence >(one of these, >or perhaps both) in the reference dipole.) > >As such, the double dipole approach is not yet implemented in a >straightforward way in the release-version of fieldtrip, but I will >be happy to give you some handles: > >I would suggest to include the leadfield of the reference location in >the grid with precomputed leadfields which will be passed in the >configuration to sourceanalysis. >You have to concatenate the dipole-location specific leadfields with >the reference dipole's leadfield. This will give you leadfields of >dimensionality Nx6 (or Nx2 if you >have a reason to assume a fixed orientation). >Subsequently you can run sourceanalysis with cfg.keepfilter = 'yes' >and without cfg.refdip, to extract the filter coefficients. These >will have the dimensionality 6xN for each >double dipole, the first 3 rows corresponding to the location >specific location, and the last 3 rows corresponding to the reference >dipole. I created a file named 'my_prepare_leadfield.m' and i concatenated the lead field as written (line 235): % grid.leadfield{dipindx} = lf; %old %%%%%%%%%%%%%%%%%%% new lf2 = compute_leadfield([0 5 10], sens, vol, 'reducerank', cfg.reducerank, 'normalize', cfg.normalize,'normalizeparam',cfg.normalizeparam); grid.leadfield{dipindx} = [lf lf2]; %%%%%%%%%%%%%%%%%%% new Then I run the DICS with the following settings as you adviced: cfg = []; cfg.grid = grid_; cfg.method = 'dics'; cfg.projectnoise = 'yes'; cfg.reducerank = 2; cfg.lambda = 0; cfg.refchan = refch; cfg.frequency = 20; cfg.hdmfile = 'mymodel.hdm'; cfg.keepfilter= 'yes'; sourcecond = sourceanalysis(cfg, freqcond); >To then compute your 'dipole pair and reference channel'-based cross- >spectral density you have to sandwich the sensor-level cross-spectral >density (take care to have >the channel-order identical to the channel order in the filters) >between the augmented filters. You can augment the filters to >accommodate for the reference channel in >the following way: [filter zeros(size(filter,1),1);zeros(1,size >(filter,2)) 1]; (make sure to put the reference channel last in the >channel csd. Before doing it I think I will have to include Cf and Cr and Pr in the same matrix, but i am not sure. Namely: csd = filter * Cf_ * ctranspose(filter) with filt of dimensions 6X(N+1) channels after augmenting, and Cf_ made of the contributions of MEG channel-channels cross-variance plus the contribution of MEG-EMG channels crossvariance Cr (column vector): Cf_ = [Cf,Cr;Cr' Pr]; > From each sandwiched csd (7x7) you should be able to extract >anything you want. The top-left 6x6 block will contain the between >dipole csd (diagonal 3x3 blocks contain >the within dipole parameters from which power can be estimated: the >off-diagonal blocks contain the between dipole csd). The bottom right >value will contain the reference >signal power, and the 6x1 and 1x6 remaining vectors contain the >reference to dipole csds, in two groups of 3. The coherence can be >estimated (according to Joachim's 2001 >PNAS-paper) in this case by: svd( csd(1:3,7))./ sqrt(svd(csd(1:3,1:3)) >*csd(7,7)); > >Good luck, > >Jan-Mathijs This makes sense to me, considering also the literature (Dalal et al. 2006, Brookes et al. 2007), but I weight equally the contributions of two correlated dipoles, which can also have different amplitudes. This is why maybe my simulations are not able to attenuate the main dipole? Best Cristiano ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Fri Aug 15 15:27:47 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Fri, 15 Aug 2008 15:27:47 +0200 Subject: Beamformer of correlated sources In-Reply-To: Message-ID: Dear Cristiano, What do you exactly mean by 'not able to attenuate the main dipole'? Do you mean attenuation of power, or of coherence? The purpose of using several dipoles in your source model (be it one location fixed and the other moving, or a symmetric dipole pair, or whatever) before computing the beamformer weights will not lead to attenuation. The underlying idea of allowing the two locations in the spatial pass- band, is to prevent the 'main dipole' from distorting the reconstructed signal. Distortion of the reconstructed signal at the second location of interest, will critically affect the cross- spectral density with the reference signal, and thus the reconstructed coherence. Importantly, the double dipole approach does still not take the problem of filter leakage away and therefore will generally not lead to a clear ccc-map. There will still be a 'dome' of coherence around the reference location, unless you have a well- specified condition to be able to compute a contrast (although this poses problems in itself, because differences in estimated power lead to different shapes of the 'domes'). As a remark on the side, recent work I did in this direction actually made me realize that the absolute value of the simulated coherence between a target dipole pair can be estimated quite accurately with a beamformer (given appropriate snr, leadfield correlations etc), but problems arise from the fact that other regions in the brain will show even higher values of correlation. I realize I did not provide any answers here but hopefully some food for thought. Yours, Jan-Mathijs On Aug 15, 2008, at 3:08 PM, Cristiano Micheli wrote: > About your last email: > > On Fri, 8 Aug 2008 14:30:38 +0200, jan-mathijs schoffelen > wrote: > >> Dear Cristiano, >> >> Nice simulation in figure 1! >> The way you did the second simulation is just the 'traditional' DICS, >> giving you a huge mountain of coherence around the reference >> location. >> This will drown any other true cortico-cortical coherence to the >> right hemisphere dipole. (Note that a double dipole approach will not >> be of too >> much help here, if you do a ccc-analysis with respect to your >> reference: this is an important point in the paper you refer to. The >> double dipole approach >> will hopefully be able to unveil low coherence of the second dipole >> to the reference, which is masked by the high power + high coherence >> (one of these, >> or perhaps both) in the reference dipole.) >> >> As such, the double dipole approach is not yet implemented in a >> straightforward way in the release-version of fieldtrip, but I will >> be happy to give you some handles: >> >> I would suggest to include the leadfield of the reference location in >> the grid with precomputed leadfields which will be passed in the >> configuration to sourceanalysis. >> You have to concatenate the dipole-location specific leadfields with >> the reference dipole's leadfield. This will give you leadfields of >> dimensionality Nx6 (or Nx2 if you >> have a reason to assume a fixed orientation). >> Subsequently you can run sourceanalysis with cfg.keepfilter = 'yes' >> and without cfg.refdip, to extract the filter coefficients. These >> will have the dimensionality 6xN for each >> double dipole, the first 3 rows corresponding to the location >> specific location, and the last 3 rows corresponding to the reference >> dipole. > > I created a file named 'my_prepare_leadfield.m' and i > concatenated the > lead field as written (line 235): > > % grid.leadfield{dipindx} = lf; %old > %%%%%%%%%%%%%%%%%%% new > lf2 = compute_leadfield([0 5 10], sens, vol, 'reducerank', > cfg.reducerank, > 'normalize', cfg.normalize,'normalizeparam',cfg.normalizeparam); > grid.leadfield{dipindx} = [lf lf2]; > %%%%%%%%%%%%%%%%%%% new > > Then I run the DICS with the following settings as you adviced: > > cfg = []; > cfg.grid = grid_; > cfg.method = 'dics'; > cfg.projectnoise = 'yes'; > cfg.reducerank = 2; > cfg.lambda = 0; > cfg.refchan = refch; > cfg.frequency = 20; > cfg.hdmfile = 'mymodel.hdm'; > cfg.keepfilter= 'yes'; > sourcecond = sourceanalysis(cfg, freqcond); > >> To then compute your 'dipole pair and reference channel'-based cross- >> spectral density you have to sandwich the sensor-level cross-spectral >> density (take care to have >> the channel-order identical to the channel order in the filters) >> between the augmented filters. You can augment the filters to >> accommodate for the reference channel in >> the following way: [filter zeros(size(filter,1),1);zeros(1,size >> (filter,2)) 1]; (make sure to put the reference channel last in the >> channel csd. > > Before doing it I think I will have to include Cf and Cr and Pr in > the same > matrix, but i am not sure. > Namely: csd = filter * Cf_ * ctranspose(filter) > with filt of dimensions 6X(N+1) channels after augmenting, and Cf_ > made of > the contributions of MEG channel-channels cross-variance plus the > contribution of MEG-EMG channels crossvariance Cr (column vector): > > Cf_ = [Cf,Cr;Cr' Pr]; > >> From each sandwiched csd (7x7) you should be able to extract >> anything you want. The top-left 6x6 block will contain the between >> dipole csd (diagonal 3x3 blocks contain >> the within dipole parameters from which power can be estimated: the >> off-diagonal blocks contain the between dipole csd). The bottom right >> value will contain the reference >> signal power, and the 6x1 and 1x6 remaining vectors contain the >> reference to dipole csds, in two groups of 3. The coherence can be >> estimated (according to Joachim's 2001 >> PNAS-paper) in this case by: svd( csd(1:3,7))./ sqrt(svd(csd >> (1:3,1:3)) >> *csd(7,7)); >> >> Good luck, >> >> Jan-Mathijs > > This makes sense to me, considering also the literature (Dalal et > al. 2006, > Brookes et al. 2007), but I weight equally the contributions of two > correlated dipoles, which can also have different amplitudes. > This is why maybe my simulations are not able to attenuate the main > dipole? > Best > > > Cristiano > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From thomas.hartmann at UNI-KONSTANZ.DE Fri Aug 15 16:42:32 2008 From: thomas.hartmann at UNI-KONSTANZ.DE (Thomas Hartmann) Date: Fri, 15 Aug 2008 16:42:32 +0200 Subject: reject components with less components than channels in matrix Message-ID: hi y'all! i am trying to use the ica to correct my data for artifacts. as i do an average-reference on the data prior to calculating the weights using fastica, only 63 components are computed from my 64 channels. if i then try to run componentanalysis on the real data using the former calculated weights, componentanalysis gives an error because the function expects as many components as channels in the input. i fixed this in the file. but rejectcomponent also seems to expect as many components as channels, as it tells me that it e.g. removed 2 components and kept 62, although there are only 63 components in the matrix. any help? cheers and thanks, thomas ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From enteka at HOTMAIL.COM Fri Aug 15 17:22:24 2008 From: enteka at HOTMAIL.COM (Nicolas Robitaille) Date: Fri, 15 Aug 2008 15:22:24 +0000 Subject: reject components with less components than channels in matrix In-Reply-To: <48A595D8.6080706@uni-konstanz.de> Message-ID: Hi Thomas I ran into the same kind of problem running PCA reduction in binica. I end up with an unstable workaround, so I won't send it, but you may like to know that: 1- in rejectcomponent.m, the number of component is determine by the length of the comp.label list, which is created in componentanalysis.m. [line 75 of rejectcomponent.m] % determine the number of channels and the number of components Nchan = length(comp.topolabel); Ncomp = length(comp.label); I needed to fix the creation of this list, I guess you may have to. 2- In order to actually do the rejection, I created an empty square matrix (full of 0) and stick in it the components to-be-kept.: [line 99 of rejectcomponent.m] comp.topo(:,cfg.component) = 0; w = zeros(Nchan,Nchan); w(:,1:Ncomp) = comp.topo; for ii=1:ntrials data.trial(ii,:,:) = w * squeeze(data.trial(ii,:,:)); end Hope this help Nic ************************************ Nicolas Robitaille, candidat Ph.D Département de Psychologie Université de Montréal C.P. 6128, succursale Centre-ville Montréal, Québec H3C 3J7 Tel.: 514-343-6111 x2631 Fax: 514-343-5787 ************************************ > Date: Fri, 15 Aug 2008 16:42:32 +0200 > From: thomas.hartmann at UNI-KONSTANZ.DE > Subject: [FIELDTRIP] reject components with less components than channels in matrix > To: FIELDTRIP at NIC.SURFNET.NL > > hi y'all! > > i am trying to use the ica to correct my data for artifacts. as i do an > average-reference on the data prior to calculating the weights using > fastica, only 63 components are computed from my 64 channels. > > if i then try to run componentanalysis on the real data using the former > calculated weights, componentanalysis gives an error because the > function expects as many components as channels in the input. > > i fixed this in the file. but rejectcomponent also seems to expect as > many components as channels, as it tells me that it e.g. removed 2 > components and kept 62, although there are only 63 components in the matrix. > > any help? > > cheers and thanks, > thomas > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. _________________________________________________________________ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From amrgermany at YAHOO.COM Sat Aug 16 12:02:20 2008 From: amrgermany at YAHOO.COM (A. Ayoub) Date: Sat, 16 Aug 2008 12:02:20 +0200 Subject: Fieldtrip-0.9.7 Mapping CTF151 Message-ID: Hello, I am trying to map CTF151 MEG data using the electrode position option. The result is rotated 90 degrees clock wise with respect to the nose. The rotation was confirmed by plotting the layout. It looks something went wrong in stereographic projection. Is there a way around this bug? Best regards, Amr PS: I have used topoplotER.m which intern calls createlayout.m ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From dsenkows at UKE.DE Mon Aug 18 13:36:17 2008 From: dsenkows at UKE.DE (Daniel Senkowski) Date: Mon, 18 Aug 2008 13:36:17 +0200 Subject: setfield issue and sourcestatistics Message-ID: Hi, I am trying to run the sourcestatistic.m script on the ouput files from sourcegrandaverage.m and receive an error message with refers to the setfield and setsubfield scripts. Did anyone had similar issues or has an idea how to solve it? Thank you very much and best greetings, Daniel >> test test = pos: [11466x3 double] dim: [21 26 21] transform: [4x4 double] avg: [1x1 struct] var: [1x1 struct] dimord: 'voxel' trial: [1x16 struct] inside: [5759x1 double] outside: [5707x1 double] df: [11466x1 double] cfg: [1x1 struct] >> test.trial ans = 1x16 struct array with fields: pow >> test2 test2 = pos: [11466x3 double] dim: [21 26 21] transform: [4x4 double] avg: [1x1 struct] var: [1x1 struct] dimord: 'voxel' trial: [1x16 struct] inside: [5759x1 double] outside: [5707x1 double] df: [11466x1 double] cfg: [1x1 struct] >> cfg = []; cfg.method = 'parametric'; cfg.statistic = 'difference'; cfg.parameter = 'pow'; cfg.bonferoni = 'no'; cfg.threshold = 0.05; stat = sourcestatistics(cfg, test, test2); ??? Error using ==> setfield at 58 Insufficient outputs from right hand side to satisfy comma separated list expansion on left hand side. Missing [] are the most likely cause. Error in ==> setsubfield at 33 s = setfield(s, t{:}, v); Error in ==> checkdata at 403 data = setsubfield(data, param{i}, tmp); Error in ==> sourcestatistics at 113 varargin{i} = checkdata(varargin{i}, 'datatype', {'source', 'volume'}, 'feedback', 'no', 'inside', 'index'); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Wed Aug 20 21:03:40 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Wed, 20 Aug 2008 21:03:40 +0200 Subject: setfield issue and sourcestatistics In-Reply-To: Message-ID: Dear Daniel, The problem was hard to track down, but I noticed that an easy workaround can be achieved, when you remove the .transform field from your grandaveraged source (test = rmfield(test, 'transform'); Alternatively, you can download the latest version of fieldtrip (available as of tomorrow) in which I (hopefully) fixed the problem. Yours, JM PS: Robert, maybe we could discuss this issue, because this is due to recent changes which were made to make the difference between volumetric and source-metric data more explicit. On Aug 18, 2008, at 1:36 PM, Daniel Senkowski wrote: > Hi, > > I am trying to run the sourcestatistic.m script on the ouput files > from > sourcegrandaverage.m and receive an error message with refers to the > setfield and setsubfield scripts. > > Did anyone had similar issues or has an idea how to solve it? > > Thank you very much and best greetings, > > Daniel > > > >>> test > > test = > > pos: [11466x3 double] > dim: [21 26 21] > transform: [4x4 double] > avg: [1x1 struct] > var: [1x1 struct] > dimord: 'voxel' > trial: [1x16 struct] > inside: [5759x1 double] > outside: [5707x1 double] > df: [11466x1 double] > cfg: [1x1 struct] > >>> test.trial > > ans = > > 1x16 struct array with fields: > pow > > >>> test2 > > test2 = > > pos: [11466x3 double] > dim: [21 26 21] > transform: [4x4 double] > avg: [1x1 struct] > var: [1x1 struct] > dimord: 'voxel' > trial: [1x16 struct] > inside: [5759x1 double] > outside: [5707x1 double] > df: [11466x1 double] > cfg: [1x1 struct] > >>> cfg = []; > cfg.method = 'parametric'; > cfg.statistic = 'difference'; > cfg.parameter = 'pow'; > cfg.bonferoni = 'no'; > cfg.threshold = 0.05; > > stat = sourcestatistics(cfg, test, test2); > ??? Error using ==> setfield at 58 > Insufficient outputs from right hand side to satisfy comma separated > list expansion on left hand side. Missing [] are the most likely > cause. > > Error in ==> setsubfield at 33 > s = setfield(s, t{:}, v); > > Error in ==> checkdata at 403 > data = setsubfield(data, param{i}, tmp); > > Error in ==> sourcestatistics at 113 > varargin{i} = checkdata(varargin{i}, 'datatype', {'source', > 'volume'}, > 'feedback', 'no', 'inside', 'index'); > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From alihena_ at HOTMAIL.COM Wed Aug 27 15:40:31 2008 From: alihena_ at HOTMAIL.COM (A. Rodrigo) Date: Wed, 27 Aug 2008 15:40:31 +0200 Subject: Problems with volumesegment Message-ID: Hi, When I run >> mri = read_fcdc_mri('Subject01.mri'); cfg = []; cfg.write = 'no'; cfg.coordinates = 'ctf'; [segmentedmri] = volumesegment(cfg, mri); The error message is : ??? Error using ==> spm_create_vol>create_vol "dim" field is the wrong size (1 4). Error in ==> spm_create_vol at 16 v = create_vol(V(i)); Error in ==> fieldtrip-20080511\private\volumewrite_spm at 61 Va = spm_create_vol(Va); Error in ==> volumesegment at 226 Va = volumewrite_spm([cfg.name,'.img'], mri.anatomy, mri.transform); Can you help me? Thanks a lot. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From K.Nazarpour at BHAM.AC.UK Wed Aug 27 17:21:20 2008 From: K.Nazarpour at BHAM.AC.UK (Kianoush Nazarpour) Date: Wed, 27 Aug 2008 16:21:20 +0100 Subject: Problems with volumesegment In-Reply-To: Message-ID: Hello there, This problem is so strange. Basically, as I understood all depends on your Matlab Version and SPM. I used 5 different versions of Matlab to get it work. The easiest solution sould be using MATLAB Version 7.2.0.232 (R2006a) along with the original SPM2 (without using the SPM2_updates files). Hope that helps, Kia ------------------------------------- Kianoush Nazarpour Research Fellow Behavioural Brain Sciences School of Psychology, University of Birmingham, Birmingham B15 2TT UK Tel: +44 121 414 7201 Email: K.Nazarpour at bham.ac.uk Web: http://prism.bham.ac.uk/~nazarpok A. Rodrigo wrote: > Hi, > > When I run >>> mri = read_fcdc_mri('Subject01.mri'); > cfg = []; > cfg.write = 'no'; > cfg.coordinates = 'ctf'; > [segmentedmri] = volumesegment(cfg, mri); > > The error message is : > > ??? Error using ==> spm_create_vol>create_vol > "dim" field is the wrong size (1 4). > > Error in ==> spm_create_vol at 16 > v = create_vol(V(i)); > > Error in ==> fieldtrip-20080511\private\volumewrite_spm at 61 > Va = spm_create_vol(Va); > > Error in ==> volumesegment at 226 > Va = volumewrite_spm([cfg.name,'.img'], mri.anatomy, mri.transform); > > > > Can you help me? Thanks a lot. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From dsenkows at UKE.DE Wed Aug 27 17:43:44 2008 From: dsenkows at UKE.DE (Daniel Senkowski) Date: Wed, 27 Aug 2008 17:43:44 +0200 Subject: topoplotER and timelockstatistics output Message-ID: Dear all, I am receiving a "Index exceeds matrix dimensions" error message when trying to plot the output (e.g., stat.mask) of the cluster-based non-parametric statistic and the very last value of the stat.mask is a "1". Temporarily, this problem could be solved when setting the last value to "0" (e.g., stat.mask(274) = 0). Regards, Daniel >> cfg = []; cfg.style = 'blank'; cfg.layout = '/home/senk/PROGRAMS/fieldtrip-20080826/CTF274.lay'; cfg.highlight = find(stat.mask); cfg.comment = 'no'; figure; topoplotER(cfg, GA19_ERF_P) title('Nonparametric: significant with cluster multiple comparison correction') reading layout from file /home/senk/PROGRAMS/fieldtrip-20080826/CTF274.lay ??? Index exceeds matrix dimensions. Error in ==> topoplot at 549 hp2 = plot(y(cfg.highlight), x(cfg.highlight), cfg.hlmarker, 'Color', cfg.hlcolor, 'markersize', cfg.hlmarkersize, ... Error in ==> topoplotER at 371 topoplot(tmpcfg,chanX,chanY,datavector,chanLabels); >> stat stat = prob: [274x1 double] posclusters: [1x2 struct] posclusterslabelmat: [274x1 double] posdistribution: [1x100 double] negclusters: [] negclusterslabelmat: [274x1 double] negdistribution: [1x100 double] mask: [274x1 logical] stat: [274x1 double] dimord: 'chan' label: {274x1 cell} cfg: [1x1 struct] >> stat.mask(274) = 0; ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip.