From tyler.grummett at flinders.edu.au Tue Apr 1 01:58:45 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 31 Mar 2014 23:58:45 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <533985D8.4080504@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>,<533985D8.4080504@donders.ru.nl> Message-ID: <2573399203ce4b8481d629d08994337a@SIXPR03MB368.apcprd03.prod.outlook.com> Hey Jorn, I am still getting an error when running ft_sourceanalysis. Ill try and give you the full picture of what I am doing. 1. coming from eeglab to fieldtrip: % convert to fieldtrip process = 'componentanalysis'; data = eeglab2fieldtrip( EEG, process, 'none'); data = label: {1x121 cell} fsample: 500 elec: [1x1 struct] trial: {[121x19767 single]} time: {[1x19767 double]} topolabel: {1x121 cell} topo: [121x121 double] cfg: [1x1 struct] 2. Calculate timelock analysis % calculating the timelock analysis cfg = []; % cfg.channel = 'EEG'; % for some reason it crashes the % beamformer cfg.vartrllength = 2; % accept variable length trials cfg.covariance = 'yes'; cfg.covariancewindow = 'all'; % cfg.channel = data.label; timelock = ft_timelockanalysis(cfg, data); timelock = avg: [121x19767 double] var: [121x19767 double] time: [1x19767 double] dof: [121x19767 double] label: {1x121 cell} dimord: 'chan_time' cov: [121x121 double] elec: [1x1 struct] cfg: [1x1 struct] 3. Calculate head model % the forward model and lead field matrix mri = ft_read_mri( 'Subject01.mri'); cfg = []; cfg.write = 'no'; cfg.coordsys = 'ctf'; segmentedmri = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'concentricspheres'; vol = ft_prepare_headmodel(cfg, segmentedmri); vol = unit: 'mm' r: 69.8077 o: [19.2853 1.2231 54.6031] cond: 1 type: 'concentricspheres' cfg: [1x1 struct] 4. Compute lead field % compute lead field ( apparently source analysis computes % lead field anyway cfg = []; cfg.elec = timelock.elec; cfg.vol = vol; cfg.reducerank = 3; cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution cfg.grid.unit = 'cm'; cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window grid = ft_prepare_leadfield( cfg); grid = xgrid: [-5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8] ygrid: [-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7] zgrid: [-1 0 1 2 3 4 5 6 7 8 9 10 11 12] dim: [14 14 14] pos: [2744x3 double] unit: 'cm' inside: [1x1430 double] outside: [1x1314 double] cfg: [1x1 struct] leadfield: {1x2744 cell} 5. Compute ft_source analysis % Source Analysis: without contrasting condition cfg = []; cfg.method = 'lcmv'; cfg.grid = grid; cfg.vol = vol; % cfg.grid.pos = 'maxpos'; cfg.keepfilter = 'yes'; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = 0; source = ft_sourceanalysis( cfg, timelock); It crashes with the following error: Error using * Inner matrix dimensions must agree. Error in beamformer_lcmv (line 268) filt = pinv(lf' * invCy * lf) * lf' * invCy; % van Veen eqn. 23, use PINV/SVD to cover rank deficient leadfield Error in ft_sourceanalysis (line 794) dip(i) = beamformer_lcmv(grid, sens, vol, squeeze_avg, squeeze(Cy(i,:,:)), optarg{:}); Please note that fieldtrip is up to date. Can you see an error? I will trying looking in the tutorials again. Also, did you want a segment of my data to see if you can get it working? ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" Sent: Tuesday, 1 April 2014 1:42 AM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot just to clarify and be precise > The pos-matrix has to be a regular 3D grid, i.e. be representable as a > 3x3x3 matrix. it actually does not have to be as you can also beam individual grid points, but if you have a .dim field, then is has to be like above. But that does not affect the rest of the mail I wrote ;) > I am not quite sure how the sourceinterpolate function is handeling > the fact that you do not have that .dim field. Apparently, it is also > confused ;) > > Do you want to reconstruct only some voxels? From your code it seems > that you want to cover the whole brain with a 1cm resolution. If the > latter is the case, maybe restart with creating your forward model by > following the tutorial that I posted in my previous mail. There are > some sanity checks that can help you figuring out if you are doing the > correct thing. If the former one is the case, please explain again > what exactly you want to achieve and how you are building your forward > model. > > Best, > Jörn > > btw, there's nothing wrong with being a PhD student, it's just a > matter of experience in practice and theory as in all domains in life ;) > > > On 3/31/2014 3:15 PM, Tyler Grummett wrote: >> Hey Jorn, >> >> Yes I am definitely confused haha, this stuff is way out of my league >> as a PhD student. >> Anyway, I feel we are getting somewhere. >> >> timelock = >> >> avg: [121x19767 double] >> var: [121x19767 double] >> time: [1x19767 double] >> dof: [121x19767 double] >> label: {1x121 cell} >> dimord: 'chan_time' >> cov: [121x121 double] >> elec: [1x1 struct] >> cfg: [1x1 struct] >> >> source = >> >> time: [1x19767 double] >> pos: [642x3 double] >> inside: [642x1 double] >> outside: [] >> method: 'average' >> avg: [1x1 struct] >> cfg: [1x1 struct] >> >> sourceInt = >> >> time: [1x19767 double] >> avg: [1x1 struct] >> pos: [16777216x3 double] >> dim: [256 256 256] >> inside: [1x16777216 double] >> outside: [1x0 double] >> coordsys: 'ctf' >> unit: 'mm' >> cfg: [1x1 struct] >> >> Given what I said last time, I might not comment on the differences. >> I hope you can see something wrong. >> >> One thing I should mention is that the data is continuous, around 30 >> seconds. Therefore there is only one trial, >> is that an issue? >> >> Tyler >> >> ************************* >> >> Tyler Grummett ( BBSc, BSc(Hons I)) >> PhD Candidate >> Brain Signals Laboratory >> Flinders University >> Rm 5A301 >> Ext 66124 >> >> ________________________________________ >> From: fieldtrip-bounces at science.ru.nl >> on behalf of "Jörn M. Horschig" >> >> Sent: Monday, 31 March 2014 10:24 PM >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] plotting interpolated sources with >> ft_sourceplot >> >> Hi Tyler, >> >> there is not much inherently different between time- and >> freuqency-domain beamformer, at least in terms of computing the forward >> and the inverse solution. But I see that you are obviously confused, so >> let me try to help you out and shed some light on what you are actually >> doing ;) >> >> >>> I had a look at my variables. >>> >>> source.avg = >>> >>> pow: [642x1 double] >>> filter: {642x1 cell} >>> >>> sourceInt.avg = >>> >>> pow: [16777216x1 double] >>> >>> So clearly, as both variables are completely different. Something >>> has gone wrong. >> No, that is actually how it should be. From below you can see that your >> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >> 16777216 elements. In line with source.avg.pow, you should see that your >> 'grid' consists of 642 elements, so you were computing your source >> activity on a grid of in total 642 elements. Then you used the original >> MRI to interpolate from 642 to these 16 million grid points. Actually, >> since you specific cfg.downsample = 2, it should have been only 8 >> million points, so that's where things already get a bit weird. >> >> So let's go into some sanity checks: >> 1. are you using the latest version (or a recent, i.e. from this year) >> of FielTrip? >> 2. sourceInt should look something like this, does it? >> >> source_diff_int = >> inside: [46x55x46 logical] >> avg: [1x1 struct] >> dim: [46 55 46] >> transform: [4x4 double] >> anatomy: [46x55x46 double] >> unit: 'mm' >> cfg: [1x1 struct] >> >> >> >> 3. source should look something like this: >> >> source = >> dim: [20 25 22] >> freq: 54.8287 >> cumtapcnt: [338x1 double] >> pos: [11000x3 double] >> inside: [1x5798 double] >> outside: [1x5202 double] >> method: 'average' >> avg: [1x1 struct] >> trialinfo: [338x1 double] >> cfg: [1x1 struct] >> >> 4. also check your grid, should be something like this: >> >> sourcemodel = >> >> pos: [11000x3 double] >> dim: [20 25 22] >> unit: 'cm' >> inside: [1x5798 double] >> outside: [1x5202 double] >> params: [1x1 struct] >> initial: [4x4 double] >> cfg: [1x1 struct] >> >> >> Of course, it should all look a bit different, because you are using >> LCMV, but essentially it should be the same. Lastly, you can check other >> source plotting methods, like 'ortho' or try to plot the source >> structure rather than the sourceInt structure. In the end, the error >> must be somewhere in your grid, be it in .pos or .inside, because >> FieldTrip thinks that there is only one voxel to be plotted. There are >> other things that may be the issue, but I am not sure about these. So, I >> would suggest that you play a bit around and see where the error might >> come from (e.g. follow this tutorial: >> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >> steps that you need for LCMV, maybe also check out: >> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >> >> there, LCMV is used, but on one voxel only) >> >> Best, >> Jörn >> >>> The next part of my code is the following: >>> >>> % interpolate sources >>> mri = ft_read_mri('Subject01.mri'); >>> mri = ft_volumereslice([], mri); >>> >>> cfg = []; >>> cfg.downsample = 2; >>> cfg.parameter = 'avg.pow'; >>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>> parameter >>> % does not vary over time, therefore the time >>> dimension is not needed. >>> >>> mri = >>> >>> anatomy: [256x256x256 double] >>> dim: [256 256 256] >>> transform: [4x4 double] >>> coordsys: 'ctf' >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> I cant really see if the data works in the tutorial because it >>> doesnt appear as though fieldtrip has a tutorial on lcmv >>> beamformers, they seem to stick to frequency domain beamformers. >>> >>> Ive been wrong before though, >>> >>> thanks for your help. >>> >>> Tyler >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl >>> on behalf of "Jörn M. Horschig" >>> >>> Sent: Monday, 31 March 2014 7:13 PM >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting interpolated sources with >>> ft_sourceplot >>> >>> Hi Tyler, >>> >>> hm, okay, it could be that the issue with the leadfield and with the >>> plot are related, but it could also be that they are separate issues. I >>> just saw that you posted the same 'problem' on bugzilla and included a >>> picture. Maybe for next time, include a picture on the mailinglist and >>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>> and not if you are not sure. That saves us a lot of time in separating >>> code issues from user problems ;) >>> >>> So, back to you problem. It seems that your reconstruction results in >>> one voxel only. Are you sure that your grid consistents of more than >>> just one position? So, for example check the size of the matrices in >>> source.avg, source- and headmodel, etc. >>> >>> Also, you can check in Matlab the respective fields of source and >>> sourceInt and see whether that makes sense. >>> >>> Lastly, a neat way to check is always to use your code on data from the >>> tutorial, and vice versa, use code from the tutorial on your data and >>> see whether that works. Both should give sensible results, and if one >>> does not, you know where to start looking for a solution ;) >>> >>> Best, >>> Jörn >>> >>> >>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>> Hey Jorn, >>>> >>>> Previously I have let ft_sourceanalysis do a lead field because if >>>> I use the following code: >>>> >>>> % compute lead field ( apparently source analysis computes >>>> % lead field anyway >>>> cfg = []; >>>> cfg.elec = timelock.elec; >>>> cfg.vol = vol; >>>> cfg.reducerank = 3; >>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>> cm resolution >>>> cfg.grid.unit = 'cm'; >>>> cfg.normalize = 'yes'; % if you are not >>>> contrasting the activity of interest again another condition or >>>> baseline time-window >>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>> I AM UP TO >>>> >>>> and then calculate the source analysis: >>>> >>>> % Source Analysis: without contrasting condition >>>> cfg = []; >>>> cfg.method = 'lcmv'; >>>> cfg.grid = grid; >>>> cfg.vol = vol; >>>> % cfg.grid.pos = maxpos; >>>> cfg.keepfilter = 'yes'; >>>> cfg.dics.projectnoise = 'yes'; >>>> % cfg.dics.lambda = 0; >>>> source = ft_sourceanalysis( cfg, timelock); >>>> >>>> then I get an error than says: >>>> >>>> Error using * >>>> Inner matrix dimensions must agree. >>>> >>>> Error in beamformer_lcmv (line 268) >>>> filt = pinv(lf' * invCy * lf) * lf' * >>>> invCy; % van Veen eqn. 23, use >>>> PINV/SVD to cover rank deficient leadfield >>>> >>>> Error in ft_sourceanalysis (line 794) >>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>> optarg{:}); >>>> >>>> I just removed the leadfield code and it successfully ran. I could >>>> also interpolate it later. >>>> Is this the correct approach. >>>> >>>> Thankyou in advance! >>>> >>>> Tyler >>>> >>>> ************************* >>>> >>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>> PhD Candidate >>>> Brain Signals Laboratory >>>> Flinders University >>>> Rm 5A301 >>>> Ext 66124 >>>> >>>> ________________________________________ >>>> From: fieldtrip-bounces at science.ru.nl >>>> on behalf of "Jörn M. Horschig" >>>> >>>> Sent: Monday, 31 March 2014 5:30 PM >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>> ft_sourceplot >>>> >>>> Hi Tyler, >>>> >>>> what you are describing sounds to me like the center bias of the >>>> beamformer. Did you contrast the activity with anything, or did you >>>> normalize your leadfield? >>>> Check this out: >>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>> >>>> >>>> Best, >>>> Jörn >>>> >>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>> I have been trying to plot my interpolated source data using the >>>>> code: >>>>> >>>>> % interpolate sources >>>>> mri = ft_read_mri('Subject01.mri'); >>>>> mri = ft_volumereslice([], mri); >>>>> cfg = []; >>>>> cfg.downsample = 2; >>>>> cfg.parameter = 'avg.pow'; >>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>> parameter >>>>> % does not vary over time, therefore the time >>>>> dimension >>>>> is not needed. >>>>> >>>>> % Plot interpolated data >>>>> cfg = []; %#ok >>>>> cfg.method = 'ortho'; % spline >>>>> cfg.funparameter = 'avg.pow'; >>>>> ft_sourceplot( cfg, sourceInt); >>>>> >>>>> However the figure that comes up just had orange squares in the >>>>> subplots. >>>>> >>>>> I dont know where Ive gone wrong. >>>>> >>>>> >>>>> Tyler >>>>> >>>>> >>>>> ************************* >>>>> >>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>> /PhD Candidate/ >>>>> /Brain Signals Laboratory/ >>>>> /Flinders University/ >>>>> /Rm 5A301/ >>>>> /Ext 66124/ >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> -- >>>> Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tyler.grummett at flinders.edu.au Tue Apr 1 08:15:11 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 1 Apr 2014 06:15:11 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <533985D8.4080504@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>,<533985D8.4080504@donders.ru.nl> Message-ID: Hey Jorn, In addition to my previous emails, Ive been trying to debug the functions. In ft_sourceanalysis, line 661 to 677: % HACK: use the default code % select the channels of interest [dum, datchanindx] = match_str(cfg.channel, data.label); if strcmp(data.dimord, 'chan_time') % It is in principle possible to have timelockanalysis with % keeptrial=yes and only a single trial in the raw data. % In that case the covariance should be represented as Nchan*Nchan data.avg = data.avg(datchanindx,:); %data.cov = reshape(data.cov, length(datchanindx), length(datchanindx)); data.cov = data.cov(datchanindx,datchanindx); else data.avg = data.avg(datchanindx,:); data.cov = data.cov(:,datchanindx,datchanindx); data.trial = data.trial(:,datchanindx,:); end data.label = data.label(datchanindx); Nchans = length(data.label); I found that my cfg.channel is []; and the data.label is all my ICA components labelled ica_001 etc. So it is returned as a []; which means data.cov = []; I think then it will crash later parts of the code. Does this function work on ICA components? I ran the ICA in eeglab. Tyler. ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" Sent: Tuesday, 1 April 2014 1:42 AM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot just to clarify and be precise > The pos-matrix has to be a regular 3D grid, i.e. be representable as a > 3x3x3 matrix. it actually does not have to be as you can also beam individual grid points, but if you have a .dim field, then is has to be like above. But that does not affect the rest of the mail I wrote ;) > I am not quite sure how the sourceinterpolate function is handeling > the fact that you do not have that .dim field. Apparently, it is also > confused ;) > > Do you want to reconstruct only some voxels? From your code it seems > that you want to cover the whole brain with a 1cm resolution. If the > latter is the case, maybe restart with creating your forward model by > following the tutorial that I posted in my previous mail. There are > some sanity checks that can help you figuring out if you are doing the > correct thing. If the former one is the case, please explain again > what exactly you want to achieve and how you are building your forward > model. > > Best, > Jörn > > btw, there's nothing wrong with being a PhD student, it's just a > matter of experience in practice and theory as in all domains in life ;) > > > On 3/31/2014 3:15 PM, Tyler Grummett wrote: >> Hey Jorn, >> >> Yes I am definitely confused haha, this stuff is way out of my league >> as a PhD student. >> Anyway, I feel we are getting somewhere. >> >> timelock = >> >> avg: [121x19767 double] >> var: [121x19767 double] >> time: [1x19767 double] >> dof: [121x19767 double] >> label: {1x121 cell} >> dimord: 'chan_time' >> cov: [121x121 double] >> elec: [1x1 struct] >> cfg: [1x1 struct] >> >> source = >> >> time: [1x19767 double] >> pos: [642x3 double] >> inside: [642x1 double] >> outside: [] >> method: 'average' >> avg: [1x1 struct] >> cfg: [1x1 struct] >> >> sourceInt = >> >> time: [1x19767 double] >> avg: [1x1 struct] >> pos: [16777216x3 double] >> dim: [256 256 256] >> inside: [1x16777216 double] >> outside: [1x0 double] >> coordsys: 'ctf' >> unit: 'mm' >> cfg: [1x1 struct] >> >> Given what I said last time, I might not comment on the differences. >> I hope you can see something wrong. >> >> One thing I should mention is that the data is continuous, around 30 >> seconds. Therefore there is only one trial, >> is that an issue? >> >> Tyler >> >> ************************* >> >> Tyler Grummett ( BBSc, BSc(Hons I)) >> PhD Candidate >> Brain Signals Laboratory >> Flinders University >> Rm 5A301 >> Ext 66124 >> >> ________________________________________ >> From: fieldtrip-bounces at science.ru.nl >> on behalf of "Jörn M. Horschig" >> >> Sent: Monday, 31 March 2014 10:24 PM >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] plotting interpolated sources with >> ft_sourceplot >> >> Hi Tyler, >> >> there is not much inherently different between time- and >> freuqency-domain beamformer, at least in terms of computing the forward >> and the inverse solution. But I see that you are obviously confused, so >> let me try to help you out and shed some light on what you are actually >> doing ;) >> >> >>> I had a look at my variables. >>> >>> source.avg = >>> >>> pow: [642x1 double] >>> filter: {642x1 cell} >>> >>> sourceInt.avg = >>> >>> pow: [16777216x1 double] >>> >>> So clearly, as both variables are completely different. Something >>> has gone wrong. >> No, that is actually how it should be. From below you can see that your >> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >> 16777216 elements. In line with source.avg.pow, you should see that your >> 'grid' consists of 642 elements, so you were computing your source >> activity on a grid of in total 642 elements. Then you used the original >> MRI to interpolate from 642 to these 16 million grid points. Actually, >> since you specific cfg.downsample = 2, it should have been only 8 >> million points, so that's where things already get a bit weird. >> >> So let's go into some sanity checks: >> 1. are you using the latest version (or a recent, i.e. from this year) >> of FielTrip? >> 2. sourceInt should look something like this, does it? >> >> source_diff_int = >> inside: [46x55x46 logical] >> avg: [1x1 struct] >> dim: [46 55 46] >> transform: [4x4 double] >> anatomy: [46x55x46 double] >> unit: 'mm' >> cfg: [1x1 struct] >> >> >> >> 3. source should look something like this: >> >> source = >> dim: [20 25 22] >> freq: 54.8287 >> cumtapcnt: [338x1 double] >> pos: [11000x3 double] >> inside: [1x5798 double] >> outside: [1x5202 double] >> method: 'average' >> avg: [1x1 struct] >> trialinfo: [338x1 double] >> cfg: [1x1 struct] >> >> 4. also check your grid, should be something like this: >> >> sourcemodel = >> >> pos: [11000x3 double] >> dim: [20 25 22] >> unit: 'cm' >> inside: [1x5798 double] >> outside: [1x5202 double] >> params: [1x1 struct] >> initial: [4x4 double] >> cfg: [1x1 struct] >> >> >> Of course, it should all look a bit different, because you are using >> LCMV, but essentially it should be the same. Lastly, you can check other >> source plotting methods, like 'ortho' or try to plot the source >> structure rather than the sourceInt structure. In the end, the error >> must be somewhere in your grid, be it in .pos or .inside, because >> FieldTrip thinks that there is only one voxel to be plotted. There are >> other things that may be the issue, but I am not sure about these. So, I >> would suggest that you play a bit around and see where the error might >> come from (e.g. follow this tutorial: >> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >> steps that you need for LCMV, maybe also check out: >> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >> >> there, LCMV is used, but on one voxel only) >> >> Best, >> Jörn >> >>> The next part of my code is the following: >>> >>> % interpolate sources >>> mri = ft_read_mri('Subject01.mri'); >>> mri = ft_volumereslice([], mri); >>> >>> cfg = []; >>> cfg.downsample = 2; >>> cfg.parameter = 'avg.pow'; >>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>> parameter >>> % does not vary over time, therefore the time >>> dimension is not needed. >>> >>> mri = >>> >>> anatomy: [256x256x256 double] >>> dim: [256 256 256] >>> transform: [4x4 double] >>> coordsys: 'ctf' >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> I cant really see if the data works in the tutorial because it >>> doesnt appear as though fieldtrip has a tutorial on lcmv >>> beamformers, they seem to stick to frequency domain beamformers. >>> >>> Ive been wrong before though, >>> >>> thanks for your help. >>> >>> Tyler >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl >>> on behalf of "Jörn M. Horschig" >>> >>> Sent: Monday, 31 March 2014 7:13 PM >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting interpolated sources with >>> ft_sourceplot >>> >>> Hi Tyler, >>> >>> hm, okay, it could be that the issue with the leadfield and with the >>> plot are related, but it could also be that they are separate issues. I >>> just saw that you posted the same 'problem' on bugzilla and included a >>> picture. Maybe for next time, include a picture on the mailinglist and >>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>> and not if you are not sure. That saves us a lot of time in separating >>> code issues from user problems ;) >>> >>> So, back to you problem. It seems that your reconstruction results in >>> one voxel only. Are you sure that your grid consistents of more than >>> just one position? So, for example check the size of the matrices in >>> source.avg, source- and headmodel, etc. >>> >>> Also, you can check in Matlab the respective fields of source and >>> sourceInt and see whether that makes sense. >>> >>> Lastly, a neat way to check is always to use your code on data from the >>> tutorial, and vice versa, use code from the tutorial on your data and >>> see whether that works. Both should give sensible results, and if one >>> does not, you know where to start looking for a solution ;) >>> >>> Best, >>> Jörn >>> >>> >>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>> Hey Jorn, >>>> >>>> Previously I have let ft_sourceanalysis do a lead field because if >>>> I use the following code: >>>> >>>> % compute lead field ( apparently source analysis computes >>>> % lead field anyway >>>> cfg = []; >>>> cfg.elec = timelock.elec; >>>> cfg.vol = vol; >>>> cfg.reducerank = 3; >>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>> cm resolution >>>> cfg.grid.unit = 'cm'; >>>> cfg.normalize = 'yes'; % if you are not >>>> contrasting the activity of interest again another condition or >>>> baseline time-window >>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>> I AM UP TO >>>> >>>> and then calculate the source analysis: >>>> >>>> % Source Analysis: without contrasting condition >>>> cfg = []; >>>> cfg.method = 'lcmv'; >>>> cfg.grid = grid; >>>> cfg.vol = vol; >>>> % cfg.grid.pos = maxpos; >>>> cfg.keepfilter = 'yes'; >>>> cfg.dics.projectnoise = 'yes'; >>>> % cfg.dics.lambda = 0; >>>> source = ft_sourceanalysis( cfg, timelock); >>>> >>>> then I get an error than says: >>>> >>>> Error using * >>>> Inner matrix dimensions must agree. >>>> >>>> Error in beamformer_lcmv (line 268) >>>> filt = pinv(lf' * invCy * lf) * lf' * >>>> invCy; % van Veen eqn. 23, use >>>> PINV/SVD to cover rank deficient leadfield >>>> >>>> Error in ft_sourceanalysis (line 794) >>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>> optarg{:}); >>>> >>>> I just removed the leadfield code and it successfully ran. I could >>>> also interpolate it later. >>>> Is this the correct approach. >>>> >>>> Thankyou in advance! >>>> >>>> Tyler >>>> >>>> ************************* >>>> >>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>> PhD Candidate >>>> Brain Signals Laboratory >>>> Flinders University >>>> Rm 5A301 >>>> Ext 66124 >>>> >>>> ________________________________________ >>>> From: fieldtrip-bounces at science.ru.nl >>>> on behalf of "Jörn M. Horschig" >>>> >>>> Sent: Monday, 31 March 2014 5:30 PM >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>> ft_sourceplot >>>> >>>> Hi Tyler, >>>> >>>> what you are describing sounds to me like the center bias of the >>>> beamformer. Did you contrast the activity with anything, or did you >>>> normalize your leadfield? >>>> Check this out: >>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>> >>>> >>>> Best, >>>> Jörn >>>> >>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>> I have been trying to plot my interpolated source data using the >>>>> code: >>>>> >>>>> % interpolate sources >>>>> mri = ft_read_mri('Subject01.mri'); >>>>> mri = ft_volumereslice([], mri); >>>>> cfg = []; >>>>> cfg.downsample = 2; >>>>> cfg.parameter = 'avg.pow'; >>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>> parameter >>>>> % does not vary over time, therefore the time >>>>> dimension >>>>> is not needed. >>>>> >>>>> % Plot interpolated data >>>>> cfg = []; %#ok >>>>> cfg.method = 'ortho'; % spline >>>>> cfg.funparameter = 'avg.pow'; >>>>> ft_sourceplot( cfg, sourceInt); >>>>> >>>>> However the figure that comes up just had orange squares in the >>>>> subplots. >>>>> >>>>> I dont know where Ive gone wrong. >>>>> >>>>> >>>>> Tyler >>>>> >>>>> >>>>> ************************* >>>>> >>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>> /PhD Candidate/ >>>>> /Brain Signals Laboratory/ >>>>> /Flinders University/ >>>>> /Rm 5A301/ >>>>> /Ext 66124/ >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> -- >>>> Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jm.horschig at donders.ru.nl Tue Apr 1 08:17:56 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 01 Apr 2014 08:17:56 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <2573399203ce4b8481d629d08994337a@SIXPR03MB368.apcprd03.prod.outlook.com> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>, <533985D8.4080504@donders.ru.nl> <2573399203ce4b8481d629d08994337a@SIXPR03MB368.apcprd03.prod.outlook.com> Message-ID: <533A5A14.4060700@donders.ru.nl> Hi Tyler, the leadfield matrix contains by design no channel labels, and I think that FieldTrip assumes that the elements of the leadfield coincides with the elements of the channel. I guess you can avoid the error you get by setting cfg.channel = data.label; when computing the leadfield. You could try that, otherwise your code looks fine. Best, Jörn On 4/1/2014 1:58 AM, Tyler Grummett wrote: > Hey Jorn, > > I am still getting an error when running ft_sourceanalysis. Ill try and give you the full picture of what I am doing. > > 1. coming from eeglab to fieldtrip: > > % convert to fieldtrip > process = 'componentanalysis'; > data = eeglab2fieldtrip( EEG, process, 'none'); > > data = > > label: {1x121 cell} > fsample: 500 > elec: [1x1 struct] > trial: {[121x19767 single]} > time: {[1x19767 double]} > topolabel: {1x121 cell} > topo: [121x121 double] > cfg: [1x1 struct] > > 2. Calculate timelock analysis > > % calculating the timelock analysis > cfg = []; > % cfg.channel = 'EEG'; % for some reason it crashes the > % beamformer > cfg.vartrllength = 2; % accept variable length trials > cfg.covariance = 'yes'; > cfg.covariancewindow = 'all'; > % cfg.channel = data.label; > timelock = ft_timelockanalysis(cfg, data); > > timelock = > > avg: [121x19767 double] > var: [121x19767 double] > time: [1x19767 double] > dof: [121x19767 double] > label: {1x121 cell} > dimord: 'chan_time' > cov: [121x121 double] > elec: [1x1 struct] > cfg: [1x1 struct] > > 3. Calculate head model > > % the forward model and lead field matrix > mri = ft_read_mri( 'Subject01.mri'); > cfg = []; > cfg.write = 'no'; > cfg.coordsys = 'ctf'; > segmentedmri = ft_volumesegment(cfg, mri); > > cfg = []; > cfg.method = 'concentricspheres'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > vol = > > unit: 'mm' > r: 69.8077 > o: [19.2853 1.2231 54.6031] > cond: 1 > type: 'concentricspheres' > cfg: [1x1 struct] > > 4. Compute lead field > > % compute lead field ( apparently source analysis computes > % lead field anyway > cfg = []; > cfg.elec = timelock.elec; > cfg.vol = vol; > cfg.reducerank = 3; > cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution > cfg.grid.unit = 'cm'; > cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window > grid = ft_prepare_leadfield( cfg); > > grid = > > xgrid: [-5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8] > ygrid: [-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7] > zgrid: [-1 0 1 2 3 4 5 6 7 8 9 10 11 12] > dim: [14 14 14] > pos: [2744x3 double] > unit: 'cm' > inside: [1x1430 double] > outside: [1x1314 double] > cfg: [1x1 struct] > leadfield: {1x2744 cell} > > 5. Compute ft_source analysis > > % Source Analysis: without contrasting condition > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = grid; > cfg.vol = vol; > % cfg.grid.pos = 'maxpos'; > cfg.keepfilter = 'yes'; > cfg.dics.projectnoise = 'yes'; > cfg.dics.lambda = 0; > source = ft_sourceanalysis( cfg, timelock); > > It crashes with the following error: > > Error using * > Inner matrix dimensions must agree. > > Error in beamformer_lcmv (line 268) > filt = pinv(lf' * invCy * lf) * lf' * invCy; > % van Veen eqn. 23, use PINV/SVD to cover rank > deficient leadfield > > Error in ft_sourceanalysis (line 794) > dip(i) = beamformer_lcmv(grid, sens, vol, > squeeze_avg, squeeze(Cy(i,:,:)), optarg{:}); > > > Please note that fieldtrip is up to date. > Can you see an error? I will trying looking in the tutorials again. > Also, did you want a segment of my data to see if you can get it working? > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" > Sent: Tuesday, 1 April 2014 1:42 AM > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot > > just to clarify and be precise >> The pos-matrix has to be a regular 3D grid, i.e. be representable as a >> 3x3x3 matrix. > it actually does not have to be as you can also beam individual grid > points, but if you have a .dim field, then is has to be like above. But > that does not affect the rest of the mail I wrote ;) > > >> I am not quite sure how the sourceinterpolate function is handeling >> the fact that you do not have that .dim field. Apparently, it is also >> confused ;) >> >> Do you want to reconstruct only some voxels? From your code it seems >> that you want to cover the whole brain with a 1cm resolution. If the >> latter is the case, maybe restart with creating your forward model by >> following the tutorial that I posted in my previous mail. There are >> some sanity checks that can help you figuring out if you are doing the >> correct thing. If the former one is the case, please explain again >> what exactly you want to achieve and how you are building your forward >> model. >> >> Best, >> Jörn >> >> btw, there's nothing wrong with being a PhD student, it's just a >> matter of experience in practice and theory as in all domains in life ;) >> >> >> On 3/31/2014 3:15 PM, Tyler Grummett wrote: >>> Hey Jorn, >>> >>> Yes I am definitely confused haha, this stuff is way out of my league >>> as a PhD student. >>> Anyway, I feel we are getting somewhere. >>> >>> timelock = >>> >>> avg: [121x19767 double] >>> var: [121x19767 double] >>> time: [1x19767 double] >>> dof: [121x19767 double] >>> label: {1x121 cell} >>> dimord: 'chan_time' >>> cov: [121x121 double] >>> elec: [1x1 struct] >>> cfg: [1x1 struct] >>> >>> source = >>> >>> time: [1x19767 double] >>> pos: [642x3 double] >>> inside: [642x1 double] >>> outside: [] >>> method: 'average' >>> avg: [1x1 struct] >>> cfg: [1x1 struct] >>> >>> sourceInt = >>> >>> time: [1x19767 double] >>> avg: [1x1 struct] >>> pos: [16777216x3 double] >>> dim: [256 256 256] >>> inside: [1x16777216 double] >>> outside: [1x0 double] >>> coordsys: 'ctf' >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> Given what I said last time, I might not comment on the differences. >>> I hope you can see something wrong. >>> >>> One thing I should mention is that the data is continuous, around 30 >>> seconds. Therefore there is only one trial, >>> is that an issue? >>> >>> Tyler >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl >>> on behalf of "Jörn M. Horschig" >>> >>> Sent: Monday, 31 March 2014 10:24 PM >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting interpolated sources with >>> ft_sourceplot >>> >>> Hi Tyler, >>> >>> there is not much inherently different between time- and >>> freuqency-domain beamformer, at least in terms of computing the forward >>> and the inverse solution. But I see that you are obviously confused, so >>> let me try to help you out and shed some light on what you are actually >>> doing ;) >>> >>> >>>> I had a look at my variables. >>>> >>>> source.avg = >>>> >>>> pow: [642x1 double] >>>> filter: {642x1 cell} >>>> >>>> sourceInt.avg = >>>> >>>> pow: [16777216x1 double] >>>> >>>> So clearly, as both variables are completely different. Something >>>> has gone wrong. >>> No, that is actually how it should be. From below you can see that your >>> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >>> 16777216 elements. In line with source.avg.pow, you should see that your >>> 'grid' consists of 642 elements, so you were computing your source >>> activity on a grid of in total 642 elements. Then you used the original >>> MRI to interpolate from 642 to these 16 million grid points. Actually, >>> since you specific cfg.downsample = 2, it should have been only 8 >>> million points, so that's where things already get a bit weird. >>> >>> So let's go into some sanity checks: >>> 1. are you using the latest version (or a recent, i.e. from this year) >>> of FielTrip? >>> 2. sourceInt should look something like this, does it? >>> >>> source_diff_int = >>> inside: [46x55x46 logical] >>> avg: [1x1 struct] >>> dim: [46 55 46] >>> transform: [4x4 double] >>> anatomy: [46x55x46 double] >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> >>> >>> 3. source should look something like this: >>> >>> source = >>> dim: [20 25 22] >>> freq: 54.8287 >>> cumtapcnt: [338x1 double] >>> pos: [11000x3 double] >>> inside: [1x5798 double] >>> outside: [1x5202 double] >>> method: 'average' >>> avg: [1x1 struct] >>> trialinfo: [338x1 double] >>> cfg: [1x1 struct] >>> >>> 4. also check your grid, should be something like this: >>> >>> sourcemodel = >>> >>> pos: [11000x3 double] >>> dim: [20 25 22] >>> unit: 'cm' >>> inside: [1x5798 double] >>> outside: [1x5202 double] >>> params: [1x1 struct] >>> initial: [4x4 double] >>> cfg: [1x1 struct] >>> >>> >>> Of course, it should all look a bit different, because you are using >>> LCMV, but essentially it should be the same. Lastly, you can check other >>> source plotting methods, like 'ortho' or try to plot the source >>> structure rather than the sourceInt structure. In the end, the error >>> must be somewhere in your grid, be it in .pos or .inside, because >>> FieldTrip thinks that there is only one voxel to be plotted. There are >>> other things that may be the issue, but I am not sure about these. So, I >>> would suggest that you play a bit around and see where the error might >>> come from (e.g. follow this tutorial: >>> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >>> steps that you need for LCMV, maybe also check out: >>> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >>> >>> there, LCMV is used, but on one voxel only) >>> >>> Best, >>> Jörn >>> >>>> The next part of my code is the following: >>>> >>>> % interpolate sources >>>> mri = ft_read_mri('Subject01.mri'); >>>> mri = ft_volumereslice([], mri); >>>> >>>> cfg = []; >>>> cfg.downsample = 2; >>>> cfg.parameter = 'avg.pow'; >>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>> parameter >>>> % does not vary over time, therefore the time >>>> dimension is not needed. >>>> >>>> mri = >>>> >>>> anatomy: [256x256x256 double] >>>> dim: [256 256 256] >>>> transform: [4x4 double] >>>> coordsys: 'ctf' >>>> unit: 'mm' >>>> cfg: [1x1 struct] >>>> >>>> I cant really see if the data works in the tutorial because it >>>> doesnt appear as though fieldtrip has a tutorial on lcmv >>>> beamformers, they seem to stick to frequency domain beamformers. >>>> >>>> Ive been wrong before though, >>>> >>>> thanks for your help. >>>> >>>> Tyler >>>> >>>> ************************* >>>> >>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>> PhD Candidate >>>> Brain Signals Laboratory >>>> Flinders University >>>> Rm 5A301 >>>> Ext 66124 >>>> >>>> ________________________________________ >>>> From: fieldtrip-bounces at science.ru.nl >>>> on behalf of "Jörn M. Horschig" >>>> >>>> Sent: Monday, 31 March 2014 7:13 PM >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>> ft_sourceplot >>>> >>>> Hi Tyler, >>>> >>>> hm, okay, it could be that the issue with the leadfield and with the >>>> plot are related, but it could also be that they are separate issues. I >>>> just saw that you posted the same 'problem' on bugzilla and included a >>>> picture. Maybe for next time, include a picture on the mailinglist and >>>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>>> and not if you are not sure. That saves us a lot of time in separating >>>> code issues from user problems ;) >>>> >>>> So, back to you problem. It seems that your reconstruction results in >>>> one voxel only. Are you sure that your grid consistents of more than >>>> just one position? So, for example check the size of the matrices in >>>> source.avg, source- and headmodel, etc. >>>> >>>> Also, you can check in Matlab the respective fields of source and >>>> sourceInt and see whether that makes sense. >>>> >>>> Lastly, a neat way to check is always to use your code on data from the >>>> tutorial, and vice versa, use code from the tutorial on your data and >>>> see whether that works. Both should give sensible results, and if one >>>> does not, you know where to start looking for a solution ;) >>>> >>>> Best, >>>> Jörn >>>> >>>> >>>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>>> Hey Jorn, >>>>> >>>>> Previously I have let ft_sourceanalysis do a lead field because if >>>>> I use the following code: >>>>> >>>>> % compute lead field ( apparently source analysis computes >>>>> % lead field anyway >>>>> cfg = []; >>>>> cfg.elec = timelock.elec; >>>>> cfg.vol = vol; >>>>> cfg.reducerank = 3; >>>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>>> cm resolution >>>>> cfg.grid.unit = 'cm'; >>>>> cfg.normalize = 'yes'; % if you are not >>>>> contrasting the activity of interest again another condition or >>>>> baseline time-window >>>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>>> I AM UP TO >>>>> >>>>> and then calculate the source analysis: >>>>> >>>>> % Source Analysis: without contrasting condition >>>>> cfg = []; >>>>> cfg.method = 'lcmv'; >>>>> cfg.grid = grid; >>>>> cfg.vol = vol; >>>>> % cfg.grid.pos = maxpos; >>>>> cfg.keepfilter = 'yes'; >>>>> cfg.dics.projectnoise = 'yes'; >>>>> % cfg.dics.lambda = 0; >>>>> source = ft_sourceanalysis( cfg, timelock); >>>>> >>>>> then I get an error than says: >>>>> >>>>> Error using * >>>>> Inner matrix dimensions must agree. >>>>> >>>>> Error in beamformer_lcmv (line 268) >>>>> filt = pinv(lf' * invCy * lf) * lf' * >>>>> invCy; % van Veen eqn. 23, use >>>>> PINV/SVD to cover rank deficient leadfield >>>>> >>>>> Error in ft_sourceanalysis (line 794) >>>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>>> optarg{:}); >>>>> >>>>> I just removed the leadfield code and it successfully ran. I could >>>>> also interpolate it later. >>>>> Is this the correct approach. >>>>> >>>>> Thankyou in advance! >>>>> >>>>> Tyler >>>>> >>>>> ************************* >>>>> >>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>> PhD Candidate >>>>> Brain Signals Laboratory >>>>> Flinders University >>>>> Rm 5A301 >>>>> Ext 66124 >>>>> >>>>> ________________________________________ >>>>> From: fieldtrip-bounces at science.ru.nl >>>>> on behalf of "Jörn M. Horschig" >>>>> >>>>> Sent: Monday, 31 March 2014 5:30 PM >>>>> To: FieldTrip discussion list >>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>> ft_sourceplot >>>>> >>>>> Hi Tyler, >>>>> >>>>> what you are describing sounds to me like the center bias of the >>>>> beamformer. Did you contrast the activity with anything, or did you >>>>> normalize your leadfield? >>>>> Check this out: >>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>>> >>>>> >>>>> Best, >>>>> Jörn >>>>> >>>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>>> I have been trying to plot my interpolated source data using the >>>>>> code: >>>>>> >>>>>> % interpolate sources >>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>> mri = ft_volumereslice([], mri); >>>>>> cfg = []; >>>>>> cfg.downsample = 2; >>>>>> cfg.parameter = 'avg.pow'; >>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>> parameter >>>>>> % does not vary over time, therefore the time >>>>>> dimension >>>>>> is not needed. >>>>>> >>>>>> % Plot interpolated data >>>>>> cfg = []; %#ok >>>>>> cfg.method = 'ortho'; % spline >>>>>> cfg.funparameter = 'avg.pow'; >>>>>> ft_sourceplot( cfg, sourceInt); >>>>>> >>>>>> However the figure that comes up just had orange squares in the >>>>>> subplots. >>>>>> >>>>>> I dont know where Ive gone wrong. >>>>>> >>>>>> >>>>>> Tyler >>>>>> >>>>>> >>>>>> ************************* >>>>>> >>>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>>> /PhD Candidate/ >>>>>> /Brain Signals Laboratory/ >>>>>> /Flinders University/ >>>>>> /Rm 5A301/ >>>>>> /Ext 66124/ >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> -- >>>>> Jörn M. Horschig >>>>> PhD Student >>>>> Donders Institute for Brain, Cognition and Behaviour >>>>> Centre for Cognitive Neuroimaging >>>>> Radboud University Nijmegen >>>>> Neuronal Oscillations Group >>>>> FieldTrip Development Team >>>>> >>>>> P.O. Box 9101 >>>>> NL-6500 HB Nijmegen >>>>> The Netherlands >>>>> >>>>> Contact: >>>>> E-Mail: jm.horschig at donders.ru.nl >>>>> Tel: +31-(0)24-36-68493 >>>>> Web: http://www.ru.nl/donders >>>>> >>>>> Visiting address: >>>>> Trigon, room 2.30 >>>>> Kapittelweg 29 >>>>> NL-6525 EN Nijmegen >>>>> The Netherlands >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> -- >>>> Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Tue Apr 1 08:24:11 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 01 Apr 2014 08:24:11 +0200 Subject: [FieldTrip] ICA: eeglab and fieldtrip In-Reply-To: References: Message-ID: <533A5B8B.5010207@donders.ru.nl> HI Aaron, in addition to what Stephen and especially Stephen said (fun quiz: who is who? ;)), pay attention that the colourscale might be different (also for different subplots) and therefore the plots from different toolboxes could suggest different activity in components, although in fact they are similar. Best, Jörn On 3/31/2014 10:10 PM, Stephen Whitmarsh wrote: > Hi Aaron (i see Stephen just wrote a similar response) > > Those component topoplots look pretty good to me. In the FT one, I > would say the first and third have a good change of being related to > eyeblinks, and the fifth and twenty-fifth to eye-movements. > However, you should really look at the timecourses to identify them as > related to saccades and blinks, and by comparing them with your EOG > recording. > > Although each ICA will *always* give you different results (if you > don't specifiy the random seed), to make them more comparable you > could add the EOG channel to the layout. > > Cheer, > Stephen > > > On 31 March 2014 22:08, Stephen Politzer-Ahles > wrote: > > Hello Aaron, > > This doesn't, answer the rest of your questions, but... In your > attached Fieldtrip image, component 1 does look like a likely > blink component to me? > > > > Stephen Politzer-Ahles > New York University, Abu Dhabi > Neuroscience of Language Lab > http://www.nyu.edu/projects/politzer-ahles/ > > > On Mon, Mar 31, 2014 at 11:52 PM, > wrote: > > > Message: 2 > Date: Mon, 31 Mar 2014 14:51:51 -0500 > From: Aaron Hanford > > To: "fieldtrip at science.ru.nl " > > > Subject: [FieldTrip] ICA: eeglab and fieldtrip > Message-ID: > Content-Type: text/plain; charset="iso-8859-1" > > Hi,I'm resending this with the figures turned into jpgs so > it's not oversize...anyway, so I'm somewhat new to both > fieldtrip and eeglab (although much more so to fieldtrip). > I'm trying to figure out the following: > > On the exact same dataset, I did the following two things: > 1) in eeglab, I just chose Tools -> Run ICA with default settings. > Then, starting over with the original raw data: > 2) In fieldtrip I ran the following: data = > eeglab2fieldtrip(EEG,'preprocessing','none');cfg = > [];cfg.method = > 'runica';[comp]=ft_componentanalysis(cfg,data);layout = > 'C:\Users\aharown\Desktop\fieldtrip-20140126\template\layout\easycapM17.mat';cfg.component > = [1:31];cfg.layout = layout;ft_topoplotIC(cfg,comp); > In both cases I then plotted the 2-D component maps, attached. > So my question is, why are these results so completely > different? The fieldtrip results don't look right at all, in > that for instance they don't obviously identify a blink > component (note that in this dataset, there is only one > electrode placed near the right eye, not the left). I did > this a handful of times and got the same sort of big > differences. Am I doing something wrong or what? > > I actually think the cap file seems incorrect, but I've been > assured by my PI that it's correct, so .... is there another > likely answer? > Thanks, > Aaron > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: fieldtrip.JPG > Type: image/jpeg > Size: 110477 bytes > Desc: not available > URL: > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: eeglab.JPG > Type: image/jpeg > Size: 99185 bytes > Desc: not available > URL: > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 40, Issue 48 > ***************************************** > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From tyler.grummett at flinders.edu.au Tue Apr 1 08:45:50 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 1 Apr 2014 06:45:50 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <533A5A14.4060700@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>, <533985D8.4080504@donders.ru.nl> <2573399203ce4b8481d629d08994337a@SIXPR03MB368.apcprd03.prod.outlook.com>, <533A5A14.4060700@donders.ru.nl> Message-ID: Hey Jorn, It looks like the function prepare_headmodel is altering cfg.channel at line 54: sens = ft_fetch_sens(cfg, data); line 94: [vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, 'order', cfg.order); and line 97: cfg.channel = sens.label; sens = elecpos: [0x3 double] label: {1x0 cell} type: 'eeg1005' unit: 'cm' chanpos: [0x3 double] this function is called in ft_sourceanalysis. After that I dont have the labels anymore. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" Sent: Tuesday, 1 April 2014 4:47 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot Hi Tyler, the leadfield matrix contains by design no channel labels, and I think that FieldTrip assumes that the elements of the leadfield coincides with the elements of the channel. I guess you can avoid the error you get by setting cfg.channel = data.label; when computing the leadfield. You could try that, otherwise your code looks fine. Best, Jörn On 4/1/2014 1:58 AM, Tyler Grummett wrote: > Hey Jorn, > > I am still getting an error when running ft_sourceanalysis. Ill try and give you the full picture of what I am doing. > > 1. coming from eeglab to fieldtrip: > > % convert to fieldtrip > process = 'componentanalysis'; > data = eeglab2fieldtrip( EEG, process, 'none'); > > data = > > label: {1x121 cell} > fsample: 500 > elec: [1x1 struct] > trial: {[121x19767 single]} > time: {[1x19767 double]} > topolabel: {1x121 cell} > topo: [121x121 double] > cfg: [1x1 struct] > > 2. Calculate timelock analysis > > % calculating the timelock analysis > cfg = []; > % cfg.channel = 'EEG'; % for some reason it crashes the > % beamformer > cfg.vartrllength = 2; % accept variable length trials > cfg.covariance = 'yes'; > cfg.covariancewindow = 'all'; > % cfg.channel = data.label; > timelock = ft_timelockanalysis(cfg, data); > > timelock = > > avg: [121x19767 double] > var: [121x19767 double] > time: [1x19767 double] > dof: [121x19767 double] > label: {1x121 cell} > dimord: 'chan_time' > cov: [121x121 double] > elec: [1x1 struct] > cfg: [1x1 struct] > > 3. Calculate head model > > % the forward model and lead field matrix > mri = ft_read_mri( 'Subject01.mri'); > cfg = []; > cfg.write = 'no'; > cfg.coordsys = 'ctf'; > segmentedmri = ft_volumesegment(cfg, mri); > > cfg = []; > cfg.method = 'concentricspheres'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > vol = > > unit: 'mm' > r: 69.8077 > o: [19.2853 1.2231 54.6031] > cond: 1 > type: 'concentricspheres' > cfg: [1x1 struct] > > 4. Compute lead field > > % compute lead field ( apparently source analysis computes > % lead field anyway > cfg = []; > cfg.elec = timelock.elec; > cfg.vol = vol; > cfg.reducerank = 3; > cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution > cfg.grid.unit = 'cm'; > cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window > grid = ft_prepare_leadfield( cfg); > > grid = > > xgrid: [-5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8] > ygrid: [-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7] > zgrid: [-1 0 1 2 3 4 5 6 7 8 9 10 11 12] > dim: [14 14 14] > pos: [2744x3 double] > unit: 'cm' > inside: [1x1430 double] > outside: [1x1314 double] > cfg: [1x1 struct] > leadfield: {1x2744 cell} > > 5. Compute ft_source analysis > > % Source Analysis: without contrasting condition > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = grid; > cfg.vol = vol; > % cfg.grid.pos = 'maxpos'; > cfg.keepfilter = 'yes'; > cfg.dics.projectnoise = 'yes'; > cfg.dics.lambda = 0; > source = ft_sourceanalysis( cfg, timelock); > > It crashes with the following error: > > Error using * > Inner matrix dimensions must agree. > > Error in beamformer_lcmv (line 268) > filt = pinv(lf' * invCy * lf) * lf' * invCy; > % van Veen eqn. 23, use PINV/SVD to cover rank > deficient leadfield > > Error in ft_sourceanalysis (line 794) > dip(i) = beamformer_lcmv(grid, sens, vol, > squeeze_avg, squeeze(Cy(i,:,:)), optarg{:}); > > > Please note that fieldtrip is up to date. > Can you see an error? I will trying looking in the tutorials again. > Also, did you want a segment of my data to see if you can get it working? > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" > Sent: Tuesday, 1 April 2014 1:42 AM > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot > > just to clarify and be precise >> The pos-matrix has to be a regular 3D grid, i.e. be representable as a >> 3x3x3 matrix. > it actually does not have to be as you can also beam individual grid > points, but if you have a .dim field, then is has to be like above. But > that does not affect the rest of the mail I wrote ;) > > >> I am not quite sure how the sourceinterpolate function is handeling >> the fact that you do not have that .dim field. Apparently, it is also >> confused ;) >> >> Do you want to reconstruct only some voxels? From your code it seems >> that you want to cover the whole brain with a 1cm resolution. If the >> latter is the case, maybe restart with creating your forward model by >> following the tutorial that I posted in my previous mail. There are >> some sanity checks that can help you figuring out if you are doing the >> correct thing. If the former one is the case, please explain again >> what exactly you want to achieve and how you are building your forward >> model. >> >> Best, >> Jörn >> >> btw, there's nothing wrong with being a PhD student, it's just a >> matter of experience in practice and theory as in all domains in life ;) >> >> >> On 3/31/2014 3:15 PM, Tyler Grummett wrote: >>> Hey Jorn, >>> >>> Yes I am definitely confused haha, this stuff is way out of my league >>> as a PhD student. >>> Anyway, I feel we are getting somewhere. >>> >>> timelock = >>> >>> avg: [121x19767 double] >>> var: [121x19767 double] >>> time: [1x19767 double] >>> dof: [121x19767 double] >>> label: {1x121 cell} >>> dimord: 'chan_time' >>> cov: [121x121 double] >>> elec: [1x1 struct] >>> cfg: [1x1 struct] >>> >>> source = >>> >>> time: [1x19767 double] >>> pos: [642x3 double] >>> inside: [642x1 double] >>> outside: [] >>> method: 'average' >>> avg: [1x1 struct] >>> cfg: [1x1 struct] >>> >>> sourceInt = >>> >>> time: [1x19767 double] >>> avg: [1x1 struct] >>> pos: [16777216x3 double] >>> dim: [256 256 256] >>> inside: [1x16777216 double] >>> outside: [1x0 double] >>> coordsys: 'ctf' >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> Given what I said last time, I might not comment on the differences. >>> I hope you can see something wrong. >>> >>> One thing I should mention is that the data is continuous, around 30 >>> seconds. Therefore there is only one trial, >>> is that an issue? >>> >>> Tyler >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl >>> on behalf of "Jörn M. Horschig" >>> >>> Sent: Monday, 31 March 2014 10:24 PM >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting interpolated sources with >>> ft_sourceplot >>> >>> Hi Tyler, >>> >>> there is not much inherently different between time- and >>> freuqency-domain beamformer, at least in terms of computing the forward >>> and the inverse solution. But I see that you are obviously confused, so >>> let me try to help you out and shed some light on what you are actually >>> doing ;) >>> >>> >>>> I had a look at my variables. >>>> >>>> source.avg = >>>> >>>> pow: [642x1 double] >>>> filter: {642x1 cell} >>>> >>>> sourceInt.avg = >>>> >>>> pow: [16777216x1 double] >>>> >>>> So clearly, as both variables are completely different. Something >>>> has gone wrong. >>> No, that is actually how it should be. From below you can see that your >>> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >>> 16777216 elements. In line with source.avg.pow, you should see that your >>> 'grid' consists of 642 elements, so you were computing your source >>> activity on a grid of in total 642 elements. Then you used the original >>> MRI to interpolate from 642 to these 16 million grid points. Actually, >>> since you specific cfg.downsample = 2, it should have been only 8 >>> million points, so that's where things already get a bit weird. >>> >>> So let's go into some sanity checks: >>> 1. are you using the latest version (or a recent, i.e. from this year) >>> of FielTrip? >>> 2. sourceInt should look something like this, does it? >>> >>> source_diff_int = >>> inside: [46x55x46 logical] >>> avg: [1x1 struct] >>> dim: [46 55 46] >>> transform: [4x4 double] >>> anatomy: [46x55x46 double] >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> >>> >>> 3. source should look something like this: >>> >>> source = >>> dim: [20 25 22] >>> freq: 54.8287 >>> cumtapcnt: [338x1 double] >>> pos: [11000x3 double] >>> inside: [1x5798 double] >>> outside: [1x5202 double] >>> method: 'average' >>> avg: [1x1 struct] >>> trialinfo: [338x1 double] >>> cfg: [1x1 struct] >>> >>> 4. also check your grid, should be something like this: >>> >>> sourcemodel = >>> >>> pos: [11000x3 double] >>> dim: [20 25 22] >>> unit: 'cm' >>> inside: [1x5798 double] >>> outside: [1x5202 double] >>> params: [1x1 struct] >>> initial: [4x4 double] >>> cfg: [1x1 struct] >>> >>> >>> Of course, it should all look a bit different, because you are using >>> LCMV, but essentially it should be the same. Lastly, you can check other >>> source plotting methods, like 'ortho' or try to plot the source >>> structure rather than the sourceInt structure. In the end, the error >>> must be somewhere in your grid, be it in .pos or .inside, because >>> FieldTrip thinks that there is only one voxel to be plotted. There are >>> other things that may be the issue, but I am not sure about these. So, I >>> would suggest that you play a bit around and see where the error might >>> come from (e.g. follow this tutorial: >>> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >>> steps that you need for LCMV, maybe also check out: >>> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >>> >>> there, LCMV is used, but on one voxel only) >>> >>> Best, >>> Jörn >>> >>>> The next part of my code is the following: >>>> >>>> % interpolate sources >>>> mri = ft_read_mri('Subject01.mri'); >>>> mri = ft_volumereslice([], mri); >>>> >>>> cfg = []; >>>> cfg.downsample = 2; >>>> cfg.parameter = 'avg.pow'; >>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>> parameter >>>> % does not vary over time, therefore the time >>>> dimension is not needed. >>>> >>>> mri = >>>> >>>> anatomy: [256x256x256 double] >>>> dim: [256 256 256] >>>> transform: [4x4 double] >>>> coordsys: 'ctf' >>>> unit: 'mm' >>>> cfg: [1x1 struct] >>>> >>>> I cant really see if the data works in the tutorial because it >>>> doesnt appear as though fieldtrip has a tutorial on lcmv >>>> beamformers, they seem to stick to frequency domain beamformers. >>>> >>>> Ive been wrong before though, >>>> >>>> thanks for your help. >>>> >>>> Tyler >>>> >>>> ************************* >>>> >>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>> PhD Candidate >>>> Brain Signals Laboratory >>>> Flinders University >>>> Rm 5A301 >>>> Ext 66124 >>>> >>>> ________________________________________ >>>> From: fieldtrip-bounces at science.ru.nl >>>> on behalf of "Jörn M. Horschig" >>>> >>>> Sent: Monday, 31 March 2014 7:13 PM >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>> ft_sourceplot >>>> >>>> Hi Tyler, >>>> >>>> hm, okay, it could be that the issue with the leadfield and with the >>>> plot are related, but it could also be that they are separate issues. I >>>> just saw that you posted the same 'problem' on bugzilla and included a >>>> picture. Maybe for next time, include a picture on the mailinglist and >>>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>>> and not if you are not sure. That saves us a lot of time in separating >>>> code issues from user problems ;) >>>> >>>> So, back to you problem. It seems that your reconstruction results in >>>> one voxel only. Are you sure that your grid consistents of more than >>>> just one position? So, for example check the size of the matrices in >>>> source.avg, source- and headmodel, etc. >>>> >>>> Also, you can check in Matlab the respective fields of source and >>>> sourceInt and see whether that makes sense. >>>> >>>> Lastly, a neat way to check is always to use your code on data from the >>>> tutorial, and vice versa, use code from the tutorial on your data and >>>> see whether that works. Both should give sensible results, and if one >>>> does not, you know where to start looking for a solution ;) >>>> >>>> Best, >>>> Jörn >>>> >>>> >>>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>>> Hey Jorn, >>>>> >>>>> Previously I have let ft_sourceanalysis do a lead field because if >>>>> I use the following code: >>>>> >>>>> % compute lead field ( apparently source analysis computes >>>>> % lead field anyway >>>>> cfg = []; >>>>> cfg.elec = timelock.elec; >>>>> cfg.vol = vol; >>>>> cfg.reducerank = 3; >>>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>>> cm resolution >>>>> cfg.grid.unit = 'cm'; >>>>> cfg.normalize = 'yes'; % if you are not >>>>> contrasting the activity of interest again another condition or >>>>> baseline time-window >>>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>>> I AM UP TO >>>>> >>>>> and then calculate the source analysis: >>>>> >>>>> % Source Analysis: without contrasting condition >>>>> cfg = []; >>>>> cfg.method = 'lcmv'; >>>>> cfg.grid = grid; >>>>> cfg.vol = vol; >>>>> % cfg.grid.pos = maxpos; >>>>> cfg.keepfilter = 'yes'; >>>>> cfg.dics.projectnoise = 'yes'; >>>>> % cfg.dics.lambda = 0; >>>>> source = ft_sourceanalysis( cfg, timelock); >>>>> >>>>> then I get an error than says: >>>>> >>>>> Error using * >>>>> Inner matrix dimensions must agree. >>>>> >>>>> Error in beamformer_lcmv (line 268) >>>>> filt = pinv(lf' * invCy * lf) * lf' * >>>>> invCy; % van Veen eqn. 23, use >>>>> PINV/SVD to cover rank deficient leadfield >>>>> >>>>> Error in ft_sourceanalysis (line 794) >>>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>>> optarg{:}); >>>>> >>>>> I just removed the leadfield code and it successfully ran. I could >>>>> also interpolate it later. >>>>> Is this the correct approach. >>>>> >>>>> Thankyou in advance! >>>>> >>>>> Tyler >>>>> >>>>> ************************* >>>>> >>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>> PhD Candidate >>>>> Brain Signals Laboratory >>>>> Flinders University >>>>> Rm 5A301 >>>>> Ext 66124 >>>>> >>>>> ________________________________________ >>>>> From: fieldtrip-bounces at science.ru.nl >>>>> on behalf of "Jörn M. Horschig" >>>>> >>>>> Sent: Monday, 31 March 2014 5:30 PM >>>>> To: FieldTrip discussion list >>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>> ft_sourceplot >>>>> >>>>> Hi Tyler, >>>>> >>>>> what you are describing sounds to me like the center bias of the >>>>> beamformer. Did you contrast the activity with anything, or did you >>>>> normalize your leadfield? >>>>> Check this out: >>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>>> >>>>> >>>>> Best, >>>>> Jörn >>>>> >>>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>>> I have been trying to plot my interpolated source data using the >>>>>> code: >>>>>> >>>>>> % interpolate sources >>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>> mri = ft_volumereslice([], mri); >>>>>> cfg = []; >>>>>> cfg.downsample = 2; >>>>>> cfg.parameter = 'avg.pow'; >>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>> parameter >>>>>> % does not vary over time, therefore the time >>>>>> dimension >>>>>> is not needed. >>>>>> >>>>>> % Plot interpolated data >>>>>> cfg = []; %#ok >>>>>> cfg.method = 'ortho'; % spline >>>>>> cfg.funparameter = 'avg.pow'; >>>>>> ft_sourceplot( cfg, sourceInt); >>>>>> >>>>>> However the figure that comes up just had orange squares in the >>>>>> subplots. >>>>>> >>>>>> I dont know where Ive gone wrong. >>>>>> >>>>>> >>>>>> Tyler >>>>>> >>>>>> >>>>>> ************************* >>>>>> >>>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>>> /PhD Candidate/ >>>>>> /Brain Signals Laboratory/ >>>>>> /Flinders University/ >>>>>> /Rm 5A301/ >>>>>> /Ext 66124/ >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> -- >>>>> Jörn M. Horschig >>>>> PhD Student >>>>> Donders Institute for Brain, Cognition and Behaviour >>>>> Centre for Cognitive Neuroimaging >>>>> Radboud University Nijmegen >>>>> Neuronal Oscillations Group >>>>> FieldTrip Development Team >>>>> >>>>> P.O. Box 9101 >>>>> NL-6500 HB Nijmegen >>>>> The Netherlands >>>>> >>>>> Contact: >>>>> E-Mail: jm.horschig at donders.ru.nl >>>>> Tel: +31-(0)24-36-68493 >>>>> Web: http://www.ru.nl/donders >>>>> >>>>> Visiting address: >>>>> Trigon, room 2.30 >>>>> Kapittelweg 29 >>>>> NL-6525 EN Nijmegen >>>>> The Netherlands >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> -- >>>> Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From natalia.zaretskaya at cin.uni-tuebingen.de Tue Apr 1 09:19:39 2014 From: natalia.zaretskaya at cin.uni-tuebingen.de (Natalia Zaretskaya) Date: Tue, 1 Apr 2014 09:19:39 +0200 Subject: [FieldTrip] PLV with DICS beamformer Message-ID: <003FC94A-3967-44F3-A0E2-BC813E99C4D8@cin.uni-tuebingen.de> Dear FieldTrip experts, I would like to be able to compute the phase-locking value (Lachaux, 1999) using source data derived from disc beamformer. Right now I perform ft_sourceanalysis with cfg.method = ‘dics’; cfg.refdip = [x y z]; cfg.rawtrial = ‘yes’; cfg.keepcsd = ‘yes’; cfg.grid.filter = source.avg.filter; % precomputed common filter for two conditions and then use the imaginary part of the single-trial cross-spectral densities to compute PLV “by hand”. Cross-spectra at each position have a 3x3 format, so I compute the PLV for each dipole orientation pair and then average. I was wondering whether 1) the above procedure is technically correct and 2) whether there is a better, more efficient way to do it (I assume plv can be derived at the same step where source.avg.coh is computed?). Many thanks in advance! Best regards, Natalia Zaretskaya --- Dr. Natalia Zaretskaya Centre for Integrative Neuroscience Vision and Cognition Lab (AG Bartels) 72076 Tübingen, Germany natalia.zaretskaya at cin.uni-tuebingen.de phone: +49 7071 2989032 -------------- next part -------------- An HTML attachment was scrubbed... URL: From meschwe at gmail.com Tue Apr 1 14:12:20 2014 From: meschwe at gmail.com (Meike Schweisfurth) Date: Tue, 1 Apr 2014 14:12:20 +0200 Subject: [FieldTrip] source analysis on the group level Message-ID: Dear Fieldtrippers! I am very new to MEG and have a question concerning source analysis on the group level. Specifically, I have two consecutive problems: 1) After mne source analysis (roughly as described in http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate) for individual subjects and for two different conditions, I would like to combine the data between subjects for each condition (using the same grid for all of them). However, I keep getting the following error: *"Subscripted assignment dimension mismatch.* *Error in ft_sourcegrandaverage (line 157)* * dat(:,i) = tmp(:);*" Does anybody know know to handle that or why it occurs? 2) I then went on without averaging and wanted to calculated statistics, very much as described in http://fieldtrip.fcdonders.nl/example/source_statistics in the group level section. As I could not use ft_sourcegrandaverage before, I fed in the output from ft_sourceanalysis for all subjects behind each other, cfg=[]; %cfg.dim = sc1{1}.dim; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.parameter = 'pow'; cfg.correctm = 'cluster'; cfg.numrandomization = 500; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.alpha = 0.025; cfg.tail = 0; cfg.latency =[0, 0.6]; nsubj=numel(sc1); cfg.design(1,:) = [1:nsubj 1:nsubj]; cfg.design(2,:) = [ones(1,nsubj) ones(1,nsubj)*2]; cfg.uvar = 1; % row of design matrix that contains unit variable (in this case: subjects) cfg.ivar = 2; % row of design matrix that contains independent variable (the conditions) stat = ft_sourcestatistics(cfg, sc1{1}, sc1{2}, sc1{3}, sc2{1}, sc2{2} ,sc2{3} ); , where e.g. sc1{1}=time: [1x1465 double] pos: [3000x3 double] inside: [3000x1 double] outside: [1x0 double] method: 'average' avg: [1x1 struct] cfg: [1x1 struct] First, I got an error saying that I do not have a field 'pow', which I had entered as cfg.parameter = 'pow', although that field was only hidden in sc1{}.avg.pow. To circumvent that error, I then copied the avg.pow data to an extra field pow and the error was gone pow: [3000x1465 double] However, giving now I get the error: *"Error using false* *Out of memory. Type HELP MEMORY for your options.* *Error in ft_statistics_montecarlo (line 177)* * cfg.connectivity = false(size(dat,1));* *Error in statistics_wrapper (line 308)* * [stat, cfg] = statmethod(cfg, dat, design);* *Error in ft_sourcestatistics (line 107)* * [stat, cfg] = statistics_wrapper(cfg, varargin{:});**"* Does anybody know a solution for that? What should I set cfg.dim to, as I do not have output from ft_sourcegrandaverage? I would be really happy for any help! Best, Meike -------------- next part -------------- An HTML attachment was scrubbed... URL: From meschwe at gmail.com Tue Apr 1 14:12:45 2014 From: meschwe at gmail.com (Meike Schweisfurth) Date: Tue, 1 Apr 2014 14:12:45 +0200 Subject: [FieldTrip] warping from MNI to individual subjects Message-ID: Dear Fieldtrippers! As newbie I have another question, now concerning the warping from MNI to individual subjects. Using the below code (the first part almost entirely from http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space), I get first the template and then apply the grid to the individual subjects. However, in later on analysis step it turned out that while the subjects where nicely similar positioned, the template position is entirely different, as it is was even axes were exchanged... Does anybody know what could be the reason and how to change it? Thanks for any suggestions! Best, Meike % NOTE: the path to the template file is user-specific template = ft_read_mri('fieldtrip/fieldtrip-20140316/external/spm8/templates/T1.nii'); template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the coordinate system % segment the template brain and construct a volume conduction model (i.e. head model): this is needed % for the inside/outside detection of voxels. cfg = []; template_seg = ft_volumesegment(cfg, template); cfg = []; cfg.method = 'singleshell'; template_vol = ft_prepare_headmodel(cfg, template_seg); template_vol = ft_convert_units(template_vol, 'cm'); % Convert the vol to cm, since the grid will also be expressed in cm % construct the dipole grid in the template brain coordinates % the source units are in cm % the negative inwardshift means an outward shift of the brain surface for inside/outside detection cfg = []; cfg.grid.xgrid = -20:1:20; cfg.grid.ygrid = -20:1:20; cfg.grid.zgrid = -20:1:20; cfg.grid.unit = 'cm'; cfg.grid.tight = 'yes'; cfg.inwardshift = -1.5; cfg.vol = template_vol; template_grid = ft_prepare_sourcemodel(cfg); save('../analysis/MEG/source_analysis/MNI','template_grid','template_vol','template_seg','template') % make a figure with the template head model and dipole grid figure hold on ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', 'none');alpha 0.5; camlight; ft_plot_mesh(template_grid.pos(template_grid.inside,:)); else load('../analysis/MEG/source_analysis/MNI','template_grid','template_vol','template_seg','template') %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SUBJECTS={ 'VP02' 'VP03' 'VP04' 'VP05' 'VP06' 'VP07' 'VP08' 'VP09' 'VP11' 'VP12' 'VP13' 'VP14' 'VP15' 'VP16' 'VP17' 'VP18'} for SUBJI=SUBJECTS SUBJ=SUBJI{1}; % read the single subject anatomical MRI load(['..*/analysis/MEG/source_analysis/*',SUBJ,'/mri']); %Has been processed to CFT coordinates before load(['..*/analysis/MEG/source_analysis/*',SUBJ,'/segmentedmri']); cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, segmentedmri); % create the subject specific grid, using the template grid that has just been created cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = template_grid; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri_ra; grid = ft_prepare_sourcemodel(cfg); % make a figure of the single subject headmodel, and grid positions figure; ft_plot_vol(vol, 'edgecolor', 'none'); alpha 0.4; %camlight ft_plot_mesh(grid.pos(grid.inside,:)); save(['..*/analysis/MEG/source_analysis/*',SUBJ,'/MNIgrid'],'grid','vol') end -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Tue Apr 1 15:12:48 2014 From: julian.keil at gmail.com (Julian Keil) Date: Tue, 1 Apr 2014 15:12:48 +0200 Subject: [FieldTrip] warping from MNI to individual subjects In-Reply-To: References: Message-ID: <57CBCEA0-7232-44A9-A8B0-05588E4C2310@gmail.com> Dear Meike, I'm not sure if this relates to your problem, but I had - possibly similar - issues with the warped grid and the template being 90° rotated. My problem was due to an error during the realignment of the MRI. Did you check whether the realignment works and whether your different coordinate systems make sense? Could you also maybe attach a picture of your exchanged axes? At least for me it's hard to image how this looks. Best, Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 01.04.2014 um 14:12 schrieb Meike Schweisfurth: > Dear Fieldtrippers! > As newbie I have another question, now concerning the warping from MNI to individual subjects. > Using the below code (the first part almost entirely from http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space), I get first the template and then apply the grid to the individual subjects. > However, in later on analysis step it turned out that while the subjects where nicely similar positioned, the template position is entirely different, as it is was even axes were exchanged... > Does anybody know what could be the reason and how to change it? > Thanks for any suggestions! > Best, Meike > > > % NOTE: the path to the template file is user-specific > template = ft_read_mri('fieldtrip/fieldtrip-20140316/external/spm8/templates/T1.nii'); > template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the coordinate system > > % segment the template brain and construct a volume conduction model (i.e. head model): this is needed > % for the inside/outside detection of voxels. > cfg = []; > template_seg = ft_volumesegment(cfg, template); > > cfg = []; > cfg.method = 'singleshell'; > template_vol = ft_prepare_headmodel(cfg, template_seg); > template_vol = ft_convert_units(template_vol, 'cm'); % Convert the vol to cm, since the grid will also be expressed in cm > > % construct the dipole grid in the template brain coordinates > % the source units are in cm > % the negative inwardshift means an outward shift of the brain surface for inside/outside detection > cfg = []; > cfg.grid.xgrid = -20:1:20; > cfg.grid.ygrid = -20:1:20; > cfg.grid.zgrid = -20:1:20; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > cfg.inwardshift = -1.5; > cfg.vol = template_vol; > template_grid = ft_prepare_sourcemodel(cfg); > save('../analysis/MEG/source_analysis/MNI','template_grid','template_vol','template_seg','template') > % make a figure with the template head model and dipole grid > figure > hold on > ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', 'none');alpha 0.5; camlight; > ft_plot_mesh(template_grid.pos(template_grid.inside,:)); > else load('../analysis/MEG/source_analysis/MNI','template_grid','template_vol','template_seg','template') > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > SUBJECTS={ 'VP02' 'VP03' 'VP04' 'VP05' 'VP06' 'VP07' 'VP08' 'VP09' 'VP11' 'VP12' 'VP13' 'VP14' 'VP15' 'VP16' 'VP17' 'VP18'} > > for SUBJI=SUBJECTS > SUBJ=SUBJI{1}; > % read the single subject anatomical MRI > load(['../analysis/MEG/source_analysis/',SUBJ,'/mri']); %Has been processed to CFT coordinates before > load(['../analysis/MEG/source_analysis/',SUBJ,'/segmentedmri']); > > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > % create the subject specific grid, using the template grid that has just been created > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template_grid; > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > cfg.mri = mri_ra; > grid = ft_prepare_sourcemodel(cfg); > > % make a figure of the single subject headmodel, and grid positions > figure; > ft_plot_vol(vol, 'edgecolor', 'none'); alpha 0.4; %camlight > ft_plot_mesh(grid.pos(grid.inside,:)); > > save(['../analysis/MEG/source_analysis/',SUBJ,'/MNIgrid'],'grid','vol') > end > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Apr 1 17:16:27 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 01 Apr 2014 17:16:27 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>, <533985D8.4080504@donders.ru.nl> Message-ID: <533AD84B.6060600@donders.ru.nl> Hi Tyler, any reason why you don't want to go back to sensor-space but stay in component-space with your data? I would assume that the error will be gone if you use the back-projected data (ft_rejectcomponent, with cfg.component = []). Best, Jörn On 4/1/2014 8:15 AM, Tyler Grummett wrote: > Hey Jorn, > > In addition to my previous emails, Ive been trying to debug the functions. > > In ft_sourceanalysis, line 661 to 677: > > % HACK: use the default code > % select the channels of interest > [dum, datchanindx] = match_str(cfg.channel, data.label); > if strcmp(data.dimord, 'chan_time') > % It is in principle possible to have timelockanalysis with > % keeptrial=yes and only a single trial in the raw data. > % In that case the covariance should be represented as Nchan*Nchan > data.avg = data.avg(datchanindx,:); > %data.cov = reshape(data.cov, length(datchanindx), length(datchanindx)); > data.cov = data.cov(datchanindx,datchanindx); > else > data.avg = data.avg(datchanindx,:); > data.cov = data.cov(:,datchanindx,datchanindx); > data.trial = data.trial(:,datchanindx,:); > end > data.label = data.label(datchanindx); > Nchans = length(data.label); > > I found that my cfg.channel is []; and the data.label is all my ICA components labelled ica_001 etc. > > So it is returned as a []; > which means data.cov = []; > > I think then it will crash later parts of the code. Does this function work on ICA components? > > I ran the ICA in eeglab. > > Tyler. > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" > Sent: Tuesday, 1 April 2014 1:42 AM > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot > > just to clarify and be precise >> The pos-matrix has to be a regular 3D grid, i.e. be representable as a >> 3x3x3 matrix. > it actually does not have to be as you can also beam individual grid > points, but if you have a .dim field, then is has to be like above. But > that does not affect the rest of the mail I wrote ;) > > >> I am not quite sure how the sourceinterpolate function is handeling >> the fact that you do not have that .dim field. Apparently, it is also >> confused ;) >> >> Do you want to reconstruct only some voxels? From your code it seems >> that you want to cover the whole brain with a 1cm resolution. If the >> latter is the case, maybe restart with creating your forward model by >> following the tutorial that I posted in my previous mail. There are >> some sanity checks that can help you figuring out if you are doing the >> correct thing. If the former one is the case, please explain again >> what exactly you want to achieve and how you are building your forward >> model. >> >> Best, >> Jörn >> >> btw, there's nothing wrong with being a PhD student, it's just a >> matter of experience in practice and theory as in all domains in life ;) >> >> >> On 3/31/2014 3:15 PM, Tyler Grummett wrote: >>> Hey Jorn, >>> >>> Yes I am definitely confused haha, this stuff is way out of my league >>> as a PhD student. >>> Anyway, I feel we are getting somewhere. >>> >>> timelock = >>> >>> avg: [121x19767 double] >>> var: [121x19767 double] >>> time: [1x19767 double] >>> dof: [121x19767 double] >>> label: {1x121 cell} >>> dimord: 'chan_time' >>> cov: [121x121 double] >>> elec: [1x1 struct] >>> cfg: [1x1 struct] >>> >>> source = >>> >>> time: [1x19767 double] >>> pos: [642x3 double] >>> inside: [642x1 double] >>> outside: [] >>> method: 'average' >>> avg: [1x1 struct] >>> cfg: [1x1 struct] >>> >>> sourceInt = >>> >>> time: [1x19767 double] >>> avg: [1x1 struct] >>> pos: [16777216x3 double] >>> dim: [256 256 256] >>> inside: [1x16777216 double] >>> outside: [1x0 double] >>> coordsys: 'ctf' >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> Given what I said last time, I might not comment on the differences. >>> I hope you can see something wrong. >>> >>> One thing I should mention is that the data is continuous, around 30 >>> seconds. Therefore there is only one trial, >>> is that an issue? >>> >>> Tyler >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl >>> on behalf of "Jörn M. Horschig" >>> >>> Sent: Monday, 31 March 2014 10:24 PM >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting interpolated sources with >>> ft_sourceplot >>> >>> Hi Tyler, >>> >>> there is not much inherently different between time- and >>> freuqency-domain beamformer, at least in terms of computing the forward >>> and the inverse solution. But I see that you are obviously confused, so >>> let me try to help you out and shed some light on what you are actually >>> doing ;) >>> >>> >>>> I had a look at my variables. >>>> >>>> source.avg = >>>> >>>> pow: [642x1 double] >>>> filter: {642x1 cell} >>>> >>>> sourceInt.avg = >>>> >>>> pow: [16777216x1 double] >>>> >>>> So clearly, as both variables are completely different. Something >>>> has gone wrong. >>> No, that is actually how it should be. From below you can see that your >>> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >>> 16777216 elements. In line with source.avg.pow, you should see that your >>> 'grid' consists of 642 elements, so you were computing your source >>> activity on a grid of in total 642 elements. Then you used the original >>> MRI to interpolate from 642 to these 16 million grid points. Actually, >>> since you specific cfg.downsample = 2, it should have been only 8 >>> million points, so that's where things already get a bit weird. >>> >>> So let's go into some sanity checks: >>> 1. are you using the latest version (or a recent, i.e. from this year) >>> of FielTrip? >>> 2. sourceInt should look something like this, does it? >>> >>> source_diff_int = >>> inside: [46x55x46 logical] >>> avg: [1x1 struct] >>> dim: [46 55 46] >>> transform: [4x4 double] >>> anatomy: [46x55x46 double] >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> >>> >>> 3. source should look something like this: >>> >>> source = >>> dim: [20 25 22] >>> freq: 54.8287 >>> cumtapcnt: [338x1 double] >>> pos: [11000x3 double] >>> inside: [1x5798 double] >>> outside: [1x5202 double] >>> method: 'average' >>> avg: [1x1 struct] >>> trialinfo: [338x1 double] >>> cfg: [1x1 struct] >>> >>> 4. also check your grid, should be something like this: >>> >>> sourcemodel = >>> >>> pos: [11000x3 double] >>> dim: [20 25 22] >>> unit: 'cm' >>> inside: [1x5798 double] >>> outside: [1x5202 double] >>> params: [1x1 struct] >>> initial: [4x4 double] >>> cfg: [1x1 struct] >>> >>> >>> Of course, it should all look a bit different, because you are using >>> LCMV, but essentially it should be the same. Lastly, you can check other >>> source plotting methods, like 'ortho' or try to plot the source >>> structure rather than the sourceInt structure. In the end, the error >>> must be somewhere in your grid, be it in .pos or .inside, because >>> FieldTrip thinks that there is only one voxel to be plotted. There are >>> other things that may be the issue, but I am not sure about these. So, I >>> would suggest that you play a bit around and see where the error might >>> come from (e.g. follow this tutorial: >>> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >>> steps that you need for LCMV, maybe also check out: >>> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >>> >>> there, LCMV is used, but on one voxel only) >>> >>> Best, >>> Jörn >>> >>>> The next part of my code is the following: >>>> >>>> % interpolate sources >>>> mri = ft_read_mri('Subject01.mri'); >>>> mri = ft_volumereslice([], mri); >>>> >>>> cfg = []; >>>> cfg.downsample = 2; >>>> cfg.parameter = 'avg.pow'; >>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>> parameter >>>> % does not vary over time, therefore the time >>>> dimension is not needed. >>>> >>>> mri = >>>> >>>> anatomy: [256x256x256 double] >>>> dim: [256 256 256] >>>> transform: [4x4 double] >>>> coordsys: 'ctf' >>>> unit: 'mm' >>>> cfg: [1x1 struct] >>>> >>>> I cant really see if the data works in the tutorial because it >>>> doesnt appear as though fieldtrip has a tutorial on lcmv >>>> beamformers, they seem to stick to frequency domain beamformers. >>>> >>>> Ive been wrong before though, >>>> >>>> thanks for your help. >>>> >>>> Tyler >>>> >>>> ************************* >>>> >>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>> PhD Candidate >>>> Brain Signals Laboratory >>>> Flinders University >>>> Rm 5A301 >>>> Ext 66124 >>>> >>>> ________________________________________ >>>> From: fieldtrip-bounces at science.ru.nl >>>> on behalf of "Jörn M. Horschig" >>>> >>>> Sent: Monday, 31 March 2014 7:13 PM >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>> ft_sourceplot >>>> >>>> Hi Tyler, >>>> >>>> hm, okay, it could be that the issue with the leadfield and with the >>>> plot are related, but it could also be that they are separate issues. I >>>> just saw that you posted the same 'problem' on bugzilla and included a >>>> picture. Maybe for next time, include a picture on the mailinglist and >>>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>>> and not if you are not sure. That saves us a lot of time in separating >>>> code issues from user problems ;) >>>> >>>> So, back to you problem. It seems that your reconstruction results in >>>> one voxel only. Are you sure that your grid consistents of more than >>>> just one position? So, for example check the size of the matrices in >>>> source.avg, source- and headmodel, etc. >>>> >>>> Also, you can check in Matlab the respective fields of source and >>>> sourceInt and see whether that makes sense. >>>> >>>> Lastly, a neat way to check is always to use your code on data from the >>>> tutorial, and vice versa, use code from the tutorial on your data and >>>> see whether that works. Both should give sensible results, and if one >>>> does not, you know where to start looking for a solution ;) >>>> >>>> Best, >>>> Jörn >>>> >>>> >>>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>>> Hey Jorn, >>>>> >>>>> Previously I have let ft_sourceanalysis do a lead field because if >>>>> I use the following code: >>>>> >>>>> % compute lead field ( apparently source analysis computes >>>>> % lead field anyway >>>>> cfg = []; >>>>> cfg.elec = timelock.elec; >>>>> cfg.vol = vol; >>>>> cfg.reducerank = 3; >>>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>>> cm resolution >>>>> cfg.grid.unit = 'cm'; >>>>> cfg.normalize = 'yes'; % if you are not >>>>> contrasting the activity of interest again another condition or >>>>> baseline time-window >>>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>>> I AM UP TO >>>>> >>>>> and then calculate the source analysis: >>>>> >>>>> % Source Analysis: without contrasting condition >>>>> cfg = []; >>>>> cfg.method = 'lcmv'; >>>>> cfg.grid = grid; >>>>> cfg.vol = vol; >>>>> % cfg.grid.pos = maxpos; >>>>> cfg.keepfilter = 'yes'; >>>>> cfg.dics.projectnoise = 'yes'; >>>>> % cfg.dics.lambda = 0; >>>>> source = ft_sourceanalysis( cfg, timelock); >>>>> >>>>> then I get an error than says: >>>>> >>>>> Error using * >>>>> Inner matrix dimensions must agree. >>>>> >>>>> Error in beamformer_lcmv (line 268) >>>>> filt = pinv(lf' * invCy * lf) * lf' * >>>>> invCy; % van Veen eqn. 23, use >>>>> PINV/SVD to cover rank deficient leadfield >>>>> >>>>> Error in ft_sourceanalysis (line 794) >>>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>>> optarg{:}); >>>>> >>>>> I just removed the leadfield code and it successfully ran. I could >>>>> also interpolate it later. >>>>> Is this the correct approach. >>>>> >>>>> Thankyou in advance! >>>>> >>>>> Tyler >>>>> >>>>> ************************* >>>>> >>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>> PhD Candidate >>>>> Brain Signals Laboratory >>>>> Flinders University >>>>> Rm 5A301 >>>>> Ext 66124 >>>>> >>>>> ________________________________________ >>>>> From: fieldtrip-bounces at science.ru.nl >>>>> on behalf of "Jörn M. Horschig" >>>>> >>>>> Sent: Monday, 31 March 2014 5:30 PM >>>>> To: FieldTrip discussion list >>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>> ft_sourceplot >>>>> >>>>> Hi Tyler, >>>>> >>>>> what you are describing sounds to me like the center bias of the >>>>> beamformer. Did you contrast the activity with anything, or did you >>>>> normalize your leadfield? >>>>> Check this out: >>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>>> >>>>> >>>>> Best, >>>>> Jörn >>>>> >>>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>>> I have been trying to plot my interpolated source data using the >>>>>> code: >>>>>> >>>>>> % interpolate sources >>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>> mri = ft_volumereslice([], mri); >>>>>> cfg = []; >>>>>> cfg.downsample = 2; >>>>>> cfg.parameter = 'avg.pow'; >>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>> parameter >>>>>> % does not vary over time, therefore the time >>>>>> dimension >>>>>> is not needed. >>>>>> >>>>>> % Plot interpolated data >>>>>> cfg = []; %#ok >>>>>> cfg.method = 'ortho'; % spline >>>>>> cfg.funparameter = 'avg.pow'; >>>>>> ft_sourceplot( cfg, sourceInt); >>>>>> >>>>>> However the figure that comes up just had orange squares in the >>>>>> subplots. >>>>>> >>>>>> I dont know where Ive gone wrong. >>>>>> >>>>>> >>>>>> Tyler >>>>>> >>>>>> >>>>>> ************************* >>>>>> >>>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>>> /PhD Candidate/ >>>>>> /Brain Signals Laboratory/ >>>>>> /Flinders University/ >>>>>> /Rm 5A301/ >>>>>> /Ext 66124/ >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> -- >>>>> Jörn M. Horschig >>>>> PhD Student >>>>> Donders Institute for Brain, Cognition and Behaviour >>>>> Centre for Cognitive Neuroimaging >>>>> Radboud University Nijmegen >>>>> Neuronal Oscillations Group >>>>> FieldTrip Development Team >>>>> >>>>> P.O. Box 9101 >>>>> NL-6500 HB Nijmegen >>>>> The Netherlands >>>>> >>>>> Contact: >>>>> E-Mail: jm.horschig at donders.ru.nl >>>>> Tel: +31-(0)24-36-68493 >>>>> Web: http://www.ru.nl/donders >>>>> >>>>> Visiting address: >>>>> Trigon, room 2.30 >>>>> Kapittelweg 29 >>>>> NL-6525 EN Nijmegen >>>>> The Netherlands >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> -- >>>> Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From r.oostenveld at donders.ru.nl Tue Apr 1 19:19:57 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 1 Apr 2014 19:19:57 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <533AD84B.6060600@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>, <533985D8.4080504@donders.ru.nl> <533AD84B.6060600@donders.ru.nl> Message-ID: Hi Jorn I was browsing the FT list and see that you got involved with this question from Tyler. I can imagine there being problems with a pipeline like this preprocessing -> componentanalysis -> timelockanalysis -> dipolefitting although it should (i.e. "is meant to") work by fitting dipoles to component topographies. But the code is not frequently used like this and it might be possible that there has been regression of the code (i.e bugs in the latest version that were not there before). With sourceanalysis it depends on the method. Covariance estimates between components does not make much sense in the further inversion, and thereby beamforming won’t work. MNE should in principle work, but not with an estimated data covariance but rather a scaled identity covariance. Given the uncertain level of support , but clear expectations on what should (and should not) work, I suggest to file it as “bug” (i.e. the issue is that it should be tested) and to write a test script that goes (with e.g. some simulated data) over the various options. best regards, Robert On 01 Apr 2014, at 17:16, Jörn M. Horschig wrote: > Hi Tyler, > > any reason why you don't want to go back to sensor-space but stay in component-space with your data? I would assume that the error will be gone if you use the back-projected data (ft_rejectcomponent, with cfg.component = []). > > Best, > Jörn > > On 4/1/2014 8:15 AM, Tyler Grummett wrote: >> Hey Jorn, >> >> In addition to my previous emails, Ive been trying to debug the functions. >> >> In ft_sourceanalysis, line 661 to 677: >> >> % HACK: use the default code >> % select the channels of interest >> [dum, datchanindx] = match_str(cfg.channel, data.label); >> if strcmp(data.dimord, 'chan_time') >> % It is in principle possible to have timelockanalysis with >> % keeptrial=yes and only a single trial in the raw data. >> % In that case the covariance should be represented as Nchan*Nchan >> data.avg = data.avg(datchanindx,:); >> %data.cov = reshape(data.cov, length(datchanindx), length(datchanindx)); >> data.cov = data.cov(datchanindx,datchanindx); >> else >> data.avg = data.avg(datchanindx,:); >> data.cov = data.cov(:,datchanindx,datchanindx); >> data.trial = data.trial(:,datchanindx,:); >> end >> data.label = data.label(datchanindx); >> Nchans = length(data.label); >> >> I found that my cfg.channel is []; and the data.label is all my ICA components labelled ica_001 etc. >> >> So it is returned as a []; >> which means data.cov = []; >> >> I think then it will crash later parts of the code. Does this function work on ICA components? >> >> I ran the ICA in eeglab. >> >> Tyler. >> >> ************************* >> >> Tyler Grummett ( BBSc, BSc(Hons I)) >> PhD Candidate >> Brain Signals Laboratory >> Flinders University >> Rm 5A301 >> Ext 66124 >> >> ________________________________________ >> From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" >> Sent: Tuesday, 1 April 2014 1:42 AM >> To: fieldtrip at science.ru.nl >> Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot >> >> just to clarify and be precise >>> The pos-matrix has to be a regular 3D grid, i.e. be representable as a >>> 3x3x3 matrix. >> it actually does not have to be as you can also beam individual grid >> points, but if you have a .dim field, then is has to be like above. But >> that does not affect the rest of the mail I wrote ;) >> >> >>> I am not quite sure how the sourceinterpolate function is handeling >>> the fact that you do not have that .dim field. Apparently, it is also >>> confused ;) >>> >>> Do you want to reconstruct only some voxels? From your code it seems >>> that you want to cover the whole brain with a 1cm resolution. If the >>> latter is the case, maybe restart with creating your forward model by >>> following the tutorial that I posted in my previous mail. There are >>> some sanity checks that can help you figuring out if you are doing the >>> correct thing. If the former one is the case, please explain again >>> what exactly you want to achieve and how you are building your forward >>> model. >>> >>> Best, >>> Jörn >>> >>> btw, there's nothing wrong with being a PhD student, it's just a >>> matter of experience in practice and theory as in all domains in life ;) >>> >>> >>> On 3/31/2014 3:15 PM, Tyler Grummett wrote: >>>> Hey Jorn, >>>> >>>> Yes I am definitely confused haha, this stuff is way out of my league >>>> as a PhD student. >>>> Anyway, I feel we are getting somewhere. >>>> >>>> timelock = >>>> >>>> avg: [121x19767 double] >>>> var: [121x19767 double] >>>> time: [1x19767 double] >>>> dof: [121x19767 double] >>>> label: {1x121 cell} >>>> dimord: 'chan_time' >>>> cov: [121x121 double] >>>> elec: [1x1 struct] >>>> cfg: [1x1 struct] >>>> >>>> source = >>>> >>>> time: [1x19767 double] >>>> pos: [642x3 double] >>>> inside: [642x1 double] >>>> outside: [] >>>> method: 'average' >>>> avg: [1x1 struct] >>>> cfg: [1x1 struct] >>>> >>>> sourceInt = >>>> >>>> time: [1x19767 double] >>>> avg: [1x1 struct] >>>> pos: [16777216x3 double] >>>> dim: [256 256 256] >>>> inside: [1x16777216 double] >>>> outside: [1x0 double] >>>> coordsys: 'ctf' >>>> unit: 'mm' >>>> cfg: [1x1 struct] >>>> >>>> Given what I said last time, I might not comment on the differences. >>>> I hope you can see something wrong. >>>> >>>> One thing I should mention is that the data is continuous, around 30 >>>> seconds. Therefore there is only one trial, >>>> is that an issue? >>>> >>>> Tyler >>>> >>>> ************************* >>>> >>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>> PhD Candidate >>>> Brain Signals Laboratory >>>> Flinders University >>>> Rm 5A301 >>>> Ext 66124 >>>> >>>> ________________________________________ >>>> From: fieldtrip-bounces at science.ru.nl >>>> on behalf of "Jörn M. Horschig" >>>> >>>> Sent: Monday, 31 March 2014 10:24 PM >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>> ft_sourceplot >>>> >>>> Hi Tyler, >>>> >>>> there is not much inherently different between time- and >>>> freuqency-domain beamformer, at least in terms of computing the forward >>>> and the inverse solution. But I see that you are obviously confused, so >>>> let me try to help you out and shed some light on what you are actually >>>> doing ;) >>>> >>>> >>>>> I had a look at my variables. >>>>> >>>>> source.avg = >>>>> >>>>> pow: [642x1 double] >>>>> filter: {642x1 cell} >>>>> >>>>> sourceInt.avg = >>>>> >>>>> pow: [16777216x1 double] >>>>> >>>>> So clearly, as both variables are completely different. Something >>>>> has gone wrong. >>>> No, that is actually how it should be. From below you can see that your >>>> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >>>> 16777216 elements. In line with source.avg.pow, you should see that your >>>> 'grid' consists of 642 elements, so you were computing your source >>>> activity on a grid of in total 642 elements. Then you used the original >>>> MRI to interpolate from 642 to these 16 million grid points. Actually, >>>> since you specific cfg.downsample = 2, it should have been only 8 >>>> million points, so that's where things already get a bit weird. >>>> >>>> So let's go into some sanity checks: >>>> 1. are you using the latest version (or a recent, i.e. from this year) >>>> of FielTrip? >>>> 2. sourceInt should look something like this, does it? >>>> >>>> source_diff_int = >>>> inside: [46x55x46 logical] >>>> avg: [1x1 struct] >>>> dim: [46 55 46] >>>> transform: [4x4 double] >>>> anatomy: [46x55x46 double] >>>> unit: 'mm' >>>> cfg: [1x1 struct] >>>> >>>> >>>> >>>> 3. source should look something like this: >>>> >>>> source = >>>> dim: [20 25 22] >>>> freq: 54.8287 >>>> cumtapcnt: [338x1 double] >>>> pos: [11000x3 double] >>>> inside: [1x5798 double] >>>> outside: [1x5202 double] >>>> method: 'average' >>>> avg: [1x1 struct] >>>> trialinfo: [338x1 double] >>>> cfg: [1x1 struct] >>>> >>>> 4. also check your grid, should be something like this: >>>> >>>> sourcemodel = >>>> >>>> pos: [11000x3 double] >>>> dim: [20 25 22] >>>> unit: 'cm' >>>> inside: [1x5798 double] >>>> outside: [1x5202 double] >>>> params: [1x1 struct] >>>> initial: [4x4 double] >>>> cfg: [1x1 struct] >>>> >>>> >>>> Of course, it should all look a bit different, because you are using >>>> LCMV, but essentially it should be the same. Lastly, you can check other >>>> source plotting methods, like 'ortho' or try to plot the source >>>> structure rather than the sourceInt structure. In the end, the error >>>> must be somewhere in your grid, be it in .pos or .inside, because >>>> FieldTrip thinks that there is only one voxel to be plotted. There are >>>> other things that may be the issue, but I am not sure about these. So, I >>>> would suggest that you play a bit around and see where the error might >>>> come from (e.g. follow this tutorial: >>>> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >>>> steps that you need for LCMV, maybe also check out: >>>> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >>>> >>>> there, LCMV is used, but on one voxel only) >>>> >>>> Best, >>>> Jörn >>>> >>>>> The next part of my code is the following: >>>>> >>>>> % interpolate sources >>>>> mri = ft_read_mri('Subject01.mri'); >>>>> mri = ft_volumereslice([], mri); >>>>> >>>>> cfg = []; >>>>> cfg.downsample = 2; >>>>> cfg.parameter = 'avg.pow'; >>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>> parameter >>>>> % does not vary over time, therefore the time >>>>> dimension is not needed. >>>>> >>>>> mri = >>>>> >>>>> anatomy: [256x256x256 double] >>>>> dim: [256 256 256] >>>>> transform: [4x4 double] >>>>> coordsys: 'ctf' >>>>> unit: 'mm' >>>>> cfg: [1x1 struct] >>>>> >>>>> I cant really see if the data works in the tutorial because it >>>>> doesnt appear as though fieldtrip has a tutorial on lcmv >>>>> beamformers, they seem to stick to frequency domain beamformers. >>>>> >>>>> Ive been wrong before though, >>>>> >>>>> thanks for your help. >>>>> >>>>> Tyler >>>>> >>>>> ************************* >>>>> >>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>> PhD Candidate >>>>> Brain Signals Laboratory >>>>> Flinders University >>>>> Rm 5A301 >>>>> Ext 66124 >>>>> >>>>> ________________________________________ >>>>> From: fieldtrip-bounces at science.ru.nl >>>>> on behalf of "Jörn M. Horschig" >>>>> >>>>> Sent: Monday, 31 March 2014 7:13 PM >>>>> To: FieldTrip discussion list >>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>> ft_sourceplot >>>>> >>>>> Hi Tyler, >>>>> >>>>> hm, okay, it could be that the issue with the leadfield and with the >>>>> plot are related, but it could also be that they are separate issues. I >>>>> just saw that you posted the same 'problem' on bugzilla and included a >>>>> picture. Maybe for next time, include a picture on the mailinglist and >>>>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>>>> and not if you are not sure. That saves us a lot of time in separating >>>>> code issues from user problems ;) >>>>> >>>>> So, back to you problem. It seems that your reconstruction results in >>>>> one voxel only. Are you sure that your grid consistents of more than >>>>> just one position? So, for example check the size of the matrices in >>>>> source.avg, source- and headmodel, etc. >>>>> >>>>> Also, you can check in Matlab the respective fields of source and >>>>> sourceInt and see whether that makes sense. >>>>> >>>>> Lastly, a neat way to check is always to use your code on data from the >>>>> tutorial, and vice versa, use code from the tutorial on your data and >>>>> see whether that works. Both should give sensible results, and if one >>>>> does not, you know where to start looking for a solution ;) >>>>> >>>>> Best, >>>>> Jörn >>>>> >>>>> >>>>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>>>> Hey Jorn, >>>>>> >>>>>> Previously I have let ft_sourceanalysis do a lead field because if >>>>>> I use the following code: >>>>>> >>>>>> % compute lead field ( apparently source analysis computes >>>>>> % lead field anyway >>>>>> cfg = []; >>>>>> cfg.elec = timelock.elec; >>>>>> cfg.vol = vol; >>>>>> cfg.reducerank = 3; >>>>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>>>> cm resolution >>>>>> cfg.grid.unit = 'cm'; >>>>>> cfg.normalize = 'yes'; % if you are not >>>>>> contrasting the activity of interest again another condition or >>>>>> baseline time-window >>>>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>>>> I AM UP TO >>>>>> >>>>>> and then calculate the source analysis: >>>>>> >>>>>> % Source Analysis: without contrasting condition >>>>>> cfg = []; >>>>>> cfg.method = 'lcmv'; >>>>>> cfg.grid = grid; >>>>>> cfg.vol = vol; >>>>>> % cfg.grid.pos = maxpos; >>>>>> cfg.keepfilter = 'yes'; >>>>>> cfg.dics.projectnoise = 'yes'; >>>>>> % cfg.dics.lambda = 0; >>>>>> source = ft_sourceanalysis( cfg, timelock); >>>>>> >>>>>> then I get an error than says: >>>>>> >>>>>> Error using * >>>>>> Inner matrix dimensions must agree. >>>>>> >>>>>> Error in beamformer_lcmv (line 268) >>>>>> filt = pinv(lf' * invCy * lf) * lf' * >>>>>> invCy; % van Veen eqn. 23, use >>>>>> PINV/SVD to cover rank deficient leadfield >>>>>> >>>>>> Error in ft_sourceanalysis (line 794) >>>>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>>>> optarg{:}); >>>>>> >>>>>> I just removed the leadfield code and it successfully ran. I could >>>>>> also interpolate it later. >>>>>> Is this the correct approach. >>>>>> >>>>>> Thankyou in advance! >>>>>> >>>>>> Tyler >>>>>> >>>>>> ************************* >>>>>> >>>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>>> PhD Candidate >>>>>> Brain Signals Laboratory >>>>>> Flinders University >>>>>> Rm 5A301 >>>>>> Ext 66124 >>>>>> >>>>>> ________________________________________ >>>>>> From: fieldtrip-bounces at science.ru.nl >>>>>> on behalf of "Jörn M. Horschig" >>>>>> >>>>>> Sent: Monday, 31 March 2014 5:30 PM >>>>>> To: FieldTrip discussion list >>>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>>> ft_sourceplot >>>>>> >>>>>> Hi Tyler, >>>>>> >>>>>> what you are describing sounds to me like the center bias of the >>>>>> beamformer. Did you contrast the activity with anything, or did you >>>>>> normalize your leadfield? >>>>>> Check this out: >>>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>>>> >>>>>> >>>>>> Best, >>>>>> Jörn >>>>>> >>>>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>>>> I have been trying to plot my interpolated source data using the >>>>>>> code: >>>>>>> >>>>>>> % interpolate sources >>>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>>> mri = ft_volumereslice([], mri); >>>>>>> cfg = []; >>>>>>> cfg.downsample = 2; >>>>>>> cfg.parameter = 'avg.pow'; >>>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>>> parameter >>>>>>> % does not vary over time, therefore the time >>>>>>> dimension >>>>>>> is not needed. >>>>>>> >>>>>>> % Plot interpolated data >>>>>>> cfg = []; %#ok >>>>>>> cfg.method = 'ortho'; % spline >>>>>>> cfg.funparameter = 'avg.pow'; >>>>>>> ft_sourceplot( cfg, sourceInt); >>>>>>> >>>>>>> However the figure that comes up just had orange squares in the >>>>>>> subplots. >>>>>>> >>>>>>> I dont know where Ive gone wrong. >>>>>>> >>>>>>> >>>>>>> Tyler >>>>>>> >>>>>>> >>>>>>> ************************* >>>>>>> >>>>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>>>> /PhD Candidate/ >>>>>>> /Brain Signals Laboratory/ >>>>>>> /Flinders University/ >>>>>>> /Rm 5A301/ >>>>>>> /Ext 66124/ >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> -- >>>>>> Jörn M. Horschig >>>>>> PhD Student >>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>> Centre for Cognitive Neuroimaging >>>>>> Radboud University Nijmegen >>>>>> Neuronal Oscillations Group >>>>>> FieldTrip Development Team >>>>>> >>>>>> P.O. Box 9101 >>>>>> NL-6500 HB Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> Contact: >>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>> Tel: +31-(0)24-36-68493 >>>>>> Web: http://www.ru.nl/donders >>>>>> >>>>>> Visiting address: >>>>>> Trigon, room 2.30 >>>>>> Kapittelweg 29 >>>>>> NL-6525 EN Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> -- >>>>> Jörn M. Horschig >>>>> PhD Student >>>>> Donders Institute for Brain, Cognition and Behaviour >>>>> Centre for Cognitive Neuroimaging >>>>> Radboud University Nijmegen >>>>> Neuronal Oscillations Group >>>>> FieldTrip Development Team >>>>> >>>>> P.O. Box 9101 >>>>> NL-6500 HB Nijmegen >>>>> The Netherlands >>>>> >>>>> Contact: >>>>> E-Mail: jm.horschig at donders.ru.nl >>>>> Tel: +31-(0)24-36-68493 >>>>> Web: http://www.ru.nl/donders >>>>> >>>>> Visiting address: >>>>> Trigon, room 2.30 >>>>> Kapittelweg 29 >>>>> NL-6525 EN Nijmegen >>>>> The Netherlands >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> -- >>>> Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From gopalar.ccf at gmail.com Tue Apr 1 21:31:35 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Tue, 1 Apr 2014 15:31:35 -0400 Subject: [FieldTrip] Source statistics on spatio-temporal source reconstruction data (MNE) Message-ID: Dear all, I saw a lot of discussion about source grand average and source statistics on Spatio-temporal MNE source data in the forum, however the last major discussion was in june 2013 http://mailman.science.ru.nl/pipermail/fieldtrip/2013-June/006684.html I was wondering if any major updates have been done to fieldtrip to tackle this issue since then. I also see a bug report on this issue. http://bugzilla.fcdonders.nl/show_bug.cgi?id=2185 It would be great if someone can revive this discussion with some new information. Thanks vey much Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Apr 1 22:34:18 2014 From: jm.horschig at donders.ru.nl (=?windows-1252?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 01 Apr 2014 22:34:18 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>, <533985D8.4080504@donders.ru.nl> <533AD84B.6060600@donders.ru.nl> Message-ID: <533B22CA.8040305@donders.ru.nl> Hi Robert, yes, I thought so, that's why I put it on the agenda for tomorrow's meeting to discuss in more detail to figure out what needs to be done :) Best, Jörn On 4/1/2014 7:19 PM, Robert Oostenveld wrote: > Hi Jorn > > I was browsing the FT list and see that you got involved with this question from Tyler. I can imagine there being problems with a pipeline like this > > preprocessing -> componentanalysis -> timelockanalysis -> dipolefitting > > although it should (i.e. "is meant to") work by fitting dipoles to component topographies. But the code is not frequently used like this and it might be possible that there has been regression of the code (i.e bugs in the latest version that were not there before). > > With sourceanalysis it depends on the method. Covariance estimates between components does not make much sense in the further inversion, and thereby beamforming won’t work. MNE should in principle work, but not with an estimated data covariance but rather a scaled identity covariance. > > Given the uncertain level of support , but clear expectations on what should (and should not) work, I suggest to file it as “bug” (i.e. the issue is that it should be tested) and to write a test script that goes (with e.g. some simulated data) over the various options. > > best regards, > Robert > > > On 01 Apr 2014, at 17:16, Jörn M. Horschig wrote: > >> Hi Tyler, >> >> any reason why you don't want to go back to sensor-space but stay in component-space with your data? I would assume that the error will be gone if you use the back-projected data (ft_rejectcomponent, with cfg.component = []). >> >> Best, >> Jörn >> >> On 4/1/2014 8:15 AM, Tyler Grummett wrote: >>> Hey Jorn, >>> >>> In addition to my previous emails, Ive been trying to debug the functions. >>> >>> In ft_sourceanalysis, line 661 to 677: >>> >>> % HACK: use the default code >>> % select the channels of interest >>> [dum, datchanindx] = match_str(cfg.channel, data.label); >>> if strcmp(data.dimord, 'chan_time') >>> % It is in principle possible to have timelockanalysis with >>> % keeptrial=yes and only a single trial in the raw data. >>> % In that case the covariance should be represented as Nchan*Nchan >>> data.avg = data.avg(datchanindx,:); >>> %data.cov = reshape(data.cov, length(datchanindx), length(datchanindx)); >>> data.cov = data.cov(datchanindx,datchanindx); >>> else >>> data.avg = data.avg(datchanindx,:); >>> data.cov = data.cov(:,datchanindx,datchanindx); >>> data.trial = data.trial(:,datchanindx,:); >>> end >>> data.label = data.label(datchanindx); >>> Nchans = length(data.label); >>> >>> I found that my cfg.channel is []; and the data.label is all my ICA components labelled ica_001 etc. >>> >>> So it is returned as a []; >>> which means data.cov = []; >>> >>> I think then it will crash later parts of the code. Does this function work on ICA components? >>> >>> I ran the ICA in eeglab. >>> >>> Tyler. >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" >>> Sent: Tuesday, 1 April 2014 1:42 AM >>> To: fieldtrip at science.ru.nl >>> Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot >>> >>> just to clarify and be precise >>>> The pos-matrix has to be a regular 3D grid, i.e. be representable as a >>>> 3x3x3 matrix. >>> it actually does not have to be as you can also beam individual grid >>> points, but if you have a .dim field, then is has to be like above. But >>> that does not affect the rest of the mail I wrote ;) >>> >>> >>>> I am not quite sure how the sourceinterpolate function is handeling >>>> the fact that you do not have that .dim field. Apparently, it is also >>>> confused ;) >>>> >>>> Do you want to reconstruct only some voxels? From your code it seems >>>> that you want to cover the whole brain with a 1cm resolution. If the >>>> latter is the case, maybe restart with creating your forward model by >>>> following the tutorial that I posted in my previous mail. There are >>>> some sanity checks that can help you figuring out if you are doing the >>>> correct thing. If the former one is the case, please explain again >>>> what exactly you want to achieve and how you are building your forward >>>> model. >>>> >>>> Best, >>>> Jörn >>>> >>>> btw, there's nothing wrong with being a PhD student, it's just a >>>> matter of experience in practice and theory as in all domains in life ;) >>>> >>>> >>>> On 3/31/2014 3:15 PM, Tyler Grummett wrote: >>>>> Hey Jorn, >>>>> >>>>> Yes I am definitely confused haha, this stuff is way out of my league >>>>> as a PhD student. >>>>> Anyway, I feel we are getting somewhere. >>>>> >>>>> timelock = >>>>> >>>>> avg: [121x19767 double] >>>>> var: [121x19767 double] >>>>> time: [1x19767 double] >>>>> dof: [121x19767 double] >>>>> label: {1x121 cell} >>>>> dimord: 'chan_time' >>>>> cov: [121x121 double] >>>>> elec: [1x1 struct] >>>>> cfg: [1x1 struct] >>>>> >>>>> source = >>>>> >>>>> time: [1x19767 double] >>>>> pos: [642x3 double] >>>>> inside: [642x1 double] >>>>> outside: [] >>>>> method: 'average' >>>>> avg: [1x1 struct] >>>>> cfg: [1x1 struct] >>>>> >>>>> sourceInt = >>>>> >>>>> time: [1x19767 double] >>>>> avg: [1x1 struct] >>>>> pos: [16777216x3 double] >>>>> dim: [256 256 256] >>>>> inside: [1x16777216 double] >>>>> outside: [1x0 double] >>>>> coordsys: 'ctf' >>>>> unit: 'mm' >>>>> cfg: [1x1 struct] >>>>> >>>>> Given what I said last time, I might not comment on the differences. >>>>> I hope you can see something wrong. >>>>> >>>>> One thing I should mention is that the data is continuous, around 30 >>>>> seconds. Therefore there is only one trial, >>>>> is that an issue? >>>>> >>>>> Tyler >>>>> >>>>> ************************* >>>>> >>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>> PhD Candidate >>>>> Brain Signals Laboratory >>>>> Flinders University >>>>> Rm 5A301 >>>>> Ext 66124 >>>>> >>>>> ________________________________________ >>>>> From: fieldtrip-bounces at science.ru.nl >>>>> on behalf of "Jörn M. Horschig" >>>>> >>>>> Sent: Monday, 31 March 2014 10:24 PM >>>>> To: FieldTrip discussion list >>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>> ft_sourceplot >>>>> >>>>> Hi Tyler, >>>>> >>>>> there is not much inherently different between time- and >>>>> freuqency-domain beamformer, at least in terms of computing the forward >>>>> and the inverse solution. But I see that you are obviously confused, so >>>>> let me try to help you out and shed some light on what you are actually >>>>> doing ;) >>>>> >>>>> >>>>>> I had a look at my variables. >>>>>> >>>>>> source.avg = >>>>>> >>>>>> pow: [642x1 double] >>>>>> filter: {642x1 cell} >>>>>> >>>>>> sourceInt.avg = >>>>>> >>>>>> pow: [16777216x1 double] >>>>>> >>>>>> So clearly, as both variables are completely different. Something >>>>>> has gone wrong. >>>>> No, that is actually how it should be. From below you can see that your >>>>> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >>>>> 16777216 elements. In line with source.avg.pow, you should see that your >>>>> 'grid' consists of 642 elements, so you were computing your source >>>>> activity on a grid of in total 642 elements. Then you used the original >>>>> MRI to interpolate from 642 to these 16 million grid points. Actually, >>>>> since you specific cfg.downsample = 2, it should have been only 8 >>>>> million points, so that's where things already get a bit weird. >>>>> >>>>> So let's go into some sanity checks: >>>>> 1. are you using the latest version (or a recent, i.e. from this year) >>>>> of FielTrip? >>>>> 2. sourceInt should look something like this, does it? >>>>> >>>>> source_diff_int = >>>>> inside: [46x55x46 logical] >>>>> avg: [1x1 struct] >>>>> dim: [46 55 46] >>>>> transform: [4x4 double] >>>>> anatomy: [46x55x46 double] >>>>> unit: 'mm' >>>>> cfg: [1x1 struct] >>>>> >>>>> >>>>> >>>>> 3. source should look something like this: >>>>> >>>>> source = >>>>> dim: [20 25 22] >>>>> freq: 54.8287 >>>>> cumtapcnt: [338x1 double] >>>>> pos: [11000x3 double] >>>>> inside: [1x5798 double] >>>>> outside: [1x5202 double] >>>>> method: 'average' >>>>> avg: [1x1 struct] >>>>> trialinfo: [338x1 double] >>>>> cfg: [1x1 struct] >>>>> >>>>> 4. also check your grid, should be something like this: >>>>> >>>>> sourcemodel = >>>>> >>>>> pos: [11000x3 double] >>>>> dim: [20 25 22] >>>>> unit: 'cm' >>>>> inside: [1x5798 double] >>>>> outside: [1x5202 double] >>>>> params: [1x1 struct] >>>>> initial: [4x4 double] >>>>> cfg: [1x1 struct] >>>>> >>>>> >>>>> Of course, it should all look a bit different, because you are using >>>>> LCMV, but essentially it should be the same. Lastly, you can check other >>>>> source plotting methods, like 'ortho' or try to plot the source >>>>> structure rather than the sourceInt structure. In the end, the error >>>>> must be somewhere in your grid, be it in .pos or .inside, because >>>>> FieldTrip thinks that there is only one voxel to be plotted. There are >>>>> other things that may be the issue, but I am not sure about these. So, I >>>>> would suggest that you play a bit around and see where the error might >>>>> come from (e.g. follow this tutorial: >>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >>>>> steps that you need for LCMV, maybe also check out: >>>>> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >>>>> >>>>> there, LCMV is used, but on one voxel only) >>>>> >>>>> Best, >>>>> Jörn >>>>> >>>>>> The next part of my code is the following: >>>>>> >>>>>> % interpolate sources >>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>> mri = ft_volumereslice([], mri); >>>>>> >>>>>> cfg = []; >>>>>> cfg.downsample = 2; >>>>>> cfg.parameter = 'avg.pow'; >>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>> parameter >>>>>> % does not vary over time, therefore the time >>>>>> dimension is not needed. >>>>>> >>>>>> mri = >>>>>> >>>>>> anatomy: [256x256x256 double] >>>>>> dim: [256 256 256] >>>>>> transform: [4x4 double] >>>>>> coordsys: 'ctf' >>>>>> unit: 'mm' >>>>>> cfg: [1x1 struct] >>>>>> >>>>>> I cant really see if the data works in the tutorial because it >>>>>> doesnt appear as though fieldtrip has a tutorial on lcmv >>>>>> beamformers, they seem to stick to frequency domain beamformers. >>>>>> >>>>>> Ive been wrong before though, >>>>>> >>>>>> thanks for your help. >>>>>> >>>>>> Tyler >>>>>> >>>>>> ************************* >>>>>> >>>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>>> PhD Candidate >>>>>> Brain Signals Laboratory >>>>>> Flinders University >>>>>> Rm 5A301 >>>>>> Ext 66124 >>>>>> >>>>>> ________________________________________ >>>>>> From: fieldtrip-bounces at science.ru.nl >>>>>> on behalf of "Jörn M. Horschig" >>>>>> >>>>>> Sent: Monday, 31 March 2014 7:13 PM >>>>>> To: FieldTrip discussion list >>>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>>> ft_sourceplot >>>>>> >>>>>> Hi Tyler, >>>>>> >>>>>> hm, okay, it could be that the issue with the leadfield and with the >>>>>> plot are related, but it could also be that they are separate issues. I >>>>>> just saw that you posted the same 'problem' on bugzilla and included a >>>>>> picture. Maybe for next time, include a picture on the mailinglist and >>>>>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>>>>> and not if you are not sure. That saves us a lot of time in separating >>>>>> code issues from user problems ;) >>>>>> >>>>>> So, back to you problem. It seems that your reconstruction results in >>>>>> one voxel only. Are you sure that your grid consistents of more than >>>>>> just one position? So, for example check the size of the matrices in >>>>>> source.avg, source- and headmodel, etc. >>>>>> >>>>>> Also, you can check in Matlab the respective fields of source and >>>>>> sourceInt and see whether that makes sense. >>>>>> >>>>>> Lastly, a neat way to check is always to use your code on data from the >>>>>> tutorial, and vice versa, use code from the tutorial on your data and >>>>>> see whether that works. Both should give sensible results, and if one >>>>>> does not, you know where to start looking for a solution ;) >>>>>> >>>>>> Best, >>>>>> Jörn >>>>>> >>>>>> >>>>>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>>>>> Hey Jorn, >>>>>>> >>>>>>> Previously I have let ft_sourceanalysis do a lead field because if >>>>>>> I use the following code: >>>>>>> >>>>>>> % compute lead field ( apparently source analysis computes >>>>>>> % lead field anyway >>>>>>> cfg = []; >>>>>>> cfg.elec = timelock.elec; >>>>>>> cfg.vol = vol; >>>>>>> cfg.reducerank = 3; >>>>>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>>>>> cm resolution >>>>>>> cfg.grid.unit = 'cm'; >>>>>>> cfg.normalize = 'yes'; % if you are not >>>>>>> contrasting the activity of interest again another condition or >>>>>>> baseline time-window >>>>>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>>>>> I AM UP TO >>>>>>> >>>>>>> and then calculate the source analysis: >>>>>>> >>>>>>> % Source Analysis: without contrasting condition >>>>>>> cfg = []; >>>>>>> cfg.method = 'lcmv'; >>>>>>> cfg.grid = grid; >>>>>>> cfg.vol = vol; >>>>>>> % cfg.grid.pos = maxpos; >>>>>>> cfg.keepfilter = 'yes'; >>>>>>> cfg.dics.projectnoise = 'yes'; >>>>>>> % cfg.dics.lambda = 0; >>>>>>> source = ft_sourceanalysis( cfg, timelock); >>>>>>> >>>>>>> then I get an error than says: >>>>>>> >>>>>>> Error using * >>>>>>> Inner matrix dimensions must agree. >>>>>>> >>>>>>> Error in beamformer_lcmv (line 268) >>>>>>> filt = pinv(lf' * invCy * lf) * lf' * >>>>>>> invCy; % van Veen eqn. 23, use >>>>>>> PINV/SVD to cover rank deficient leadfield >>>>>>> >>>>>>> Error in ft_sourceanalysis (line 794) >>>>>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>>>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>>>>> optarg{:}); >>>>>>> >>>>>>> I just removed the leadfield code and it successfully ran. I could >>>>>>> also interpolate it later. >>>>>>> Is this the correct approach. >>>>>>> >>>>>>> Thankyou in advance! >>>>>>> >>>>>>> Tyler >>>>>>> >>>>>>> ************************* >>>>>>> >>>>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>>>> PhD Candidate >>>>>>> Brain Signals Laboratory >>>>>>> Flinders University >>>>>>> Rm 5A301 >>>>>>> Ext 66124 >>>>>>> >>>>>>> ________________________________________ >>>>>>> From: fieldtrip-bounces at science.ru.nl >>>>>>> on behalf of "Jörn M. Horschig" >>>>>>> >>>>>>> Sent: Monday, 31 March 2014 5:30 PM >>>>>>> To: FieldTrip discussion list >>>>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>>>> ft_sourceplot >>>>>>> >>>>>>> Hi Tyler, >>>>>>> >>>>>>> what you are describing sounds to me like the center bias of the >>>>>>> beamformer. Did you contrast the activity with anything, or did you >>>>>>> normalize your leadfield? >>>>>>> Check this out: >>>>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>>>>> >>>>>>> >>>>>>> Best, >>>>>>> Jörn >>>>>>> >>>>>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>>>>> I have been trying to plot my interpolated source data using the >>>>>>>> code: >>>>>>>> >>>>>>>> % interpolate sources >>>>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>>>> mri = ft_volumereslice([], mri); >>>>>>>> cfg = []; >>>>>>>> cfg.downsample = 2; >>>>>>>> cfg.parameter = 'avg.pow'; >>>>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>>>> parameter >>>>>>>> % does not vary over time, therefore the time >>>>>>>> dimension >>>>>>>> is not needed. >>>>>>>> >>>>>>>> % Plot interpolated data >>>>>>>> cfg = []; %#ok >>>>>>>> cfg.method = 'ortho'; % spline >>>>>>>> cfg.funparameter = 'avg.pow'; >>>>>>>> ft_sourceplot( cfg, sourceInt); >>>>>>>> >>>>>>>> However the figure that comes up just had orange squares in the >>>>>>>> subplots. >>>>>>>> >>>>>>>> I dont know where Ive gone wrong. >>>>>>>> >>>>>>>> >>>>>>>> Tyler >>>>>>>> >>>>>>>> >>>>>>>> ************************* >>>>>>>> >>>>>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>>>>> /PhD Candidate/ >>>>>>>> /Brain Signals Laboratory/ >>>>>>>> /Flinders University/ >>>>>>>> /Rm 5A301/ >>>>>>>> /Ext 66124/ >>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> fieldtrip mailing list >>>>>>>> fieldtrip at donders.ru.nl >>>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> -- >>>>>>> Jörn M. Horschig >>>>>>> PhD Student >>>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>>> Centre for Cognitive Neuroimaging >>>>>>> Radboud University Nijmegen >>>>>>> Neuronal Oscillations Group >>>>>>> FieldTrip Development Team >>>>>>> >>>>>>> P.O. Box 9101 >>>>>>> NL-6500 HB Nijmegen >>>>>>> The Netherlands >>>>>>> >>>>>>> Contact: >>>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>>> Tel: +31-(0)24-36-68493 >>>>>>> Web: http://www.ru.nl/donders >>>>>>> >>>>>>> Visiting address: >>>>>>> Trigon, room 2.30 >>>>>>> Kapittelweg 29 >>>>>>> NL-6525 EN Nijmegen >>>>>>> The Netherlands >>>>>>> >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> -- >>>>>> Jörn M. Horschig >>>>>> PhD Student >>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>> Centre for Cognitive Neuroimaging >>>>>> Radboud University Nijmegen >>>>>> Neuronal Oscillations Group >>>>>> FieldTrip Development Team >>>>>> >>>>>> P.O. Box 9101 >>>>>> NL-6500 HB Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> Contact: >>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>> Tel: +31-(0)24-36-68493 >>>>>> Web: http://www.ru.nl/donders >>>>>> >>>>>> Visiting address: >>>>>> Trigon, room 2.30 >>>>>> Kapittelweg 29 >>>>>> NL-6525 EN Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> -- >>>>> Jörn M. Horschig >>>>> PhD Student >>>>> Donders Institute for Brain, Cognition and Behaviour >>>>> Centre for Cognitive Neuroimaging >>>>> Radboud University Nijmegen >>>>> Neuronal Oscillations Group >>>>> FieldTrip Development Team >>>>> >>>>> P.O. Box 9101 >>>>> NL-6500 HB Nijmegen >>>>> The Netherlands >>>>> >>>>> Contact: >>>>> E-Mail: jm.horschig at donders.ru.nl >>>>> Tel: +31-(0)24-36-68493 >>>>> Web: http://www.ru.nl/donders >>>>> >>>>> Visiting address: >>>>> Trigon, room 2.30 >>>>> Kapittelweg 29 >>>>> NL-6525 EN Nijmegen >>>>> The Netherlands >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From tyler.grummett at flinders.edu.au Tue Apr 1 23:06:40 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 1 Apr 2014 21:06:40 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <533B22CA.8040305@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>, <533985D8.4080504@donders.ru.nl> <533AD84B.6060600@donders.ru.nl> , <533B22CA.8040305@donders.ru.nl> Message-ID: Hello jorn and robert, The plan is to use the data for functional connectivity. The only alternative we seem to have is dipole fitting in eeglab and then clustering. However we thought that if we used beamformer we would have many more sources to be able to run functional connectivity algorithms. I'm sorry of this has become an issue, what do you advise? Tyler > On 2 Apr 2014, at 7:06 am, "Jörn M. Horschig" wrote: > > Hi Robert, > > yes, I thought so, that's why I put it on the agenda for tomorrow's meeting to discuss in more detail to figure out what needs to be done :) > > Best, > Jörn > >> On 4/1/2014 7:19 PM, Robert Oostenveld wrote: >> Hi Jorn >> >> I was browsing the FT list and see that you got involved with this question from Tyler. I can imagine there being problems with a pipeline like this >> >> preprocessing -> componentanalysis -> timelockanalysis -> dipolefitting >> >> although it should (i.e. "is meant to") work by fitting dipoles to component topographies. But the code is not frequently used like this and it might be possible that there has been regression of the code (i.e bugs in the latest version that were not there before). >> >> With sourceanalysis it depends on the method. Covariance estimates between components does not make much sense in the further inversion, and thereby beamforming won’t work. MNE should in principle work, but not with an estimated data covariance but rather a scaled identity covariance. >> >> Given the uncertain level of support , but clear expectations on what should (and should not) work, I suggest to file it as “bug” (i.e. the issue is that it should be tested) and to write a test script that goes (with e.g. some simulated data) over the various options. >> >> best regards, >> Robert >> >>> On 01 Apr 2014, at 17:16, Jörn M. Horschig wrote: >>> >>> Hi Tyler, >>> >>> any reason why you don't want to go back to sensor-space but stay in component-space with your data? I would assume that the error will be gone if you use the back-projected data (ft_rejectcomponent, with cfg.component = []). >>> >>> Best, >>> Jörn >>> >>>> On 4/1/2014 8:15 AM, Tyler Grummett wrote: >>>> Hey Jorn, >>>> >>>> In addition to my previous emails, Ive been trying to debug the functions. >>>> >>>> In ft_sourceanalysis, line 661 to 677: >>>> >>>> % HACK: use the default code >>>> % select the channels of interest >>>> [dum, datchanindx] = match_str(cfg.channel, data.label); >>>> if strcmp(data.dimord, 'chan_time') >>>> % It is in principle possible to have timelockanalysis with >>>> % keeptrial=yes and only a single trial in the raw data. >>>> % In that case the covariance should be represented as Nchan*Nchan >>>> data.avg = data.avg(datchanindx,:); >>>> %data.cov = reshape(data.cov, length(datchanindx), length(datchanindx)); >>>> data.cov = data.cov(datchanindx,datchanindx); >>>> else >>>> data.avg = data.avg(datchanindx,:); >>>> data.cov = data.cov(:,datchanindx,datchanindx); >>>> data.trial = data.trial(:,datchanindx,:); >>>> end >>>> data.label = data.label(datchanindx); >>>> Nchans = length(data.label); >>>> >>>> I found that my cfg.channel is []; and the data.label is all my ICA components labelled ica_001 etc. >>>> >>>> So it is returned as a []; >>>> which means data.cov = []; >>>> >>>> I think then it will crash later parts of the code. Does this function work on ICA components? >>>> >>>> I ran the ICA in eeglab. >>>> >>>> Tyler. >>>> >>>> ************************* >>>> >>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>> PhD Candidate >>>> Brain Signals Laboratory >>>> Flinders University >>>> Rm 5A301 >>>> Ext 66124 >>>> >>>> ________________________________________ >>>> From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" >>>> Sent: Tuesday, 1 April 2014 1:42 AM >>>> To: fieldtrip at science.ru.nl >>>> Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot >>>> >>>> just to clarify and be precise >>>>> The pos-matrix has to be a regular 3D grid, i.e. be representable as a >>>>> 3x3x3 matrix. >>>> it actually does not have to be as you can also beam individual grid >>>> points, but if you have a .dim field, then is has to be like above. But >>>> that does not affect the rest of the mail I wrote ;) >>>> >>>> >>>>> I am not quite sure how the sourceinterpolate function is handeling >>>>> the fact that you do not have that .dim field. Apparently, it is also >>>>> confused ;) >>>>> >>>>> Do you want to reconstruct only some voxels? From your code it seems >>>>> that you want to cover the whole brain with a 1cm resolution. If the >>>>> latter is the case, maybe restart with creating your forward model by >>>>> following the tutorial that I posted in my previous mail. There are >>>>> some sanity checks that can help you figuring out if you are doing the >>>>> correct thing. If the former one is the case, please explain again >>>>> what exactly you want to achieve and how you are building your forward >>>>> model. >>>>> >>>>> Best, >>>>> Jörn >>>>> >>>>> btw, there's nothing wrong with being a PhD student, it's just a >>>>> matter of experience in practice and theory as in all domains in life ;) >>>>> >>>>> >>>>>> On 3/31/2014 3:15 PM, Tyler Grummett wrote: >>>>>> Hey Jorn, >>>>>> >>>>>> Yes I am definitely confused haha, this stuff is way out of my league >>>>>> as a PhD student. >>>>>> Anyway, I feel we are getting somewhere. >>>>>> >>>>>> timelock = >>>>>> >>>>>> avg: [121x19767 double] >>>>>> var: [121x19767 double] >>>>>> time: [1x19767 double] >>>>>> dof: [121x19767 double] >>>>>> label: {1x121 cell} >>>>>> dimord: 'chan_time' >>>>>> cov: [121x121 double] >>>>>> elec: [1x1 struct] >>>>>> cfg: [1x1 struct] >>>>>> >>>>>> source = >>>>>> >>>>>> time: [1x19767 double] >>>>>> pos: [642x3 double] >>>>>> inside: [642x1 double] >>>>>> outside: [] >>>>>> method: 'average' >>>>>> avg: [1x1 struct] >>>>>> cfg: [1x1 struct] >>>>>> >>>>>> sourceInt = >>>>>> >>>>>> time: [1x19767 double] >>>>>> avg: [1x1 struct] >>>>>> pos: [16777216x3 double] >>>>>> dim: [256 256 256] >>>>>> inside: [1x16777216 double] >>>>>> outside: [1x0 double] >>>>>> coordsys: 'ctf' >>>>>> unit: 'mm' >>>>>> cfg: [1x1 struct] >>>>>> >>>>>> Given what I said last time, I might not comment on the differences. >>>>>> I hope you can see something wrong. >>>>>> >>>>>> One thing I should mention is that the data is continuous, around 30 >>>>>> seconds. Therefore there is only one trial, >>>>>> is that an issue? >>>>>> >>>>>> Tyler >>>>>> >>>>>> ************************* >>>>>> >>>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>>> PhD Candidate >>>>>> Brain Signals Laboratory >>>>>> Flinders University >>>>>> Rm 5A301 >>>>>> Ext 66124 >>>>>> >>>>>> ________________________________________ >>>>>> From: fieldtrip-bounces at science.ru.nl >>>>>> on behalf of "Jörn M. Horschig" >>>>>> >>>>>> Sent: Monday, 31 March 2014 10:24 PM >>>>>> To: FieldTrip discussion list >>>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>>> ft_sourceplot >>>>>> >>>>>> Hi Tyler, >>>>>> >>>>>> there is not much inherently different between time- and >>>>>> freuqency-domain beamformer, at least in terms of computing the forward >>>>>> and the inverse solution. But I see that you are obviously confused, so >>>>>> let me try to help you out and shed some light on what you are actually >>>>>> doing ;) >>>>>> >>>>>> >>>>>>> I had a look at my variables. >>>>>>> >>>>>>> source.avg = >>>>>>> >>>>>>> pow: [642x1 double] >>>>>>> filter: {642x1 cell} >>>>>>> >>>>>>> sourceInt.avg = >>>>>>> >>>>>>> pow: [16777216x1 double] >>>>>>> >>>>>>> So clearly, as both variables are completely different. Something >>>>>>> has gone wrong. >>>>>> No, that is actually how it should be. From below you can see that your >>>>>> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >>>>>> 16777216 elements. In line with source.avg.pow, you should see that your >>>>>> 'grid' consists of 642 elements, so you were computing your source >>>>>> activity on a grid of in total 642 elements. Then you used the original >>>>>> MRI to interpolate from 642 to these 16 million grid points. Actually, >>>>>> since you specific cfg.downsample = 2, it should have been only 8 >>>>>> million points, so that's where things already get a bit weird. >>>>>> >>>>>> So let's go into some sanity checks: >>>>>> 1. are you using the latest version (or a recent, i.e. from this year) >>>>>> of FielTrip? >>>>>> 2. sourceInt should look something like this, does it? >>>>>> >>>>>> source_diff_int = >>>>>> inside: [46x55x46 logical] >>>>>> avg: [1x1 struct] >>>>>> dim: [46 55 46] >>>>>> transform: [4x4 double] >>>>>> anatomy: [46x55x46 double] >>>>>> unit: 'mm' >>>>>> cfg: [1x1 struct] >>>>>> >>>>>> >>>>>> >>>>>> 3. source should look something like this: >>>>>> >>>>>> source = >>>>>> dim: [20 25 22] >>>>>> freq: 54.8287 >>>>>> cumtapcnt: [338x1 double] >>>>>> pos: [11000x3 double] >>>>>> inside: [1x5798 double] >>>>>> outside: [1x5202 double] >>>>>> method: 'average' >>>>>> avg: [1x1 struct] >>>>>> trialinfo: [338x1 double] >>>>>> cfg: [1x1 struct] >>>>>> >>>>>> 4. also check your grid, should be something like this: >>>>>> >>>>>> sourcemodel = >>>>>> >>>>>> pos: [11000x3 double] >>>>>> dim: [20 25 22] >>>>>> unit: 'cm' >>>>>> inside: [1x5798 double] >>>>>> outside: [1x5202 double] >>>>>> params: [1x1 struct] >>>>>> initial: [4x4 double] >>>>>> cfg: [1x1 struct] >>>>>> >>>>>> >>>>>> Of course, it should all look a bit different, because you are using >>>>>> LCMV, but essentially it should be the same. Lastly, you can check other >>>>>> source plotting methods, like 'ortho' or try to plot the source >>>>>> structure rather than the sourceInt structure. In the end, the error >>>>>> must be somewhere in your grid, be it in .pos or .inside, because >>>>>> FieldTrip thinks that there is only one voxel to be plotted. There are >>>>>> other things that may be the issue, but I am not sure about these. So, I >>>>>> would suggest that you play a bit around and see where the error might >>>>>> come from (e.g. follow this tutorial: >>>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >>>>>> steps that you need for LCMV, maybe also check out: >>>>>> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >>>>>> >>>>>> there, LCMV is used, but on one voxel only) >>>>>> >>>>>> Best, >>>>>> Jörn >>>>>> >>>>>>> The next part of my code is the following: >>>>>>> >>>>>>> % interpolate sources >>>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>>> mri = ft_volumereslice([], mri); >>>>>>> >>>>>>> cfg = []; >>>>>>> cfg.downsample = 2; >>>>>>> cfg.parameter = 'avg.pow'; >>>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>>> parameter >>>>>>> % does not vary over time, therefore the time >>>>>>> dimension is not needed. >>>>>>> >>>>>>> mri = >>>>>>> >>>>>>> anatomy: [256x256x256 double] >>>>>>> dim: [256 256 256] >>>>>>> transform: [4x4 double] >>>>>>> coordsys: 'ctf' >>>>>>> unit: 'mm' >>>>>>> cfg: [1x1 struct] >>>>>>> >>>>>>> I cant really see if the data works in the tutorial because it >>>>>>> doesnt appear as though fieldtrip has a tutorial on lcmv >>>>>>> beamformers, they seem to stick to frequency domain beamformers. >>>>>>> >>>>>>> Ive been wrong before though, >>>>>>> >>>>>>> thanks for your help. >>>>>>> >>>>>>> Tyler >>>>>>> >>>>>>> ************************* >>>>>>> >>>>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>>>> PhD Candidate >>>>>>> Brain Signals Laboratory >>>>>>> Flinders University >>>>>>> Rm 5A301 >>>>>>> Ext 66124 >>>>>>> >>>>>>> ________________________________________ >>>>>>> From: fieldtrip-bounces at science.ru.nl >>>>>>> on behalf of "Jörn M. Horschig" >>>>>>> >>>>>>> Sent: Monday, 31 March 2014 7:13 PM >>>>>>> To: FieldTrip discussion list >>>>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>>>> ft_sourceplot >>>>>>> >>>>>>> Hi Tyler, >>>>>>> >>>>>>> hm, okay, it could be that the issue with the leadfield and with the >>>>>>> plot are related, but it could also be that they are separate issues. I >>>>>>> just saw that you posted the same 'problem' on bugzilla and included a >>>>>>> picture. Maybe for next time, include a picture on the mailinglist and >>>>>>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>>>>>> and not if you are not sure. That saves us a lot of time in separating >>>>>>> code issues from user problems ;) >>>>>>> >>>>>>> So, back to you problem. It seems that your reconstruction results in >>>>>>> one voxel only. Are you sure that your grid consistents of more than >>>>>>> just one position? So, for example check the size of the matrices in >>>>>>> source.avg, source- and headmodel, etc. >>>>>>> >>>>>>> Also, you can check in Matlab the respective fields of source and >>>>>>> sourceInt and see whether that makes sense. >>>>>>> >>>>>>> Lastly, a neat way to check is always to use your code on data from the >>>>>>> tutorial, and vice versa, use code from the tutorial on your data and >>>>>>> see whether that works. Both should give sensible results, and if one >>>>>>> does not, you know where to start looking for a solution ;) >>>>>>> >>>>>>> Best, >>>>>>> Jörn >>>>>>> >>>>>>> >>>>>>>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>>>>>> Hey Jorn, >>>>>>>> >>>>>>>> Previously I have let ft_sourceanalysis do a lead field because if >>>>>>>> I use the following code: >>>>>>>> >>>>>>>> % compute lead field ( apparently source analysis computes >>>>>>>> % lead field anyway >>>>>>>> cfg = []; >>>>>>>> cfg.elec = timelock.elec; >>>>>>>> cfg.vol = vol; >>>>>>>> cfg.reducerank = 3; >>>>>>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>>>>>> cm resolution >>>>>>>> cfg.grid.unit = 'cm'; >>>>>>>> cfg.normalize = 'yes'; % if you are not >>>>>>>> contrasting the activity of interest again another condition or >>>>>>>> baseline time-window >>>>>>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>>>>>> I AM UP TO >>>>>>>> >>>>>>>> and then calculate the source analysis: >>>>>>>> >>>>>>>> % Source Analysis: without contrasting condition >>>>>>>> cfg = []; >>>>>>>> cfg.method = 'lcmv'; >>>>>>>> cfg.grid = grid; >>>>>>>> cfg.vol = vol; >>>>>>>> % cfg.grid.pos = maxpos; >>>>>>>> cfg.keepfilter = 'yes'; >>>>>>>> cfg.dics.projectnoise = 'yes'; >>>>>>>> % cfg.dics.lambda = 0; >>>>>>>> source = ft_sourceanalysis( cfg, timelock); >>>>>>>> >>>>>>>> then I get an error than says: >>>>>>>> >>>>>>>> Error using * >>>>>>>> Inner matrix dimensions must agree. >>>>>>>> >>>>>>>> Error in beamformer_lcmv (line 268) >>>>>>>> filt = pinv(lf' * invCy * lf) * lf' * >>>>>>>> invCy; % van Veen eqn. 23, use >>>>>>>> PINV/SVD to cover rank deficient leadfield >>>>>>>> >>>>>>>> Error in ft_sourceanalysis (line 794) >>>>>>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>>>>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>>>>>> optarg{:}); >>>>>>>> >>>>>>>> I just removed the leadfield code and it successfully ran. I could >>>>>>>> also interpolate it later. >>>>>>>> Is this the correct approach. >>>>>>>> >>>>>>>> Thankyou in advance! >>>>>>>> >>>>>>>> Tyler >>>>>>>> >>>>>>>> ************************* >>>>>>>> >>>>>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>>>>> PhD Candidate >>>>>>>> Brain Signals Laboratory >>>>>>>> Flinders University >>>>>>>> Rm 5A301 >>>>>>>> Ext 66124 >>>>>>>> >>>>>>>> ________________________________________ >>>>>>>> From: fieldtrip-bounces at science.ru.nl >>>>>>>> on behalf of "Jörn M. Horschig" >>>>>>>> >>>>>>>> Sent: Monday, 31 March 2014 5:30 PM >>>>>>>> To: FieldTrip discussion list >>>>>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>>>>> ft_sourceplot >>>>>>>> >>>>>>>> Hi Tyler, >>>>>>>> >>>>>>>> what you are describing sounds to me like the center bias of the >>>>>>>> beamformer. Did you contrast the activity with anything, or did you >>>>>>>> normalize your leadfield? >>>>>>>> Check this out: >>>>>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>>>>>> >>>>>>>> >>>>>>>> Best, >>>>>>>> Jörn >>>>>>>> >>>>>>>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>>>>>> I have been trying to plot my interpolated source data using the >>>>>>>>> code: >>>>>>>>> >>>>>>>>> % interpolate sources >>>>>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>>>>> mri = ft_volumereslice([], mri); >>>>>>>>> cfg = []; >>>>>>>>> cfg.downsample = 2; >>>>>>>>> cfg.parameter = 'avg.pow'; >>>>>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>>>>> parameter >>>>>>>>> % does not vary over time, therefore the time >>>>>>>>> dimension >>>>>>>>> is not needed. >>>>>>>>> >>>>>>>>> % Plot interpolated data >>>>>>>>> cfg = []; %#ok >>>>>>>>> cfg.method = 'ortho'; % spline >>>>>>>>> cfg.funparameter = 'avg.pow'; >>>>>>>>> ft_sourceplot( cfg, sourceInt); >>>>>>>>> >>>>>>>>> However the figure that comes up just had orange squares in the >>>>>>>>> subplots. >>>>>>>>> >>>>>>>>> I dont know where Ive gone wrong. >>>>>>>>> >>>>>>>>> >>>>>>>>> Tyler >>>>>>>>> >>>>>>>>> >>>>>>>>> ************************* >>>>>>>>> >>>>>>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>>>>>> /PhD Candidate/ >>>>>>>>> /Brain Signals Laboratory/ >>>>>>>>> /Flinders University/ >>>>>>>>> /Rm 5A301/ >>>>>>>>> /Ext 66124/ >>>>>>>>> >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> fieldtrip mailing list >>>>>>>>> fieldtrip at donders.ru.nl >>>>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>>> -- >>>>>>>> Jörn M. Horschig >>>>>>>> PhD Student >>>>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>>>> Centre for Cognitive Neuroimaging >>>>>>>> Radboud University Nijmegen >>>>>>>> Neuronal Oscillations Group >>>>>>>> FieldTrip Development Team >>>>>>>> >>>>>>>> P.O. Box 9101 >>>>>>>> NL-6500 HB Nijmegen >>>>>>>> The Netherlands >>>>>>>> >>>>>>>> Contact: >>>>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>>>> Tel: +31-(0)24-36-68493 >>>>>>>> Web: http://www.ru.nl/donders >>>>>>>> >>>>>>>> Visiting address: >>>>>>>> Trigon, room 2.30 >>>>>>>> Kapittelweg 29 >>>>>>>> NL-6525 EN Nijmegen >>>>>>>> The Netherlands >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> fieldtrip mailing list >>>>>>>> fieldtrip at donders.ru.nl >>>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>>> _______________________________________________ >>>>>>>> fieldtrip mailing list >>>>>>>> fieldtrip at donders.ru.nl >>>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> -- >>>>>>> Jörn M. Horschig >>>>>>> PhD Student >>>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>>> Centre for Cognitive Neuroimaging >>>>>>> Radboud University Nijmegen >>>>>>> Neuronal Oscillations Group >>>>>>> FieldTrip Development Team >>>>>>> >>>>>>> P.O. Box 9101 >>>>>>> NL-6500 HB Nijmegen >>>>>>> The Netherlands >>>>>>> >>>>>>> Contact: >>>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>>> Tel: +31-(0)24-36-68493 >>>>>>> Web: http://www.ru.nl/donders >>>>>>> >>>>>>> Visiting address: >>>>>>> Trigon, room 2.30 >>>>>>> Kapittelweg 29 >>>>>>> NL-6525 EN Nijmegen >>>>>>> The Netherlands >>>>>>> >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> -- >>>>>> Jörn M. Horschig >>>>>> PhD Student >>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>> Centre for Cognitive Neuroimaging >>>>>> Radboud University Nijmegen >>>>>> Neuronal Oscillations Group >>>>>> FieldTrip Development Team >>>>>> >>>>>> P.O. Box 9101 >>>>>> NL-6500 HB Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> Contact: >>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>> Tel: +31-(0)24-36-68493 >>>>>> Web: http://www.ru.nl/donders >>>>>> >>>>>> Visiting address: >>>>>> Trigon, room 2.30 >>>>>> Kapittelweg 29 >>>>>> NL-6525 EN Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> -- >>>> Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ittan at npsych.med.kyushu-u.ac.jp Wed Apr 2 06:38:02 2014 From: ittan at npsych.med.kyushu-u.ac.jp (=?iso-2022-jp?B?GyRCQ2ZCPDBsQkAbKEI=?=) Date: Wed, 2 Apr 2014 13:38:02 +0900 Subject: [FieldTrip] In BIOSEMI data format, baseline of each data much differ depending on channels Message-ID: <0038B093-BA65-4278-A2D9-936D8142C303@npsych.med.kyushu-u.ac.jp> Hi All, Now I try to read BIOSEMI data (.bdf format, 64ch) by using "ft_preprocessing", but I have one trouble. Baseline of each data much differ depending on channels. So, now I use cfg.demean as below script. cfg.trialdef.prestim = 0.5; % in seconds cfg.trialdef.poststim = 1; % in seconds cfg = ft_definetrial(cfg); cfg.demean='yes'; cfg.baselinewindow = [-0.1 0]; cfg.channel = {'Fp1' 'AF7' 'AF3' 'F1' 'F3' 'F5' 'F7' 'FT9' 'FT7' 'FC5' 'FC3' 'FC1' 'C1' 'C3' 'C5' 'T7' 'TP7'... 'CP5' 'CP3' 'CP1' 'P1' 'P3' 'P5' 'P7' 'P9' 'PO7' 'PO3' 'O1' 'Iz' 'Oz' 'POz' 'Pz' 'Fp2' 'AF8' 'AF4' 'Fz' 'F2'... 'F4' 'F6' 'F8' 'FT10' 'FT8' 'FC6' 'FC4' 'FC2' 'FCz' 'Cz' 'C2' 'C4' 'C6' 'T8' 'TP8' 'CP6' 'CP4' 'CP2' 'CPz' 'P2'... 'P4' 'P6' 'P8' 'P10' 'PO8' 'PO4' 'O2' 'PO9' 'PO10' }; cfd.reref=('yes'); cfg.refchannel=('all'); data = ft_preprocessing(cfg); But, I now focused on DC shift(Slow cortical potential <0.5Hz), so, I can't use cfg.demean and I'm looking for another method to solve this problem. Additionally, is this trouble( Baseline of each data much differ depending on channels.) common with BIOSEMI data format ? or is it due to our recording device? I woud appreciate if someone could advise or comment on how bests to go about this issue. Thanks. Itta Nakamura M.D. Kyushu-University Neuropsychiatry Department, Japan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jan.Hirschmann at med.uni-duesseldorf.de Wed Apr 2 09:42:10 2014 From: Jan.Hirschmann at med.uni-duesseldorf.de (Jan.Hirschmann at med.uni-duesseldorf.de) Date: Wed, 2 Apr 2014 07:42:10 +0000 Subject: [FieldTrip] PLV with DICS beamformer In-Reply-To: <003FC94A-3967-44F3-A0E2-BC813E99C4D8@cin.uni-tuebingen.de> References: <003FC94A-3967-44F3-A0E2-BC813E99C4D8@cin.uni-tuebingen.de> Message-ID: <33DD7D51F083DA488E69A067A5C39FBC8625F610@MAIL1-UKD.VMED.UKD> Hi Natalia, How are you? I didn't know you were fieldtripin', too. I can't really tell if your approach is correct, but I have some comments. First, to me it seems that the imaginary part of csd is not enough to calculate PLV. But then, I don't know the details of how you compute it. Second, the 3 orientations issue is commonly tackled by singular value decomposition rather than by averaging (see e.g. beamformer_dics.m). One can use svd to compute the orientation of maximum power, and I think one could adapt the code, e.g. to get the orientation of maximum phase difference. One straight-forward alternative I know of, is to extract source level time courses using the LCMV beamfomer. You can set cfg.projectmom='yes' to only get the direction of max. power. Then you could use ft_connectivityanalysis with cfg.method='plv' to get the phase locking values. Hope this helps, Jan Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Natalia Zaretskaya Gesendet: Dienstag, 1. April 2014 09:20 An: fieldtrip at science.ru.nl Betreff: [FieldTrip] PLV with DICS beamformer Dear FieldTrip experts, I would like to be able to compute the phase-locking value (Lachaux, 1999) using source data derived from disc beamformer. Right now I perform ft_sourceanalysis with cfg.method = 'dics'; cfg.refdip = [x y z]; cfg.rawtrial = 'yes'; cfg.keepcsd = 'yes'; cfg.grid.filter = source.avg.filter; % precomputed common filter for two conditions and then use the imaginary part of the single-trial cross-spectral densities to compute PLV "by hand". Cross-spectra at each position have a 3x3 format, so I compute the PLV for each dipole orientation pair and then average. I was wondering whether 1) the above procedure is technically correct and 2) whether there is a better, more efficient way to do it (I assume plv can be derived at the same step where source.avg.coh is computed?). Many thanks in advance! Best regards, Natalia Zaretskaya --- Dr. Natalia Zaretskaya Centre for Integrative Neuroscience Vision and Cognition Lab (AG Bartels) 72076 Tübingen, Germany natalia.zaretskaya at cin.uni-tuebingen.de phone: +49 7071 2989032 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ktyler at swin.edu.au Wed Apr 2 09:50:48 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Wed, 2 Apr 2014 07:50:48 +0000 Subject: [FieldTrip] problems with dipole fitting and anatomical alignment Message-ID: Hi All, I am having a great deal of difficulty accurately fitting dipoles. 'Dipoles' are ending up being shown outside the head...... This may be to do with problems in aligning the anatomical data with the sensors. I have used ft_volumerealign to fit the MRI to the neuromag coordinate system, so I am not sure where the problem is arising from. Any help or suggestions, especially from Neuromag users, much appreciated! Here is my code: mri = ft_read_mri('MRI.nii'); %% cfg=[]; cfg.method = 'interactive'; cfg.coordsys = 'neuromag'; mri_real = ft_volumerealign(cfg, mri); % Marked left and right fiducials along with naison %% cfg = []; cfg.coordsys='neuromag'; cfg.output = {'skullstrip' 'brain'}; seg = ft_volumesegment(cfg, mri_real); %% cfg = []; cfg.coordsys='neuromag'; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, seg); %Volume conduction model %% Plotting volume conduction model along with sensor positions. % When these are plotted, the volume conduction model does appear to be positioned too high in the sensors- see jpg vol = ft_convert_units(vol,'cm'); sens = grad;% 'grad' contains neuromag sensor info- taken from MEG data figure ft_plot_sens(sens, 'style', '*b'); hold on ft_plot_vol(vol); %% Fitting dipoles cfg=[]; cfg.numdipoles =1; cfg.latency = [0.05, 0.10]; cfg.vol = vol; %volume conduction model for the subject cfg.model = 'regional'; cfg.grad=grad;% 'grad' contains neuromag sensor info- taken from MEG data source = ft_dipolefitting(cfg, timelocked_data); %% make a plot of the location of the dipoles cfg = []; cfg.location = source.dip.pos* 10; % convert from cm to mm figure; ft_sourceplot(cfg, mri_real); Once again, any help or suggestions, especially from Neuromag users, much appreciated! Kaelasha Tyler -------------- next part -------------- An HTML attachment was scrubbed... URL: From poil.simonshlomo at gmail.com Wed Apr 2 11:44:42 2014 From: poil.simonshlomo at gmail.com (Simon-Shlomo Poil) Date: Wed, 2 Apr 2014 11:44:42 +0200 Subject: [FieldTrip] Import of Brainlab .sig files? Message-ID: Dear all, I have a problem importing .sig files from Brainlab to Matlab (I have .sig and .sts file for each recording). It seems that neither EEGLAB nor Fieldtrip supports import of these files. Does anybody have an idea of how to import these files to Matlab? Best regards, Simon-Shlomo Poil, Dr. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.rotonda at gmail.com Wed Apr 2 12:31:47 2014 From: marco.rotonda at gmail.com (Marco Rotonda) Date: Wed, 2 Apr 2014 12:31:47 +0200 Subject: [FieldTrip] Statistics on ratio frequencies Message-ID: Hi all, I would like to compute a simple alpha-theta ratio and do some statistics on it. I had my data from freqanalysis. Then I averaged with selectdata_new to have the mean for a band. Then the simple ratio for each channel. If now I call freqstatistics I have an error. Any suggestion? Thanks Marco -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Wed Apr 2 12:39:21 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 02 Apr 2014 12:39:21 +0200 Subject: [FieldTrip] Statistics on ratio frequencies In-Reply-To: References: Message-ID: <533BE8D9.6000502@donders.ru.nl> Hi Marco, could you be more specific, in the style of e.g. http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community#how_to_ask_a_questio ? Best, Jörn On 4/2/2014 12:31 PM, Marco Rotonda wrote: > Hi all, > I would like to compute a simple alpha-theta ratio and do some > statistics on it. > I had my data from freqanalysis. > Then I averaged with selectdata_new to have the mean for a band. > Then the simple ratio for each channel. > If now I call freqstatistics I have an error. > Any suggestion? > > Thanks > > Marco > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jan.schoffelen at donders.ru.nl Wed Apr 2 12:42:56 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Wed, 2 Apr 2014 12:42:56 +0200 Subject: [FieldTrip] Statistics on ratio frequencies In-Reply-To: References: Message-ID: <7DC258EF-0DD9-44BD-B0D6-F699575772C2@donders.ru.nl> Not if you don't provide us with some more input. Jan-Mathijs On Apr 2, 2014, at 12:31 PM, Marco Rotonda wrote: > Hi all, > I would like to compute a simple alpha-theta ratio and do some statistics on it. > I had my data from freqanalysis. > Then I averaged with selectdata_new to have the mean for a band. > Then the simple ratio for each channel. > If now I call freqstatistics I have an error. > Any suggestion? > > Thanks > > Marco > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.rotonda at gmail.com Wed Apr 2 12:52:18 2014 From: marco.rotonda at gmail.com (Marco Rotonda) Date: Wed, 2 Apr 2014 12:52:18 +0200 Subject: [FieldTrip] Statistics on ratio frequencies In-Reply-To: <7DC258EF-0DD9-44BD-B0D6-F699575772C2@donders.ru.nl> References: <7DC258EF-0DD9-44BD-B0D6-F699575772C2@donders.ru.nl> Message-ID: Sorry guys I attach the script I used: cfg = []; cfg.method = 'mtmfft'; cfg.taper = 'hanning'; cfg.foi = [4:1:8]; freqmw1theta = ft_freqanalysis(cfg, mw1); freqmw2theta = ft_freqanalysis(cfg, mw2); freqmw3theta = ft_freqanalysis(cfg, mw3); freqmw4theta = ft_freqanalysis(cfg, mw4); freqmw5theta = ft_freqanalysis(cfg, mw5); freqmw6theta = ft_freqanalysis(cfg, mw6); freqmw7theta = ft_freqanalysis(cfg, mw7); freqmwe1theta = ft_freqanalysis(cfg, mwe1); freqmwe2theta = ft_freqanalysis(cfg, mwe2); freqmwe3theta = ft_freqanalysis(cfg, mwe3); freqmwe4theta = ft_freqanalysis(cfg, mwe4); freqmwe5theta = ft_freqanalysis(cfg, mwe5); freqmwe6theta = ft_freqanalysis(cfg, mwe6); freqmwe7theta = ft_freqanalysis(cfg, mwe7); cfg = []; cfg.method = 'mtmfft'; cfg.taper = 'hanning'; cfg.foi = [8:1:12]; freqmw1alpha = ft_freqanalysis(cfg, mw1); freqmw2alpha = ft_freqanalysis(cfg, mw2); freqmw3alpha = ft_freqanalysis(cfg, mw3); freqmw4alpha = ft_freqanalysis(cfg, mw4); freqmw5alpha = ft_freqanalysis(cfg, mw5); freqmw6alpha = ft_freqanalysis(cfg, mw6); freqmw7alpha = ft_freqanalysis(cfg, mw7); freqmwe1alpha = ft_freqanalysis(cfg, mwe1); freqmwe2alpha = ft_freqanalysis(cfg, mwe2); freqmwe3alpha = ft_freqanalysis(cfg, mwe3); freqmwe4alpha = ft_freqanalysis(cfg, mwe4); freqmwe5alpha = ft_freqanalysis(cfg, mwe5); freqmwe6alpha = ft_freqanalysis(cfg, mwe6); freqmwe7alpha = ft_freqanalysis(cfg, mwe7); cfg = [ ]; cfg.parameter = 'powspctrm'; cfg.avgoverfreq = 'yes'; amw1 = ft_selectdata_new(cfg, freqmw1alpha); amw2 = ft_selectdata_new(cfg, freqmw2alpha); amw3 = ft_selectdata_new(cfg, freqmw3alpha); amw4 = ft_selectdata_new(cfg, freqmw4alpha); amw5 = ft_selectdata_new(cfg, freqmw5alpha); amw6 = ft_selectdata_new(cfg, freqmw6alpha); amw7 = ft_selectdata_new(cfg, freqmw7alpha); amwe1 = ft_selectdata_new(cfg, freqmwe1alpha); amwe2 = ft_selectdata_new(cfg, freqmwe2alpha); amwe3 = ft_selectdata_new(cfg, freqmwe3alpha); amwe4 = ft_selectdata_new(cfg, freqmwe4alpha); amwe5 = ft_selectdata_new(cfg, freqmwe5alpha); amwe6 = ft_selectdata_new(cfg, freqmwe6alpha); amwe7 = ft_selectdata_new(cfg, freqmwe7alpha); tmw1 = ft_selectdata_new(cfg, freqmw1theta); tmw2 = ft_selectdata_new(cfg, freqmw2theta); tmw3 = ft_selectdata_new(cfg, freqmw3theta); tmw4 = ft_selectdata_new(cfg, freqmw4theta); tmw5 = ft_selectdata_new(cfg, freqmw5theta); tmw6 = ft_selectdata_new(cfg, freqmw6theta); tmw7 = ft_selectdata_new(cfg, freqmw7theta); tmwe1 = ft_selectdata_new(cfg, freqmwe1theta); tmwe2 = ft_selectdata_new(cfg, freqmwe2theta); tmwe3 = ft_selectdata_new(cfg, freqmwe3theta); tmwe4 = ft_selectdata_new(cfg, freqmwe4theta); tmwe5 = ft_selectdata_new(cfg, freqmwe5theta); tmwe6 = ft_selectdata_new(cfg, freqmwe6theta); tmwe7 = ft_selectdata_new(cfg, freqmwe7theta); atmw1 = amw1; atmw2 = amw2; atmw3 = amw3; atmw4 = amw4; atmw5 = amw5; atmw6 = amw6; atmw7 = amw7; atmwe1 = amwe1; atmwe2 = amwe2; atmwe3 = amwe3; atmwe4 = amwe4; atmwe5 = amwe5; atmwe6 = amwe6; atmwe7 = amwe7; atmw1.powspctrm = amw1.powspctrm./tmw1.powspctrm; atmw2.powspctrm = amw2.powspctrm./tmw2.powspctrm; atmw3.powspctrm = amw3.powspctrm./tmw3.powspctrm; atmw4.powspctrm = amw4.powspctrm./tmw4.powspctrm; atmw5.powspctrm = amw5.powspctrm./tmw5.powspctrm; atmw6.powspctrm = amw6.powspctrm./tmw6.powspctrm; atmw7.powspctrm = amw7.powspctrm./tmw7.powspctrm; atmwe1.powspctrm = amwe1.powspctrm./tmwe1.powspctrm; atmwe2.powspctrm = amwe2.powspctrm./tmwe2.powspctrm; atmwe3.powspctrm = amwe3.powspctrm./tmwe3.powspctrm; atmwe4.powspctrm = amwe4.powspctrm./tmwe4.powspctrm; atmwe5.powspctrm = amwe5.powspctrm./tmwe5.powspctrm; atmwe6.powspctrm = amwe6.powspctrm./tmwe6.powspctrm; atmwe7.powspctrm = amwe7.powspctrm./tmwe7.powspctrm; cfg_neighb = []; cfg_neighb.method = 'distance'; neighbours = ft_prepare_neighbours(cfg_neighb, mwe1); ntrials = 7; cfg = []; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.parameter = 'powspctrm'; cfg.correctm = 'cluster'; cfg.template = 'easycapM11_neighb.mat'; cfg.neighbours = neighbours; cfg.numrandomization = 5000; cfg.avgoverfreq = 'yes'; cfg.alpha = 0.05; cfg.tail = 0; design = [ones(1,ntrials) ones(1,ntrials)*2]; cfg.design = design; cfg.uvar = 1; cfg.ivar = 2; statat = ft_freqstatistics(cfg, atmwe1, atmwe2, atmwe3, atmwe4, atmwe5,... atmwe6, atmwe7, atmw1, atmw2, atmw3, atmw4, atmw5,... atmw6, atmw7); the error I have is: Undefined function or variable "param". Error in seloverdim (line 57) for i = 1:numel(param) Error in ft_selectdata_old (line 601) if selectfoi, data = seloverdim(data, 'freq', selfoi, fb); end Error in ft_selectdata (line 45) [varargout{1:nargout}] = ft_selectdata_old(varargin{:}); Error in ft_freqstatistics (line 245) data = ft_selectdata(data, 'param', cfg.parameter, 'avgoverrpt', false, ... hope is more clear On 2 April 2014 12:42, jan-mathijs schoffelen wrote: > Not if you don't provide us with some more input. > Jan-Mathijs > > On Apr 2, 2014, at 12:31 PM, Marco Rotonda wrote: > > Hi all, > I would like to compute a simple alpha-theta ratio and do some statistics > on it. > I had my data from freqanalysis. > Then I averaged with selectdata_new to have the mean for a band. > Then the simple ratio for each channel. > If now I call freqstatistics I have an error. > Any suggestion? > > Thanks > > Marco > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From meschwe at gmail.com Wed Apr 2 14:49:49 2014 From: meschwe at gmail.com (Meike Schweisfurth) Date: Wed, 2 Apr 2014 14:49:49 +0200 Subject: [FieldTrip] warping from MNI to individual subjects In-Reply-To: <57CBCEA0-7232-44A9-A8B0-05588E4C2310@gmail.com> References: <57CBCEA0-7232-44A9-A8B0-05588E4C2310@gmail.com> Message-ID: Dear Julian! Thanks for your help! I guess it has been only a visualisation problem, it seems to be fine now! Thanks anyway! Meike 2014-04-01 15:12 GMT+02:00 Julian Keil : > Dear Meike, > > I'm not sure if this relates to your problem, but I had - possibly similar > - issues with the warped grid and the template being 90° rotated. > My problem was due to an error during the realignment of the MRI. > Did you check whether the realignment works and whether your different > coordinate systems make sense? > > Could you also maybe attach a picture of your exchanged axes? At least for > me it's hard to image how this looks. > > Best, > > Julian > > > ******************** > *Dr. Julian Keil* > > AG Multisensorische Integration > Psychiatrische Universitätsklinik > der Charité im St. Hedwig-Krankenhaus > Große Hamburger Straße 5-11, Raum E 307 > 10115 Berlin > > Telefon: +49-30-2311-1879 > Fax: +49-30-2311-2209 > > http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration > > Am 01.04.2014 um 14:12 schrieb Meike Schweisfurth: > > Dear Fieldtrippers! > As newbie I have another question, now concerning the warping from MNI to > individual subjects. > Using the below code (the first part almost entirely from > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space), > I get first the template and then apply the grid to the individual > subjects. > However, in later on analysis step it turned out that while the subjects > where nicely similar positioned, the template position is entirely > different, as it is was even axes were exchanged... > Does anybody know what could be the reason and how to change it? > Thanks for any suggestions! > Best, Meike > > > % NOTE: the path to the template file is user-specific > template = > ft_read_mri('fieldtrip/fieldtrip-20140316/external/spm8/templates/T1.nii'); > template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the > coordinate system > > % segment the template brain and construct a volume conduction model (i.e. > head model): this is needed > % for the inside/outside detection of voxels. > cfg = []; > template_seg = ft_volumesegment(cfg, template); > > cfg = []; > cfg.method = 'singleshell'; > template_vol = ft_prepare_headmodel(cfg, template_seg); > template_vol = ft_convert_units(template_vol, 'cm'); % Convert the vol to > cm, since the grid will also be expressed in cm > > % construct the dipole grid in the template brain coordinates > % the source units are in cm > % the negative inwardshift means an outward shift of the brain surface for > inside/outside detection > cfg = []; > cfg.grid.xgrid = -20:1:20; > cfg.grid.ygrid = -20:1:20; > cfg.grid.zgrid = -20:1:20; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > cfg.inwardshift = -1.5; > cfg.vol = template_vol; > template_grid = ft_prepare_sourcemodel(cfg); > save('../analysis/MEG/source_analysis/MNI','template_grid','template_vol','template_seg','template') > > % make a figure with the template head model and dipole grid > figure > hold on > ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', > 'none');alpha 0.5; camlight; > ft_plot_mesh(template_grid.pos(template_grid.inside,:)); > else > load('../analysis/MEG/source_analysis/MNI','template_grid','template_vol','template_seg','template') > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > SUBJECTS={ 'VP02' 'VP03' 'VP04' 'VP05' 'VP06' > 'VP07' 'VP08' 'VP09' 'VP11' 'VP12' 'VP13' 'VP14' > 'VP15' 'VP16' 'VP17' 'VP18'} > > for SUBJI=SUBJECTS > SUBJ=SUBJI{1}; > % read the single subject anatomical MRI > load(['..*/analysis/MEG/source_analysis/*',SUBJ,'/mri']); %Has been > processed to CFT coordinates before > load(['..*/analysis/MEG/source_analysis/*',SUBJ,'/segmentedmri']); > > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > % create the subject specific grid, using the template grid that has just > been created > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template_grid; > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > cfg.mri = mri_ra; > grid = ft_prepare_sourcemodel(cfg); > > % make a figure of the single subject headmodel, and grid positions > figure; > ft_plot_vol(vol, 'edgecolor', 'none'); alpha 0.4; %camlight > ft_plot_mesh(grid.pos(grid.inside,:)); > > save(['..*/analysis/MEG/source_analysis/*',SUBJ,'/MNIgrid'],'grid','vol') > end > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nkrishna at mprc.umaryland.edu Wed Apr 2 16:23:01 2014 From: nkrishna at mprc.umaryland.edu (Nithin Krishna) Date: Wed, 2 Apr 2014 10:23:01 -0400 Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data References: <533BE8D9.6000502@donders.ru.nl> Message-ID: <20140402T102301Z_155300170001@mprc.umaryland.edu> Dear All, I read the tutorial section on Cluster-based permutation tests on time-frequency data as well as the Maris and Oostenveld, Journal of Neuroscience Methods, 2007 report. I am interested in setting up a ERP experiment on EEG data in this regard I like the procedure and processing section of the tutorial, however I would like to know if there is any section for EEG, I understand that megplanar is specific for MEG. Also is it possible to use 3D matrix (TFR) (time, Freq channels ) non feild trip output to run the cluster based permutation tests. Looking forward Nithin >>> "Jörn M. Horschig" 4/2/2014 6:39 AM >>> Hi Marco, could you be more specific, in the style of e.g. http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community#how_to_ask_a_questio ? Best, Jörn On 4/2/2014 12:31 PM, Marco Rotonda wrote: > Hi all, > I would like to compute a simple alpha-theta ratio and do some > statistics on it. > I had my data from freqanalysis. > Then I averaged with selectdata_new to have the mean for a band. > Then the simple ratio for each channel. > If now I call freqstatistics I have an error. > Any suggestion? > > Thanks > > Marco > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Wed Apr 2 16:39:14 2014 From: n.lam at fcdonders.ru.nl (Lam, Nietzsche) Date: Wed, 2 Apr 2014 16:39:14 +0200 (CEST) Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data In-Reply-To: <20140402T102301Z_155300170001@mprc.umaryland.edu> Message-ID: <463655257.1716412.1396449554295.JavaMail.root@indus.zimbra.ru.nl> Dear Nithin, FieldTrip was primarily set up for MEG data but we definitely have several tutorials discussing similar procedures for EEG data. Perhaps these tutorials can help you out. http://fieldtrip.fcdonders.nl/tutorial/eeg_preprocessing_erp http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock http://fieldtrip.fcdonders.nl/tutorial/eventrelatedstatistics Although these later two links are performed on MEG data, I think they are useful to you because functions used to calculate ERFs are also used for ERPs. For example, in FieldTrip you can use ft_timelockanalysis and ft_timelockstatistics for both EEG and MEG data. Regarding the use of non-FieldTrip data for cluster-permutations. Theoretically, I think it is possible, but probably more experienced users can answer this. Nevertheless, you could look into this FAQ about how to import your data so that it ca be used by FieldTrip here: http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat?s[]=import&s[]=data best, Nietzsche ----- Original Message ----- > From: "Nithin Krishna" > To: "FieldTrip discussion list" > Sent: Wednesday, 2 April, 2014 4:23:01 PM > Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data > Dear All, > I read the tutorial section on Cluster-based permutation tests on > time-frequency data as well as the Maris and Oostenveld, Journal of > Neuroscience Methods, 2007 report. I am interested in setting up a ERP > experiment on EEG data in this regard I like the procedure and > processing section of the tutorial, however I would like to know if > there is any section for EEG, I understand that megplanar is specific > for MEG. > Also is it possible to use 3D matrix (TFR) (time, Freq channels ) non > feild trip output to run the cluster based permutation tests. > Looking forward > Nithin > > > >>> "Jörn M. Horschig" 4/2/2014 6:39 AM >>> > > Hi Marco, > > could you be more specific, in the style of e.g. > http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community#how_to_ask_a_questio > ? > > Best, > Jörn > > On 4/2/2014 12:31 PM, Marco Rotonda wrote: > > Hi all, > > I would like to compute a simple alpha-theta ratio and do some > > statistics on it. > > I had my data from freqanalysis. > > Then I averaged with selectdata_new to have the mean for a band. > > Then the simple ratio for each channel. > > If now I call freqstatistics I have an error. > > Any suggestion? > > > > Thanks > > > > Marco > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com From nkrishna at mprc.umaryland.edu Wed Apr 2 16:43:45 2014 From: nkrishna at mprc.umaryland.edu (Nithin Krishna) Date: Wed, 2 Apr 2014 10:43:45 -0400 Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data References: <20140402T102301Z_155300170001@mprc.umaryland.edu> <463655257.1716412.1396449554295.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <20140402T104345Z_155300170001@mprc.umaryland.edu> Thanks a lot Nietzsche, will explore the tutorials. Nithin >>> "Lam, Nietzsche" 4/2/2014 10:39 AM >>> Dear Nithin, FieldTrip was primarily set up for MEG data but we definitely have several tutorials discussing similar procedures for EEG data. Perhaps these tutorials can help you out. http://fieldtrip.fcdonders.nl/tutorial/eeg_preprocessing_erp http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock http://fieldtrip.fcdonders.nl/tutorial/eventrelatedstatistics Although these later two links are performed on MEG data, I think they are useful to you because functions used to calculate ERFs are also used for ERPs. For example, in FieldTrip you can use ft_timelockanalysis and ft_timelockstatistics for both EEG and MEG data. Regarding the use of non-FieldTrip data for cluster-permutations. Theoretically, I think it is possible, but probably more experienced users can answer this. Nevertheless, you could look into this FAQ about how to import your data so that it ca be used by FieldTrip here: http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat?s[]=import&s[]=data best, Nietzsche ----- Original Message ----- > From: "Nithin Krishna" > To: "FieldTrip discussion list" > Sent: Wednesday, 2 April, 2014 4:23:01 PM > Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data > Dear All, > I read the tutorial section on Cluster-based permutation tests on > time-frequency data as well as the Maris and Oostenveld, Journal of > Neuroscience Methods, 2007 report. I am interested in setting up a ERP > experiment on EEG data in this regard I like the procedure and > processing section of the tutorial, however I would like to know if > there is any section for EEG, I understand that megplanar is specific > for MEG. > Also is it possible to use 3D matrix (TFR) (time, Freq channels ) non > feild trip output to run the cluster based permutation tests. > Looking forward > Nithin > > > >>> "Jörn M. Horschig" 4/2/2014 6:39 AM >>> > > Hi Marco, > > could you be more specific, in the style of e.g. > http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community#how_to_ask_a_questio > ? > > Best, > Jörn > > On 4/2/2014 12:31 PM, Marco Rotonda wrote: > > Hi all, > > I would like to compute a simple alpha-theta ratio and do some > > statistics on it. > > I had my data from freqanalysis. > > Then I averaged with selectdata_new to have the mean for a band. > > Then the simple ratio for each channel. > > If now I call freqstatistics I have an error. > > Any suggestion? > > > > Thanks > > > > Marco > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at fcdonders.ru.nl Wed Apr 2 17:10:52 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Wed, 2 Apr 2014 17:10:52 +0200 (CEST) Subject: [FieldTrip] Fieldtrip ICA crashes Matlab In-Reply-To: References: Message-ID: <005101cf4e85$bd08ef50$371acdf0$@herring@fcdonders.ru.nl> Hi Hweeling, Could you please copy and paste the exact error message Matlab is producing? Also, which version (e.g. 2013a) of Matlab are you using? Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Hwee Ling Lee Sent: maandag 31 maart 2014 17:25 To: Stephen Politzer-Ahles; FieldTrip discussion list Subject: Re: [FieldTrip] Fieldtrip ICA crashes Matlab Hi, Thanks for your reply. I'm running Matlab with 64 bit. I've got 32GB of RAM installed. In the previous month, I was able to run ICA and plot its components without any error message from Matlab. Recently, I keep experiencing the error message, and Matlab crashes completely. I have no clue what could have gone wrong. Cheers, Hweeling On 31 March 2014 17:08, Stephen Politzer-Ahles wrote: Hello Hweeling, What kind of error do you get in MATLAB when you try to do ICA, is it an "Out of memory" error? I'm asking because this is a fairly common issue in MATLAB on Windows systems (I don't know the details of your data, but I've experienced this issue on 32-channel, 1000-Hz epoched EEG data if the epochs are long enough and numerous enough). For me the only solutions (other than shortening the epochs or downsampling the data, which might not be good options depending on your research question) were to use a Unix-based operating system (like Mac OS) or to upgrade my Windows (I had errors like this when using a 32-bit version of Windows with 2 GB of RAM, but not so much after I upgraded to 64-bit and 8 GB of RAM). I'm not sure if this is the issue you're having, though. Best, Steve Stephen Politzer-Ahles New York University, Abu Dhabi Neuroscience of Language Lab http://www.nyu.edu/projects/politzer-ahles/ On Mon, Mar 31, 2014 at 7:02 PM, wrote: Send fieldtrip mailing list submissions to fieldtrip at science.ru.nl To subscribe or unsubscribe via the World Wide Web, visit http://mailman.science.ru.nl/mailman/listinfo/fieldtrip or, via email, send a message with subject or body 'help' to fieldtrip-request at science.ru.nl You can reach the person managing the list at fieldtrip-owner at science.ru.nl When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..." Today's Topics: 1. Fieldtrip ICA crashes Matlab (Hwee Ling Lee) 2. Re: plotting interpolated sources with ft_sourceplot (J?rn M. Horschig) 3. Re: help about ' fieldtrip2fiff ' (Gio Piantoni) ---------------------------------------------------------------------- Message: 1 Date: Mon, 31 Mar 2014 16:48:34 +0200 From: Hwee Ling Lee To: FieldTrip discussion list Subject: [FieldTrip] Fieldtrip ICA crashes Matlab Message-ID: Content-Type: text/plain; charset="iso-8859-1" Dear all, I'm encountering a problem with running ICA in Matlab. After ICA, when I tried to plot the components, Matlab keeps prompting an internal problem and needs to be closed. I wonder why this is the case. Could someone please tell me what went wrong? Here's part of my script for ICA: cfg = []; % if data were cleaned, then use this if sub == 5 %|| sub == 7 cfg.channel = {'all', '-AFz', '-FT7'}; elseif sub == 7 cfg.channel = {'all' '-AFz'}; else cfg.channel = {'all'}; end % cfg.runica.pca = 121; % using the rank of my data % ic_data = ft_componentanalysis(cfg,cleandata); % if data were cleaned then use this ic_data = ft_componentanalysis(cfg, cleandata); % after ICA, look for components that we want to substract from our data, % only looking at ten channels (components) at a time cfg = []; cfg.dataset = rawdatafile; cfg.viewmode = 'component'; cfg.continuous = 'no'; cfg.blocksize = 8; cfg.channels = 'all'; cfg.layout = 'EEG1020.lay'; ft_databrowser(cfg,ic_data); The internal problem appears even when I downsampled my data from 5000 Hz to 1000 Hz. The internal problem appears also when I have short segments of my data (i.e. 2s per trial), and long segments of my data (i.e. 6s per trial). The memory of my PC workstation is: Maximum possible array: 60253 MB (6.318e+10 bytes) * Memory available for all arrays: 60253 MB (6.318e+10 bytes) * Memory used by MATLAB: 560 MB (5.872e+08 bytes) Physical Memory (RAM): 32685 MB (3.427e+10 bytes) Interestingly, this internal problem does not occur when I ran my script on my Macbook Pro. I'm feeling very lost here. Any help is highly appreciated. Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: -- ================================================= Dr. rer. nat. Lee, Hwee Ling Postdoc German Center for Neurodegenerative Diseases (DZNE) Bonn Email 1: hwee-ling.leedzne.de Email 2: hweeling.leegmail.com https://sites.google.com/site/hweelinglee/home Correspondence Address: Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany ================================================= -------------- next part -------------- An HTML attachment was scrubbed... URL: From joramvandriel at gmail.com Wed Apr 2 17:25:29 2014 From: joramvandriel at gmail.com (Joram van Driel) Date: Wed, 2 Apr 2014 17:25:29 +0200 Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data In-Reply-To: <463655257.1716412.1396449554295.JavaMail.root@indus.zimbra.ru.nl> References: <20140402T102301Z_155300170001@mprc.umaryland.edu> <463655257.1716412.1396449554295.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Dear Nithin, I use Fieldtrip's permutation testing routines quite often on non-fieldtrip analyzed data. It is quite straightforward as long as you have your channel/neighbour layout the way Fieldtrip needs it. Try playing around with the ft_read_sens(*[EEG file with readable channel locations]*), or simply choose a layout file from the folder /template/layout/ inside your fieldtrip folder; from this you need to use ft_prepare_neighbours; or more simple, choose a predefined neighbour structure from /template/neighbours. This covers quite a lot of systems; of course yours may not be in there; then I think ft_read_sens is your only option. I use EEGLAB for example, and I could import a .set file with a field EEG.chanlocs using ft_read_sens. Then, I do the following for time-frequency data (but in principle this should be very similar for time-domain ERP data): - I first configure the cfg as described in the cluster permutation testing tutorial - Then I manually put my own analyzed data into a "freqs" structure; name is of course arbitrary, but should have the same fields as the output from ft_freqanalysis: freq1.freq = [the values of the different frequencies]; freq1.time = [the different time points]; freq1.dimord = 'subj_chan_freq_time'; freq1.grad = [the result from ft_read_sense]; freq1.label = [the labels from the result of ft_read_sense]; freq1.powspctrm = [the result of your own custom/EEGLAB/whatever non-fieldtrip analysis, provided this has the dimensions of freqs.dimord]; Then I do this for example for two different conditions, make my design matrix in cfg.design, and put it into ft_freqstatistics(cfg,freq1,freq2) Hope this helps. - Joram On Wed, Apr 2, 2014 at 4:39 PM, Lam, Nietzsche wrote: > Dear Nithin, > > FieldTrip was primarily set up for MEG data but we definitely have several > tutorials discussing similar procedures for EEG data. Perhaps these > tutorials can help you out. > > http://fieldtrip.fcdonders.nl/tutorial/eeg_preprocessing_erp > > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock > http://fieldtrip.fcdonders.nl/tutorial/eventrelatedstatistics > Although these later two links are performed on MEG data, I think they are > useful to you because functions used to calculate ERFs are also used for > ERPs. For example, in FieldTrip you can use ft_timelockanalysis and > ft_timelockstatistics for both EEG and MEG data. > > Regarding the use of non-FieldTrip data for cluster-permutations. > Theoretically, I think it is possible, but probably more experienced users > can answer this. Nevertheless, you could look into this FAQ about how to > import your data so that it ca be used by FieldTrip here: > > http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat?s[]=import&s[]=data > > best, > Nietzsche > > > > ----- Original Message ----- > > From: "Nithin Krishna" > > To: "FieldTrip discussion list" > > Sent: Wednesday, 2 April, 2014 4:23:01 PM > > Subject: [FieldTrip] Question on Cluster-based permutation tests on > time-frequency data > > Dear All, > > I read the tutorial section on Cluster-based permutation tests on > > time-frequency data as well as the Maris and Oostenveld, Journal of > > Neuroscience Methods, 2007 report. I am interested in setting up a ERP > > experiment on EEG data in this regard I like the procedure and > > processing section of the tutorial, however I would like to know if > > there is any section for EEG, I understand that megplanar is specific > > for MEG. > > Also is it possible to use 3D matrix (TFR) (time, Freq channels ) non > > feild trip output to run the cluster based permutation tests. > > Looking forward > > Nithin > > > > > > >>> "Jörn M. Horschig" 4/2/2014 6:39 AM >>> > > > > Hi Marco, > > > > could you be more specific, in the style of e.g. > > > http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community#how_to_ask_a_questio > > ? > > > > Best, > > Jörn > > > > On 4/2/2014 12:31 PM, Marco Rotonda wrote: > > > Hi all, > > > I would like to compute a simple alpha-theta ratio and do some > > > statistics on it. > > > I had my data from freqanalysis. > > > Then I averaged with selectdata_new to have the mean for a band. > > > Then the simple ratio for each channel. > > > If now I call freqstatistics I have an error. > > > Any suggestion? > > > > > > Thanks > > > > > > Marco > > > > > > > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > -- > > Jörn M. Horschig > > PhD Student > > Donders Institute for Brain, Cognition and Behaviour > > Centre for Cognitive Neuroimaging > > Radboud University Nijmegen > > Neuronal Oscillations Group > > FieldTrip Development Team > > > > P.O. Box 9101 > > NL-6500 HB Nijmegen > > The Netherlands > > > > Contact: > > E-Mail: jm.horschig at donders.ru.nl > > Tel: +31-(0)24-36-68493 > > Web: http://www.ru.nl/donders > > > > Visiting address: > > Trigon, room 2.30 > > Kapittelweg 29 > > NL-6525 EN Nijmegen > > The Netherlands > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Nietzsche H.L. Lam, MSc > PhD Candidate > > Max Planck Institute for Psycholinguistics > Wundtlaan 1, 6525 XD Nijmegen, The Netherlands > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Kapittelweg 29, 6525EN Nijmegen, The Netherlands > > n.lam at fcdonders.ru.nl > +31-24-3668219 > > > neurobiologyoflanguage.com > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Joram van Driel, MSc. PhD student @ University of Amsterdam Brain & Cognition @ Department of Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: From nkrishna at mprc.umaryland.edu Wed Apr 2 18:28:08 2014 From: nkrishna at mprc.umaryland.edu (Nithin Krishna) Date: Wed, 2 Apr 2014 12:28:08 -0400 Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data References: <20140402T102301Z_155300170001@mprc.umaryland.edu> <463655257.1716412.1396449554295.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <20140402T122808Z_155300170001@mprc.umaryland.edu> Thanks a lot Joram, Actually this helps a lot and the layout does have my system. Cheers Nithin >>> Joram van Driel 4/2/2014 11:25 AM >>> Dear Nithin, I use Fieldtrip's permutation testing routines quite often on non-fieldtrip analyzed data. It is quite straightforward as long as you have your channel/neighbour layout the way Fieldtrip needs it. Try playing around with the ft_read_sens([EEG file with readable channel locations]), or simply choose a layout file from the folder /template/layout/ inside your fieldtrip folder; from this you need to use ft_prepare_neighbours; or more simple, choose a predefined neighbour structure from /template/neighbours. This covers quite a lot of systems; of course yours may not be in there; then I think ft_read_sens is your only option. I use EEGLAB for example, and I could import a .set file with a field EEG.chanlocs using ft_read_sens. Then, I do the following for time-frequency data (but in principle this should be very similar for time-domain ERP data): - I first configure the cfg as described in the cluster permutation testing tutorial - Then I manually put my own analyzed data into a "freqs" structure; name is of course arbitrary, but should have the same fields as the output from ft_freqanalysis: freq1.freq = [the values of the different frequencies]; freq1.time = [the different time points]; freq1.dimord = 'subj_chan_freq_time'; freq1.grad = [the result from ft_read_sense]; freq1.label = [the labels from the result of ft_read_sense]; freq1.powspctrm = [the result of your own custom/EEGLAB/whatever non-fieldtrip analysis, provided this has the dimensions of freqs.dimord]; Then I do this for example for two different conditions, make my design matrix in cfg.design, and put it into ft_freqstatistics(cfg,freq1,freq2) Hope this helps. - Joram On Wed, Apr 2, 2014 at 4:39 PM, Lam, Nietzsche wrote: Dear Nithin, FieldTrip was primarily set up for MEG data but we definitely have several tutorials discussing similar procedures for EEG data. Perhaps these tutorials can help you out. http://fieldtrip.fcdonders.nl/tutorial/eeg_preprocessing_erp http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock http://fieldtrip.fcdonders.nl/tutorial/eventrelatedstatistics Although these later two links are performed on MEG data, I think they are useful to you because functions used to calculate ERFs are also used for ERPs. For example, in FieldTrip you can use ft_timelockanalysis and ft_timelockstatistics for both EEG and MEG data. Regarding the use of non-FieldTrip data for cluster-permutations. Theoretically, I think it is possible, but probably more experienced users can answer this. Nevertheless, you could look into this FAQ about how to import your data so that it ca be used by FieldTrip here: http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat?s[]=import&s[]=data best, Nietzsche ----- Original Message ----- > From: "Nithin Krishna" > To: "FieldTrip discussion list" > Sent: Wednesday, 2 April, 2014 4:23:01 PM > Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data > Dear All, > I read the tutorial section on Cluster-based permutation tests on > time-frequency data as well as the Maris and Oostenveld, Journal of > Neuroscience Methods, 2007 report. I am interested in setting up a ERP > experiment on EEG data in this regard I like the procedure and > processing section of the tutorial, however I would like to know if > there is any section for EEG, I understand that megplanar is specific > for MEG. > Also is it possible to use 3D matrix (TFR) (time, Freq channels ) non > feild trip output to run the cluster based permutation tests. > Looking forward > Nithin > > > >>> "Jörn M. Horschig" 4/2/2014 6:39 AM >>> > > Hi Marco, > > could you be more specific, in the style of e.g. > http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community#how_to_ask_a_questio > ? > > Best, > Jörn > > On 4/2/2014 12:31 PM, Marco Rotonda wrote: > > Hi all, > > I would like to compute a simple alpha-theta ratio and do some > > statistics on it. > > I had my data from freqanalysis. > > Then I averaged with selectdata_new to have the mean for a band. > > Then the simple ratio for each channel. > > If now I call freqstatistics I have an error. > > Any suggestion? > > > > Thanks > > > > Marco > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Joram van Driel, MSc. PhD student @ University of Amsterdam Brain & Cognition @ Department of Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Wed Apr 2 20:47:13 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Wed, 2 Apr 2014 20:47:13 +0200 Subject: [FieldTrip] Fieldtrip ICA crashes Matlab In-Reply-To: <533c287d.43040e0a.3506.3700SMTPIN_ADDED_BROKEN@mx.google.com> References: <533c287d.43040e0a.3506.3700SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: Dear Jim, I figured that the error occurs when I tried to plot the ICA components using ft_databrowser, with viewmode as "component". For the PC, I'm running a 64 bit Windows 7, 32 GB of RAM, and 1000 MB of graphics memory (NIVDIA Quadro 600). I've also tried the command on another PC running 64 bit Windows 7, Matlab R2012b, 64 GB of RAM and 457 MB of graphics memory. Both PCs produced the same internal error that crashes Matlab. I was not able to copy the message, as it was a pop out window that informs me of the fatal error, and I would have to end the program. The funny thing was that I was able to plot the ICA components a month ago, but not able to. This error occurred once to me as well. I've also updated my fieldtrip toolbox to the version on 30 March 2014. For the Macbook Pro, I did not get this error when I plotted the ICA components using the same data and the same commands. I suspect that it may be a problem with my graphics memory, however, the error seems strange to me as it occurs on some times, and the error "disappears" on some other times. I'm contemplating of converting one of my PC to a linux workstation. Do you think this will resolve my problems? Thanks for your help. I'm totally lost here. Best regards, Hweeling On 2 April 2014 17:10, Herring, J.D. (Jim) wrote: > Hi Hweeling, > > > > Could you please copy and paste the exact error message Matlab is > producing? Also, which version (e.g. 2013a) of Matlab are you using? > > > > Best, > > > > Jim > > > > > > > > *From:* fieldtrip-bounces at science.ru.nl [mailto: > fieldtrip-bounces at science.ru.nl] *On Behalf Of *Hwee Ling Lee > *Sent:* maandag 31 maart 2014 17:25 > *To:* Stephen Politzer-Ahles; FieldTrip discussion list > *Subject:* Re: [FieldTrip] Fieldtrip ICA crashes Matlab > > > > Hi, > > > > Thanks for your reply. I'm running Matlab with 64 bit. I've got 32GB of > RAM installed. In the previous month, I was able to run ICA and plot its > components without any error message from Matlab. Recently, I keep > experiencing the error message, and Matlab crashes completely. I have no > clue what could have gone wrong. > > > > Cheers, > > Hweeling > > > > On 31 March 2014 17:08, Stephen Politzer-Ahles > wrote: > > Hello Hweeling, > > > > What kind of error do you get in MATLAB when you try to do ICA, is it an > "Out of memory" error? I'm asking because this is a fairly common issue in > MATLAB on Windows systems (I don't know the details of your data, but I've > experienced this issue on 32-channel, 1000-Hz epoched EEG data if the > epochs are long enough and numerous enough). For me the only solutions > (other than shortening the epochs or downsampling the data, which might not > be good options depending on your research question) were to use a > Unix-based operating system (like Mac OS) or to upgrade my Windows (I had > errors like this when using a 32-bit version of Windows with 2 GB of RAM, > but not so much after I upgraded to 64-bit and 8 GB of RAM). I'm not sure > if this is the issue you're having, though. > > > > Best, > > Steve > > > > > > > Stephen Politzer-Ahles > New York University, Abu Dhabi > Neuroscience of Language Lab > http://www.nyu.edu/projects/politzer-ahles/ > > > > On Mon, Mar 31, 2014 at 7:02 PM, wrote: > > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Fieldtrip ICA crashes Matlab (Hwee Ling Lee) > 2. Re: plotting interpolated sources with ft_sourceplot > (J?rn M. Horschig) > 3. Re: help about ' fieldtrip2fiff ' (Gio Piantoni) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 31 Mar 2014 16:48:34 +0200 > From: Hwee Ling Lee > To: FieldTrip discussion list > Subject: [FieldTrip] Fieldtrip ICA crashes Matlab > Message-ID: > poVtb-1ApZuDQ at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Dear all, > > I'm encountering a problem with running ICA in Matlab. After ICA, when I > tried to plot the components, Matlab keeps prompting an internal problem > and needs to be closed. I wonder why this is the case. Could someone please > tell me what went wrong? > > Here's part of my script for ICA: > > cfg = []; % if data were cleaned, then use this > > if sub == 5 %|| sub == 7 > cfg.channel = {'all', '-AFz', '-FT7'}; > elseif sub == 7 > cfg.channel = {'all' '-AFz'}; > else > cfg.channel = {'all'}; > end > > % cfg.runica.pca = 121; % using the rank of my data > % ic_data = ft_componentanalysis(cfg,cleandata); % if data were > cleaned then use this > ic_data = ft_componentanalysis(cfg, cleandata); > > % after ICA, look for components that we want to substract from our > data, > % only looking at ten channels (components) at a time > cfg = []; > cfg.dataset = rawdatafile; > cfg.viewmode = 'component'; > cfg.continuous = 'no'; > cfg.blocksize = 8; > cfg.channels = 'all'; > cfg.layout = 'EEG1020.lay'; > ft_databrowser(cfg,ic_data); > > > The internal problem appears even when I downsampled my data from 5000 Hz > to 1000 Hz. > > The internal problem appears also when I have short segments of my data > (i.e. 2s per trial), and long segments of my data (i.e. 6s per trial). > > The memory of my PC workstation is: > Maximum possible array: 60253 MB (6.318e+10 bytes) * > Memory available for all arrays: 60253 MB (6.318e+10 bytes) * > Memory used by MATLAB: 560 MB (5.872e+08 bytes) > Physical Memory (RAM): 32685 MB (3.427e+10 bytes) > > Interestingly, this internal problem does not occur when I ran my script on > my Macbook Pro. > > I'm feeling very lost here. Any help is highly appreciated. > > Cheers, > Hweeling > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/f756367f/attachment-0001.html > > > > > > > > -- > > ================================================= > Dr. rer. nat. Lee, Hwee Ling > Postdoc > German Center for Neurodegenerative Diseases (DZNE) Bonn > > Email 1: hwee-ling.leedzne.de > Email 2: hweeling.leegmail.com > > > > https://sites.google.com/site/hweelinglee/home > > Correspondence Address: > Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany > ================================================= > -- ================================================= Dr. rer. nat. Lee, Hwee Ling Postdoc German Center for Neurodegenerative Diseases (DZNE) Bonn Email 1: hwee-ling.leedzne.de Email 2: hweeling.leegmail.com https://sites.google.com/site/hweelinglee/home Correspondence Address: Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany ================================================= -------------- next part -------------- An HTML attachment was scrubbed... URL: From elmeri.syrjanen at gmail.com Wed Apr 2 22:17:51 2014 From: elmeri.syrjanen at gmail.com (=?ISO-8859-1?Q?Elmeri_Syrj=E4nen?=) Date: Wed, 2 Apr 2014 22:17:51 +0200 Subject: [FieldTrip] Fieldtrip ICA crashes Matlab In-Reply-To: References: <533c287d.43040e0a.3506.3700SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: Dear Whee Ling, this is an old bug that has been in FieldTrip since October last year. You can see the bug report here: http://bugzilla.fcdonders.nl/show_bug.cgi?id=2316 Safest way to avoid it is to use a mac computer or revert to a FieldTrip version from September last year. /elmeri On Wed, Apr 2, 2014 at 8:47 PM, Hwee Ling Lee wrote: > Dear Jim, > > I figured that the error occurs when I tried to plot the ICA components > using ft_databrowser, with viewmode as "component". > > For the PC, I'm running a 64 bit Windows 7, 32 GB of RAM, and 1000 MB of > graphics memory (NIVDIA Quadro 600). I've also tried the command on another > PC running 64 bit Windows 7, Matlab R2012b, 64 GB of RAM and 457 MB of > graphics memory. Both PCs produced the same internal error that crashes > Matlab. I was not able to copy the message, as it was a pop out window that > informs me of the fatal error, and I would have to end the program. > > The funny thing was that I was able to plot the ICA components a month > ago, but not able to. This error occurred once to me as well. I've also > updated my fieldtrip toolbox to the version on 30 March 2014. > > For the Macbook Pro, I did not get this error when I plotted the ICA > components using the same data and the same commands. > > I suspect that it may be a problem with my graphics memory, however, the > error seems strange to me as it occurs on some times, and the error > "disappears" on some other times. > > I'm contemplating of converting one of my PC to a linux workstation. Do > you think this will resolve my problems? > > Thanks for your help. I'm totally lost here. > > Best regards, > Hweeling > > > > > On 2 April 2014 17:10, Herring, J.D. (Jim) wrote: > >> Hi Hweeling, >> >> >> >> Could you please copy and paste the exact error message Matlab is >> producing? Also, which version (e.g. 2013a) of Matlab are you using? >> >> >> >> Best, >> >> >> >> Jim >> >> >> >> >> >> >> >> *From:* fieldtrip-bounces at science.ru.nl [mailto: >> fieldtrip-bounces at science.ru.nl] *On Behalf Of *Hwee Ling Lee >> >> *Sent:* maandag 31 maart 2014 17:25 >> *To:* Stephen Politzer-Ahles; FieldTrip discussion list >> *Subject:* Re: [FieldTrip] Fieldtrip ICA crashes Matlab >> >> >> >> Hi, >> >> >> >> Thanks for your reply. I'm running Matlab with 64 bit. I've got 32GB of >> RAM installed. In the previous month, I was able to run ICA and plot its >> components without any error message from Matlab. Recently, I keep >> experiencing the error message, and Matlab crashes completely. I have no >> clue what could have gone wrong. >> >> >> >> Cheers, >> >> Hweeling >> >> >> >> On 31 March 2014 17:08, Stephen Politzer-Ahles >> wrote: >> >> Hello Hweeling, >> >> >> >> What kind of error do you get in MATLAB when you try to do ICA, is it an >> "Out of memory" error? I'm asking because this is a fairly common issue in >> MATLAB on Windows systems (I don't know the details of your data, but I've >> experienced this issue on 32-channel, 1000-Hz epoched EEG data if the >> epochs are long enough and numerous enough). For me the only solutions >> (other than shortening the epochs or downsampling the data, which might not >> be good options depending on your research question) were to use a >> Unix-based operating system (like Mac OS) or to upgrade my Windows (I had >> errors like this when using a 32-bit version of Windows with 2 GB of RAM, >> but not so much after I upgraded to 64-bit and 8 GB of RAM). I'm not sure >> if this is the issue you're having, though. >> >> >> >> Best, >> >> Steve >> >> >> >> >> >> >> Stephen Politzer-Ahles >> New York University, Abu Dhabi >> Neuroscience of Language Lab >> http://www.nyu.edu/projects/politzer-ahles/ >> >> >> >> On Mon, Mar 31, 2014 at 7:02 PM, wrote: >> >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. Fieldtrip ICA crashes Matlab (Hwee Ling Lee) >> 2. Re: plotting interpolated sources with ft_sourceplot >> (J?rn M. Horschig) >> 3. Re: help about ' fieldtrip2fiff ' (Gio Piantoni) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Mon, 31 Mar 2014 16:48:34 +0200 >> From: Hwee Ling Lee >> To: FieldTrip discussion list >> Subject: [FieldTrip] Fieldtrip ICA crashes Matlab >> Message-ID: >> > poVtb-1ApZuDQ at mail.gmail.com> >> Content-Type: text/plain; charset="iso-8859-1" >> >> Dear all, >> >> I'm encountering a problem with running ICA in Matlab. After ICA, when I >> tried to plot the components, Matlab keeps prompting an internal problem >> and needs to be closed. I wonder why this is the case. Could someone >> please >> tell me what went wrong? >> >> Here's part of my script for ICA: >> >> cfg = []; % if data were cleaned, then use this >> >> if sub == 5 %|| sub == 7 >> cfg.channel = {'all', '-AFz', '-FT7'}; >> elseif sub == 7 >> cfg.channel = {'all' '-AFz'}; >> else >> cfg.channel = {'all'}; >> end >> >> % cfg.runica.pca = 121; % using the rank of my data >> % ic_data = ft_componentanalysis(cfg,cleandata); % if data were >> cleaned then use this >> ic_data = ft_componentanalysis(cfg, cleandata); >> >> % after ICA, look for components that we want to substract from >> our >> data, >> % only looking at ten channels (components) at a time >> cfg = []; >> cfg.dataset = rawdatafile; >> cfg.viewmode = 'component'; >> cfg.continuous = 'no'; >> cfg.blocksize = 8; >> cfg.channels = 'all'; >> cfg.layout = 'EEG1020.lay'; >> ft_databrowser(cfg,ic_data); >> >> >> The internal problem appears even when I downsampled my data from 5000 Hz >> to 1000 Hz. >> >> The internal problem appears also when I have short segments of my data >> (i.e. 2s per trial), and long segments of my data (i.e. 6s per trial). >> >> The memory of my PC workstation is: >> Maximum possible array: 60253 MB (6.318e+10 bytes) * >> Memory available for all arrays: 60253 MB (6.318e+10 bytes) * >> Memory used by MATLAB: 560 MB (5.872e+08 bytes) >> Physical Memory (RAM): 32685 MB (3.427e+10 bytes) >> >> Interestingly, this internal problem does not occur when I ran my script >> on >> my Macbook Pro. >> >> I'm feeling very lost here. Any help is highly appreciated. >> >> Cheers, >> Hweeling >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: < >> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/f756367f/attachment-0001.html >> > >> >> >> >> >> >> -- >> >> ================================================= >> Dr. rer. nat. Lee, Hwee Ling >> Postdoc >> German Center for Neurodegenerative Diseases (DZNE) Bonn >> >> Email 1: hwee-ling.leedzne.de >> Email 2: hweeling.leegmail.com >> >> >> >> https://sites.google.com/site/hweelinglee/home >> >> Correspondence Address: >> Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany >> ================================================= >> > > > > -- > ================================================= > Dr. rer. nat. Lee, Hwee Ling > Postdoc > German Center for Neurodegenerative Diseases (DZNE) Bonn > > Email 1: hwee-ling.leedzne.de > Email 2: hweeling.leegmail.com > > https://sites.google.com/site/hweelinglee/home > > Correspondence Address: > Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany > ================================================= > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.todorovic at fcdonders.ru.nl Thu Apr 3 00:54:42 2014 From: a.todorovic at fcdonders.ru.nl (Todorovic, A.) Date: Thu, 3 Apr 2014 00:54:42 +0200 (CEST) Subject: [FieldTrip] denoising data In-Reply-To: <800964494.215951.1396478020373.JavaMail.root@monoceros.zimbra.ru.nl> Message-ID: <124252612.215995.1396479282885.JavaMail.root@monoceros.zimbra.ru.nl> Dear 'trippers, I'm curious to hear your thoughts on how to best denoise data. What I'm doing is working, but I'd like to hear whether it's logical or reasonable. In particular, I have two issues. One is that I use ICA to remove blinks, so I have to fit denoising into a pipeline that incorporates ICA (which, I am guessing, works well only without including reference channels). The other is that I see there are two functions for denoising, ft_denoise_synthetic and ft_denoise_pca. In sum (1) I'm not really sure WHEN the best moment for denoising is, given that I use ICA, and (2) I don't understand when it's better to use ft_denoise_synthetic and when ft_denoise_pca. I do see that ft_denoise_pca has the option of preprocessing reference channels separately, which makes it easier to use after ICA. I used to know only about the first function, and my solution was to do ft_denoise_synthetic (using the 'G3BR' option) prior to the ICA. Then I would remove components which contain artifacts, and continue with making ERF/TFRs/whatever. This produces data that is somewhat cleaner than when I skip the denoising step. I was curious about the ft_denoise_pca when I saw it, so I tried running it on filtered, preprocessed data that I had after I rejected ICA components. [In the process of doing ICA, I used the ft_denoise_synthetic option, as above.] This produced a different TFR at the end of the road, which again looked cleaner. Significantly cleaner, actually, but N=1. Now I'm not sure if it was a logical step to use both denoising functions, and if it would have been a better idea to do things differently. I'd like to hear both whether something in the logic is wrong, and whether it's inelegant. Cheers, Ana From haiteng.jiang at gmail.com Thu Apr 3 07:53:36 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Thu, 3 Apr 2014 07:53:36 +0200 Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data Message-ID: Dear Nithin, Cluster statistic works both for MEG and EEG data since the machinery is the same . You can organize the Non-FT in the Fieldtrip style. Please not that FT have a data structure (channel*frequency*time ), so you need to transpose your data matrix first. Besides , you also need to define the layout of your channels , then you know the neighbors of channels (see ft_prepare_neighbours) because clusters are formed on the basis of temporal, spatial and spectral adjacency. For more information, please have a look at the tutorial again http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq. All the best, Haiteng > > Message: 6 > Date: Wed, 2 Apr 2014 10:23:01 -0400 > From: "Nithin Krishna" > To: "list, FieldTrip discussion" > Subject: [FieldTrip] Question on Cluster-based permutation tests on > time-frequency data > Message-ID: <20140402T102301Z_155300170001 at mprc.umaryland.edu> > Content-Type: text/plain; charset="utf-8" > > Dear All, > I read the tutorial section on Cluster-based permutation tests on > time-frequency data as well as the Maris and Oostenveld, Journal of > Neuroscience Methods, 2007 report. I am interested in setting up a ERP > experiment on EEG data in this regard I like the procedure and processing > section of the tutorial, however I would like to know if there is any > section for EEG, I understand that megplanar is specific for MEG. > Also is it possible to use 3D matrix (TFR) (time, Freq channels ) non > feild trip output to run the cluster based permutation tests. > Looking forward > Nithin > > > > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Thu Apr 3 08:27:30 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Thu, 3 Apr 2014 08:27:30 +0200 Subject: [FieldTrip] denoising data Message-ID: > > Dear Ana, > If I understand correctly , we use ft_denoise_synthetic and ft_denoise_pca to reduce noise due to recording (e.g. environment noise , thermal noise... ) not the brain signal artefact (e.g eye blink). Normally ,I use these two functions in the very early stage . Best, Haiteng > > Message: 5 > Date: Thu, 3 Apr 2014 00:54:42 +0200 (CEST) > From: "Todorovic, A." > To: FieldTrip List > Subject: [FieldTrip] denoising data > Message-ID: > < > 124252612.215995.1396479282885.JavaMail.root at monoceros.zimbra.ru.nl> > Content-Type: text/plain; charset=utf-8 > > Dear 'trippers, > > I'm curious to hear your thoughts on how to best denoise data. What I'm > doing is working, but I'd like to hear whether it's logical or reasonable. > > In particular, I have two issues. One is that I use ICA to remove blinks, > so I have to fit denoising into a pipeline that incorporates ICA (which, I > am guessing, works well only without including reference channels). > > The other is that I see there are two functions for denoising, > ft_denoise_synthetic and ft_denoise_pca. > > In sum (1) I'm not really sure WHEN the best moment for denoising is, > given that I use ICA, and (2) I don't understand when it's better to use > ft_denoise_synthetic and when ft_denoise_pca. I do see that ft_denoise_pca > has the option of preprocessing reference channels separately, which makes > it easier to use after ICA. > > I used to know only about the first function, and my solution was to do > ft_denoise_synthetic (using the 'G3BR' option) prior to the ICA. Then I > would remove components which contain artifacts, and continue with making > ERF/TFRs/whatever. This produces data that is somewhat cleaner than when I > skip the denoising step. > > I was curious about the ft_denoise_pca when I saw it, so I tried running > it on filtered, preprocessed data that I had after I rejected ICA > components. [In the process of doing ICA, I used the ft_denoise_synthetic > option, as above.] This produced a different TFR at the end of the road, > which again looked cleaner. Significantly cleaner, actually, but N=1. > > Now I'm not sure if it was a logical step to use both denoising functions, > and if it would have been a better idea to do things differently. I'd like > to hear both whether something in the logic is wrong, and whether it's > inelegant. > > Cheers, > Ana > > > ------------------------------ > > Message: 6 > Date: Thu, 3 Apr 2014 07:53:36 +0200 > From: Haiteng Jiang > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] Question on Cluster-based permutation tests > on time-frequency data > Message-ID: > 2+knQ6iHyZqSfyu0r2xvLessob65w at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Dear Nithin, > > Cluster statistic works both for MEG and EEG data since the machinery > is the same . You can organize the Non-FT in the Fieldtrip style. > Please not that FT have a data structure (channel*frequency*time ), so you > need to transpose your data matrix first. Besides , you also need to > define the layout of your channels , then you know the neighbors of > channels (see ft_prepare_neighbours) because clusters are formed on the > basis of temporal, spatial and spectral adjacency. For more information, > please have a look at the tutorial again > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq. > > All > the best, > > Haiteng > > > > > > > > Message: 6 > > Date: Wed, 2 Apr 2014 10:23:01 -0400 > > From: "Nithin Krishna" > > To: "list, FieldTrip discussion" > > Subject: [FieldTrip] Question on Cluster-based permutation tests on > > time-frequency data > > Message-ID: <20140402T102301Z_155300170001 at mprc.umaryland.edu> > > Content-Type: text/plain; charset="utf-8" > > > > Dear All, > > I read the tutorial section on Cluster-based permutation tests on > > time-frequency data as well as the Maris and Oostenveld, Journal of > > Neuroscience Methods, 2007 report. I am interested in setting up a ERP > > experiment on EEG data in this regard I like the procedure and processing > > section of the tutorial, however I would like to know if there is any > > section for EEG, I understand that megplanar is specific for MEG. > > Also is it possible to use 3D matrix (TFR) (time, Freq channels ) non > > feild trip output to run the cluster based permutation tests. > > Looking forward > > Nithin > > > > > > > > -- > Haiteng Jiang > PhD candidate > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Visiting address > Room 2.32 > Donders Centre for Cognitive Neuroimaging > Kapittelweg 29 > 6525 EN Nijmegen > the Netherlands > > Tel.: +31 (0)243668291 > Web: https://sites.google.com/site/haitengjiang/ > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140403/31c1ca38/attachment.html > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 8 > **************************************** > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.roux at bcbl.eu Thu Apr 3 12:07:11 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Thu, 3 Apr 2014 12:07:11 +0200 (CEST) Subject: [FieldTrip] denoising data In-Reply-To: Message-ID: <867980492.1251689.1396519631090.JavaMail.root@bcbl.eu> Hi Ana, Haiteng and everyone else, I am joining in on this discussion as I am thinking about a way of combining ft_componentanalysis with ft_denoise_pca to remove EOG, ECG and EMG activity. The pipeline that I would like to try is the following: %% ICA decomposition cfg = []; cfg.method = 'runica'; ICs = ft_componentanalysis(cfg,meg_data); % here meg_data has undergone basic preprocessing including bp-filtering as well as & ft_artifact_jump and ft_artifact_clip %% Substract artifacts from ICA components cfg = []; cfg.refchannel = eeg_data.label(1); % eeg_data contains the EOG (1-2), ECG(3) and EMG(4) ref-channels cfg.channel = {'runica'}; cfg.zscore = 'yes'; cfg.pertrial = 'yes'; cfg.trials = 'all'; [ICs] = ft_denoise_pca(cfg,ICs,eeg_data); % substract VEOG activity from all ICs %% The idea is to repeat this step for all refchannels in order to substract the artifacts. Then backproject ICs to original data: %% Backproject data cfg = []; meg_data = ft_rejectcomponent(cfg,ICs,meg_data); The advantage is that you don't have to "throw away" the entire component as sometimes ICs contain a mix of artifacts and brain activity. So by regressing out the artifacts, you could avoid throwing away the good stuff. However, I don't know if this is a good approach. There may be pitfalls that I am not thinking of right now. Therefore any suggestions or comments about whether this is a good idea would be very welcome! I am hoping that some of the ft_guru's could drop a line or two about this! Fred ----- Original Message ----- From: "Haiteng Jiang" To: fieldtrip at science.ru.nl Sent: Thursday, April 3, 2014 8:27:30 AM Subject: Re: [FieldTrip] denoising data Dear Ana, If I understand correctly , we use ft_denoise_synthetic and ft_denoise_pca to reduce noise due to recording (e.g. environment noise , thermal noise... ) not the brain signal artefact (e.g eye blink). Normally ,I use these two functions in the very early stage . Best, Haiteng Message: 5 Date: Thu, 3 Apr 2014 00:54:42 +0200 (CEST) From: "Todorovic, A." < a.todorovic at fcdonders.ru.nl > To: FieldTrip List < fieldtrip at donders.ru.nl > Subject: [FieldTrip] denoising data Message-ID: < 124252612.215995.1396479282885.JavaMail.root at monoceros.zimbra.ru.nl > Content-Type: text/plain; charset=utf-8 Dear 'trippers, I'm curious to hear your thoughts on how to best denoise data. What I'm doing is working, but I'd like to hear whether it's logical or reasonable. In particular, I have two issues. One is that I use ICA to remove blinks, so I have to fit denoising into a pipeline that incorporates ICA (which, I am guessing, works well only without including reference channels). The other is that I see there are two functions for denoising, ft_denoise_synthetic and ft_denoise_pca. In sum (1) I'm not really sure WHEN the best moment for denoising is, given that I use ICA, and (2) I don't understand when it's better to use ft_denoise_synthetic and when ft_denoise_pca. I do see that ft_denoise_pca has the option of preprocessing reference channels separately, which makes it easier to use after ICA. I used to know only about the first function, and my solution was to do ft_denoise_synthetic (using the 'G3BR' option) prior to the ICA. Then I would remove components which contain artifacts, and continue with making ERF/TFRs/whatever. This produces data that is somewhat cleaner than when I skip the denoising step. I was curious about the ft_denoise_pca when I saw it, so I tried running it on filtered, preprocessed data that I had after I rejected ICA components. [In the process of doing ICA, I used the ft_denoise_synthetic option, as above.] This produced a different TFR at the end of the road, which again looked cleaner. Significantly cleaner, actually, but N=1. Now I'm not sure if it was a logical step to use both denoising functions, and if it would have been a better idea to do things differently. I'd like to hear both whether something in the logic is wrong, and whether it's inelegant. Cheers, Ana ------------------------------ Message: 6 Date: Thu, 3 Apr 2014 07:53:36 +0200 From: Haiteng Jiang < haiteng.jiang at gmail.com > To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data Message-ID: Content-Type: text/plain; charset="iso-8859-1" Dear Nithin, Cluster statistic works both for MEG and EEG data since the machinery is the same . You can organize the Non-FT in the Fieldtrip style. Please not that FT have a data structure (channel*frequency*time ), so you need to transpose your data matrix first. Besides , you also need to define the layout of your channels , then you know the neighbors of channels (see ft_prepare_neighbours) because clusters are formed on the basis of temporal, spatial and spectral adjacency. For more information, please have a look at the tutorial again http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq . All the best, Haiteng > > Message: 6 > Date: Wed, 2 Apr 2014 10:23:01 -0400 > From: "Nithin Krishna" < nkrishna at mprc.umaryland.edu > > To: "list, FieldTrip discussion" < fieldtrip at science.ru.nl > > Subject: [FieldTrip] Question on Cluster-based permutation tests on > time-frequency data > Message-ID: < 20140402T102301Z_155300170001 at mprc.umaryland.edu > > Content-Type: text/plain; charset="utf-8" > > Dear All, > I read the tutorial section on Cluster-based permutation tests on > time-frequency data as well as the Maris and Oostenveld, Journal of > Neuroscience Methods, 2007 report. I am interested in setting up a ERP > experiment on EEG data in this regard I like the procedure and processing > section of the tutorial, however I would like to know if there is any > section for EEG, I understand that megplanar is specific for MEG. > Also is it possible to use 3D matrix (TFR) (time, Freq channels ) non > feild trip output to run the cluster based permutation tests. > Looking forward > Nithin > > > > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: < http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140403/31c1ca38/attachment.html > ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip End of fieldtrip Digest, Vol 41, Issue 8 **************************************** -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From luke.bloy at gmail.com Thu Apr 3 20:19:29 2014 From: luke.bloy at gmail.com (Luke Bloy) Date: Thu, 3 Apr 2014 14:19:29 -0400 Subject: [FieldTrip] fiff_read_epochs undefined Message-ID: I'm having trouble reading in headers from fif files. it seems like read_header now needs a file in /external/mne but that isn't being automatically added to the path via (ft_defaults) %----------------------------------- megFile = 'T110_012413_eyes_closed1_raw_tsss_mc.fif'; >> hdr = ft_read_header(megFile); grad = ft_convert_units(hdr.grad,'m'); 306 MEG channel locations transformed Undefined function 'fiff_read_epochs' for input arguments of type 'char'. Error in ft_read_header (line 1386) epochs = fiff_read_epochs(filename); %----------------------------------- am I missing something? THanks Luke -------------- next part -------------- An HTML attachment was scrubbed... URL: From luke.bloy at gmail.com Thu Apr 3 21:03:59 2014 From: luke.bloy at gmail.com (Luke Bloy) Date: Thu, 3 Apr 2014 15:03:59 -0400 Subject: [FieldTrip] fiff_read_epochs undefined In-Reply-To: References: Message-ID: Sorry ignore this last email. An update to the newest source fixed the issue. Sorry On Thu, Apr 3, 2014 at 2:19 PM, Luke Bloy wrote: > I'm having trouble reading in headers from fif files. > > it seems like read_header now needs a file in /external/mne but that isn't > being automatically added to the path via (ft_defaults) > > %----------------------------------- > megFile = 'T110_012413_eyes_closed1_raw_tsss_mc.fif'; > >> hdr = ft_read_header(megFile); > grad = ft_convert_units(hdr.grad,'m'); > 306 MEG channel locations transformed > Undefined function 'fiff_read_epochs' for input arguments of type 'char'. > > Error in ft_read_header (line 1386) > epochs = fiff_read_epochs(filename); > %----------------------------------- > > > am I missing something? > > THanks > Luke > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Fri Apr 4 02:08:02 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Fri, 4 Apr 2014 00:08:02 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <533B22CA.8040305@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>, <533985D8.4080504@donders.ru.nl> <533AD84B.6060600@donders.ru.nl> , <533B22CA.8040305@donders.ru.nl> Message-ID: Hello Jorn and Robert, Can you please keep me updated on your plans for the previously discussed functions? Just to remind you, I wish apply the LCMV beamformer on continuous data with ICA components instead of electrodes. Kind regards, Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" Sent: Wednesday, 2 April 2014 7:04 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot Hi Robert, yes, I thought so, that's why I put it on the agenda for tomorrow's meeting to discuss in more detail to figure out what needs to be done :) Best, Jörn On 4/1/2014 7:19 PM, Robert Oostenveld wrote: > Hi Jorn > > I was browsing the FT list and see that you got involved with this question from Tyler. I can imagine there being problems with a pipeline like this > > preprocessing -> componentanalysis -> timelockanalysis -> dipolefitting > > although it should (i.e. "is meant to") work by fitting dipoles to component topographies. But the code is not frequently used like this and it might be possible that there has been regression of the code (i.e bugs in the latest version that were not there before). > > With sourceanalysis it depends on the method. Covariance estimates between components does not make much sense in the further inversion, and thereby beamforming won’t work. MNE should in principle work, but not with an estimated data covariance but rather a scaled identity covariance. > > Given the uncertain level of support , but clear expectations on what should (and should not) work, I suggest to file it as “bug” (i.e. the issue is that it should be tested) and to write a test script that goes (with e.g. some simulated data) over the various options. > > best regards, > Robert > > > On 01 Apr 2014, at 17:16, Jörn M. Horschig wrote: > >> Hi Tyler, >> >> any reason why you don't want to go back to sensor-space but stay in component-space with your data? I would assume that the error will be gone if you use the back-projected data (ft_rejectcomponent, with cfg.component = []). >> >> Best, >> Jörn >> >> On 4/1/2014 8:15 AM, Tyler Grummett wrote: >>> Hey Jorn, >>> >>> In addition to my previous emails, Ive been trying to debug the functions. >>> >>> In ft_sourceanalysis, line 661 to 677: >>> >>> % HACK: use the default code >>> % select the channels of interest >>> [dum, datchanindx] = match_str(cfg.channel, data.label); >>> if strcmp(data.dimord, 'chan_time') >>> % It is in principle possible to have timelockanalysis with >>> % keeptrial=yes and only a single trial in the raw data. >>> % In that case the covariance should be represented as Nchan*Nchan >>> data.avg = data.avg(datchanindx,:); >>> %data.cov = reshape(data.cov, length(datchanindx), length(datchanindx)); >>> data.cov = data.cov(datchanindx,datchanindx); >>> else >>> data.avg = data.avg(datchanindx,:); >>> data.cov = data.cov(:,datchanindx,datchanindx); >>> data.trial = data.trial(:,datchanindx,:); >>> end >>> data.label = data.label(datchanindx); >>> Nchans = length(data.label); >>> >>> I found that my cfg.channel is []; and the data.label is all my ICA components labelled ica_001 etc. >>> >>> So it is returned as a []; >>> which means data.cov = []; >>> >>> I think then it will crash later parts of the code. Does this function work on ICA components? >>> >>> I ran the ICA in eeglab. >>> >>> Tyler. >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" >>> Sent: Tuesday, 1 April 2014 1:42 AM >>> To: fieldtrip at science.ru.nl >>> Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot >>> >>> just to clarify and be precise >>>> The pos-matrix has to be a regular 3D grid, i.e. be representable as a >>>> 3x3x3 matrix. >>> it actually does not have to be as you can also beam individual grid >>> points, but if you have a .dim field, then is has to be like above. But >>> that does not affect the rest of the mail I wrote ;) >>> >>> >>>> I am not quite sure how the sourceinterpolate function is handeling >>>> the fact that you do not have that .dim field. Apparently, it is also >>>> confused ;) >>>> >>>> Do you want to reconstruct only some voxels? From your code it seems >>>> that you want to cover the whole brain with a 1cm resolution. If the >>>> latter is the case, maybe restart with creating your forward model by >>>> following the tutorial that I posted in my previous mail. There are >>>> some sanity checks that can help you figuring out if you are doing the >>>> correct thing. If the former one is the case, please explain again >>>> what exactly you want to achieve and how you are building your forward >>>> model. >>>> >>>> Best, >>>> Jörn >>>> >>>> btw, there's nothing wrong with being a PhD student, it's just a >>>> matter of experience in practice and theory as in all domains in life ;) >>>> >>>> >>>> On 3/31/2014 3:15 PM, Tyler Grummett wrote: >>>>> Hey Jorn, >>>>> >>>>> Yes I am definitely confused haha, this stuff is way out of my league >>>>> as a PhD student. >>>>> Anyway, I feel we are getting somewhere. >>>>> >>>>> timelock = >>>>> >>>>> avg: [121x19767 double] >>>>> var: [121x19767 double] >>>>> time: [1x19767 double] >>>>> dof: [121x19767 double] >>>>> label: {1x121 cell} >>>>> dimord: 'chan_time' >>>>> cov: [121x121 double] >>>>> elec: [1x1 struct] >>>>> cfg: [1x1 struct] >>>>> >>>>> source = >>>>> >>>>> time: [1x19767 double] >>>>> pos: [642x3 double] >>>>> inside: [642x1 double] >>>>> outside: [] >>>>> method: 'average' >>>>> avg: [1x1 struct] >>>>> cfg: [1x1 struct] >>>>> >>>>> sourceInt = >>>>> >>>>> time: [1x19767 double] >>>>> avg: [1x1 struct] >>>>> pos: [16777216x3 double] >>>>> dim: [256 256 256] >>>>> inside: [1x16777216 double] >>>>> outside: [1x0 double] >>>>> coordsys: 'ctf' >>>>> unit: 'mm' >>>>> cfg: [1x1 struct] >>>>> >>>>> Given what I said last time, I might not comment on the differences. >>>>> I hope you can see something wrong. >>>>> >>>>> One thing I should mention is that the data is continuous, around 30 >>>>> seconds. Therefore there is only one trial, >>>>> is that an issue? >>>>> >>>>> Tyler >>>>> >>>>> ************************* >>>>> >>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>> PhD Candidate >>>>> Brain Signals Laboratory >>>>> Flinders University >>>>> Rm 5A301 >>>>> Ext 66124 >>>>> >>>>> ________________________________________ >>>>> From: fieldtrip-bounces at science.ru.nl >>>>> on behalf of "Jörn M. Horschig" >>>>> >>>>> Sent: Monday, 31 March 2014 10:24 PM >>>>> To: FieldTrip discussion list >>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>> ft_sourceplot >>>>> >>>>> Hi Tyler, >>>>> >>>>> there is not much inherently different between time- and >>>>> freuqency-domain beamformer, at least in terms of computing the forward >>>>> and the inverse solution. But I see that you are obviously confused, so >>>>> let me try to help you out and shed some light on what you are actually >>>>> doing ;) >>>>> >>>>> >>>>>> I had a look at my variables. >>>>>> >>>>>> source.avg = >>>>>> >>>>>> pow: [642x1 double] >>>>>> filter: {642x1 cell} >>>>>> >>>>>> sourceInt.avg = >>>>>> >>>>>> pow: [16777216x1 double] >>>>>> >>>>>> So clearly, as both variables are completely different. Something >>>>>> has gone wrong. >>>>> No, that is actually how it should be. From below you can see that your >>>>> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >>>>> 16777216 elements. In line with source.avg.pow, you should see that your >>>>> 'grid' consists of 642 elements, so you were computing your source >>>>> activity on a grid of in total 642 elements. Then you used the original >>>>> MRI to interpolate from 642 to these 16 million grid points. Actually, >>>>> since you specific cfg.downsample = 2, it should have been only 8 >>>>> million points, so that's where things already get a bit weird. >>>>> >>>>> So let's go into some sanity checks: >>>>> 1. are you using the latest version (or a recent, i.e. from this year) >>>>> of FielTrip? >>>>> 2. sourceInt should look something like this, does it? >>>>> >>>>> source_diff_int = >>>>> inside: [46x55x46 logical] >>>>> avg: [1x1 struct] >>>>> dim: [46 55 46] >>>>> transform: [4x4 double] >>>>> anatomy: [46x55x46 double] >>>>> unit: 'mm' >>>>> cfg: [1x1 struct] >>>>> >>>>> >>>>> >>>>> 3. source should look something like this: >>>>> >>>>> source = >>>>> dim: [20 25 22] >>>>> freq: 54.8287 >>>>> cumtapcnt: [338x1 double] >>>>> pos: [11000x3 double] >>>>> inside: [1x5798 double] >>>>> outside: [1x5202 double] >>>>> method: 'average' >>>>> avg: [1x1 struct] >>>>> trialinfo: [338x1 double] >>>>> cfg: [1x1 struct] >>>>> >>>>> 4. also check your grid, should be something like this: >>>>> >>>>> sourcemodel = >>>>> >>>>> pos: [11000x3 double] >>>>> dim: [20 25 22] >>>>> unit: 'cm' >>>>> inside: [1x5798 double] >>>>> outside: [1x5202 double] >>>>> params: [1x1 struct] >>>>> initial: [4x4 double] >>>>> cfg: [1x1 struct] >>>>> >>>>> >>>>> Of course, it should all look a bit different, because you are using >>>>> LCMV, but essentially it should be the same. Lastly, you can check other >>>>> source plotting methods, like 'ortho' or try to plot the source >>>>> structure rather than the sourceInt structure. In the end, the error >>>>> must be somewhere in your grid, be it in .pos or .inside, because >>>>> FieldTrip thinks that there is only one voxel to be plotted. There are >>>>> other things that may be the issue, but I am not sure about these. So, I >>>>> would suggest that you play a bit around and see where the error might >>>>> come from (e.g. follow this tutorial: >>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >>>>> steps that you need for LCMV, maybe also check out: >>>>> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >>>>> >>>>> there, LCMV is used, but on one voxel only) >>>>> >>>>> Best, >>>>> Jörn >>>>> >>>>>> The next part of my code is the following: >>>>>> >>>>>> % interpolate sources >>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>> mri = ft_volumereslice([], mri); >>>>>> >>>>>> cfg = []; >>>>>> cfg.downsample = 2; >>>>>> cfg.parameter = 'avg.pow'; >>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>> parameter >>>>>> % does not vary over time, therefore the time >>>>>> dimension is not needed. >>>>>> >>>>>> mri = >>>>>> >>>>>> anatomy: [256x256x256 double] >>>>>> dim: [256 256 256] >>>>>> transform: [4x4 double] >>>>>> coordsys: 'ctf' >>>>>> unit: 'mm' >>>>>> cfg: [1x1 struct] >>>>>> >>>>>> I cant really see if the data works in the tutorial because it >>>>>> doesnt appear as though fieldtrip has a tutorial on lcmv >>>>>> beamformers, they seem to stick to frequency domain beamformers. >>>>>> >>>>>> Ive been wrong before though, >>>>>> >>>>>> thanks for your help. >>>>>> >>>>>> Tyler >>>>>> >>>>>> ************************* >>>>>> >>>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>>> PhD Candidate >>>>>> Brain Signals Laboratory >>>>>> Flinders University >>>>>> Rm 5A301 >>>>>> Ext 66124 >>>>>> >>>>>> ________________________________________ >>>>>> From: fieldtrip-bounces at science.ru.nl >>>>>> on behalf of "Jörn M. Horschig" >>>>>> >>>>>> Sent: Monday, 31 March 2014 7:13 PM >>>>>> To: FieldTrip discussion list >>>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>>> ft_sourceplot >>>>>> >>>>>> Hi Tyler, >>>>>> >>>>>> hm, okay, it could be that the issue with the leadfield and with the >>>>>> plot are related, but it could also be that they are separate issues. I >>>>>> just saw that you posted the same 'problem' on bugzilla and included a >>>>>> picture. Maybe for next time, include a picture on the mailinglist and >>>>>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>>>>> and not if you are not sure. That saves us a lot of time in separating >>>>>> code issues from user problems ;) >>>>>> >>>>>> So, back to you problem. It seems that your reconstruction results in >>>>>> one voxel only. Are you sure that your grid consistents of more than >>>>>> just one position? So, for example check the size of the matrices in >>>>>> source.avg, source- and headmodel, etc. >>>>>> >>>>>> Also, you can check in Matlab the respective fields of source and >>>>>> sourceInt and see whether that makes sense. >>>>>> >>>>>> Lastly, a neat way to check is always to use your code on data from the >>>>>> tutorial, and vice versa, use code from the tutorial on your data and >>>>>> see whether that works. Both should give sensible results, and if one >>>>>> does not, you know where to start looking for a solution ;) >>>>>> >>>>>> Best, >>>>>> Jörn >>>>>> >>>>>> >>>>>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>>>>> Hey Jorn, >>>>>>> >>>>>>> Previously I have let ft_sourceanalysis do a lead field because if >>>>>>> I use the following code: >>>>>>> >>>>>>> % compute lead field ( apparently source analysis computes >>>>>>> % lead field anyway >>>>>>> cfg = []; >>>>>>> cfg.elec = timelock.elec; >>>>>>> cfg.vol = vol; >>>>>>> cfg.reducerank = 3; >>>>>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>>>>> cm resolution >>>>>>> cfg.grid.unit = 'cm'; >>>>>>> cfg.normalize = 'yes'; % if you are not >>>>>>> contrasting the activity of interest again another condition or >>>>>>> baseline time-window >>>>>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>>>>> I AM UP TO >>>>>>> >>>>>>> and then calculate the source analysis: >>>>>>> >>>>>>> % Source Analysis: without contrasting condition >>>>>>> cfg = []; >>>>>>> cfg.method = 'lcmv'; >>>>>>> cfg.grid = grid; >>>>>>> cfg.vol = vol; >>>>>>> % cfg.grid.pos = maxpos; >>>>>>> cfg.keepfilter = 'yes'; >>>>>>> cfg.dics.projectnoise = 'yes'; >>>>>>> % cfg.dics.lambda = 0; >>>>>>> source = ft_sourceanalysis( cfg, timelock); >>>>>>> >>>>>>> then I get an error than says: >>>>>>> >>>>>>> Error using * >>>>>>> Inner matrix dimensions must agree. >>>>>>> >>>>>>> Error in beamformer_lcmv (line 268) >>>>>>> filt = pinv(lf' * invCy * lf) * lf' * >>>>>>> invCy; % van Veen eqn. 23, use >>>>>>> PINV/SVD to cover rank deficient leadfield >>>>>>> >>>>>>> Error in ft_sourceanalysis (line 794) >>>>>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>>>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>>>>> optarg{:}); >>>>>>> >>>>>>> I just removed the leadfield code and it successfully ran. I could >>>>>>> also interpolate it later. >>>>>>> Is this the correct approach. >>>>>>> >>>>>>> Thankyou in advance! >>>>>>> >>>>>>> Tyler >>>>>>> >>>>>>> ************************* >>>>>>> >>>>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>>>> PhD Candidate >>>>>>> Brain Signals Laboratory >>>>>>> Flinders University >>>>>>> Rm 5A301 >>>>>>> Ext 66124 >>>>>>> >>>>>>> ________________________________________ >>>>>>> From: fieldtrip-bounces at science.ru.nl >>>>>>> on behalf of "Jörn M. Horschig" >>>>>>> >>>>>>> Sent: Monday, 31 March 2014 5:30 PM >>>>>>> To: FieldTrip discussion list >>>>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>>>> ft_sourceplot >>>>>>> >>>>>>> Hi Tyler, >>>>>>> >>>>>>> what you are describing sounds to me like the center bias of the >>>>>>> beamformer. Did you contrast the activity with anything, or did you >>>>>>> normalize your leadfield? >>>>>>> Check this out: >>>>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>>>>> >>>>>>> >>>>>>> Best, >>>>>>> Jörn >>>>>>> >>>>>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>>>>> I have been trying to plot my interpolated source data using the >>>>>>>> code: >>>>>>>> >>>>>>>> % interpolate sources >>>>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>>>> mri = ft_volumereslice([], mri); >>>>>>>> cfg = []; >>>>>>>> cfg.downsample = 2; >>>>>>>> cfg.parameter = 'avg.pow'; >>>>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>>>> parameter >>>>>>>> % does not vary over time, therefore the time >>>>>>>> dimension >>>>>>>> is not needed. >>>>>>>> >>>>>>>> % Plot interpolated data >>>>>>>> cfg = []; %#ok >>>>>>>> cfg.method = 'ortho'; % spline >>>>>>>> cfg.funparameter = 'avg.pow'; >>>>>>>> ft_sourceplot( cfg, sourceInt); >>>>>>>> >>>>>>>> However the figure that comes up just had orange squares in the >>>>>>>> subplots. >>>>>>>> >>>>>>>> I dont know where Ive gone wrong. >>>>>>>> >>>>>>>> >>>>>>>> Tyler >>>>>>>> >>>>>>>> >>>>>>>> ************************* >>>>>>>> >>>>>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>>>>> /PhD Candidate/ >>>>>>>> /Brain Signals Laboratory/ >>>>>>>> /Flinders University/ >>>>>>>> /Rm 5A301/ >>>>>>>> /Ext 66124/ >>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> fieldtrip mailing list >>>>>>>> fieldtrip at donders.ru.nl >>>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> -- >>>>>>> Jörn M. Horschig >>>>>>> PhD Student >>>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>>> Centre for Cognitive Neuroimaging >>>>>>> Radboud University Nijmegen >>>>>>> Neuronal Oscillations Group >>>>>>> FieldTrip Development Team >>>>>>> >>>>>>> P.O. Box 9101 >>>>>>> NL-6500 HB Nijmegen >>>>>>> The Netherlands >>>>>>> >>>>>>> Contact: >>>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>>> Tel: +31-(0)24-36-68493 >>>>>>> Web: http://www.ru.nl/donders >>>>>>> >>>>>>> Visiting address: >>>>>>> Trigon, room 2.30 >>>>>>> Kapittelweg 29 >>>>>>> NL-6525 EN Nijmegen >>>>>>> The Netherlands >>>>>>> >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> -- >>>>>> Jörn M. Horschig >>>>>> PhD Student >>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>> Centre for Cognitive Neuroimaging >>>>>> Radboud University Nijmegen >>>>>> Neuronal Oscillations Group >>>>>> FieldTrip Development Team >>>>>> >>>>>> P.O. Box 9101 >>>>>> NL-6500 HB Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> Contact: >>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>> Tel: +31-(0)24-36-68493 >>>>>> Web: http://www.ru.nl/donders >>>>>> >>>>>> Visiting address: >>>>>> Trigon, room 2.30 >>>>>> Kapittelweg 29 >>>>>> NL-6525 EN Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> -- >>>>> Jörn M. Horschig >>>>> PhD Student >>>>> Donders Institute for Brain, Cognition and Behaviour >>>>> Centre for Cognitive Neuroimaging >>>>> Radboud University Nijmegen >>>>> Neuronal Oscillations Group >>>>> FieldTrip Development Team >>>>> >>>>> P.O. Box 9101 >>>>> NL-6500 HB Nijmegen >>>>> The Netherlands >>>>> >>>>> Contact: >>>>> E-Mail: jm.horschig at donders.ru.nl >>>>> Tel: +31-(0)24-36-68493 >>>>> Web: http://www.ru.nl/donders >>>>> >>>>> Visiting address: >>>>> Trigon, room 2.30 >>>>> Kapittelweg 29 >>>>> NL-6525 EN Nijmegen >>>>> The Netherlands >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tyler.grummett at flinders.edu.au Fri Apr 4 07:23:48 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Fri, 4 Apr 2014 05:23:48 +0000 Subject: [FieldTrip] spatial and temporal ICA after beamformer Message-ID: Hello fieldtrip, I was wondering whether it was possible in the fieldtrip toolbox to run a spatial and temporal ICA on data after it has been run through ft_sourceanalysis (We can a LCMV beamformer on EEG data that had been timelocked). Currently it is saying that I need raw data for it to be processed. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Fri Apr 4 10:17:55 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 04 Apr 2014 10:17:55 +0200 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: References: Message-ID: <533E6AB3.3080003@donders.ru.nl> Hi Tyler, sorry, I realized too late that you want to use LCMV on ICA components - mostly because your approach resulted in many different erros ;). Afaik, it is not possible to use beamforming on ICA components. On Wednesday we talked about this in our weekly FieldTrip meeting and identified some occasions where FieldTrip is not handling IC-data well. This can lead to unexpected results and missing warnings or errors. However, you can use dipole modelling (like EEGlab does) or MNE if you want to. These should work with ICs. Any reason why you want to use LCMV on ICs? In theory, both steps constitute a spatial filter, so you can try to be smart and first to LCMV on all your channel level data, and then apply the LCMV spatial filter on the individual backprojected ICs. Somewhat a complicated procedure, but I think it would work? Best, Jörn On 4/4/2014 7:23 AM, Tyler Grummett wrote: > > Hello fieldtrip, > > > I was wondering whether it was possible in the fieldtrip toolbox to > run a spatial and temporal ICA on data after it has been run through > ft_sourceanalysis (We can a LCMV beamformer on EEG data that had been > timelocked). > > > Currently it is saying that I need raw data for it to be processed. > > > Tyler > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jan.schoffelen at donders.ru.nl Fri Apr 4 10:32:14 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 4 Apr 2014 10:32:14 +0200 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: <533E6AB3.3080003@donders.ru.nl> References: <533E6AB3.3080003@donders.ru.nl> Message-ID: Hi all, Allow me to chime in here. As I understand it Tyler wants to do ICA on the output of an LCMV beamformer. This is in general allowed, and can be done if you know how to handle the data. In Fieldtrip there is no pre-cooked way of doing it. What you need is to fool ft_componentanalysis into believing that your source reconstructed data is of the type 'raw'. To get started, you can have a look at http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors. In this particular tutorial, only a few 'virtual channels' are created. You probably want many of those, defined on a 3D grid. The only constraint there is probably the amount of RAM on your computer. Note that you want to do (and will do) temporal ICA in this case. Also, note that you probably should pre-PCA your data (this will be a parameter in the specs for the options for the ICA algorithm you are going to use). If you want to apply the ICA algorithm on amplitude envelope timeseries of band-limited activity, rumour has it that the fastica method works quite well. Cheers, Jan-Mathijs On Apr 4, 2014, at 10:17 AM, Jörn M. Horschig wrote: > Hi Tyler, > > sorry, I realized too late that you want to use LCMV on ICA components - mostly because your approach resulted in many different erros ;). Afaik, it is not possible to use beamforming on ICA components. On Wednesday we talked about this in our weekly FieldTrip meeting and identified some occasions where FieldTrip is not handling IC-data well. This can lead to unexpected results and missing warnings or errors. However, you can use dipole modelling (like EEGlab does) or MNE if you want to. These should work with ICs. > > Any reason why you want to use LCMV on ICs? In theory, both steps constitute a spatial filter, so you can try to be smart and first to LCMV on all your channel level data, and then apply the LCMV spatial filter on the individual backprojected ICs. Somewhat a complicated procedure, but I think it would work? > > Best, > Jörn > > > > On 4/4/2014 7:23 AM, Tyler Grummett wrote: >> >> Hello fieldtrip, >> >> >> I was wondering whether it was possible in the fieldtrip toolbox to run a spatial and temporal ICA on data after it has been run through ft_sourceanalysis (We can a LCMV beamformer on EEG data that had been timelocked). >> >> >> Currently it is saying that I need raw data for it to be processed. >> >> >> Tyler >> >> >> ************************* >> >> /Tyler Grummett ( BBSc, BSc(Hons I))/ >> /PhD Candidate/ >> /Brain Signals Laboratory/ >> /Flinders University/ >> /Rm 5A301/ >> /Ext 66124/ >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Fri Apr 4 11:37:25 2014 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Fri, 4 Apr 2014 10:37:25 +0100 Subject: [FieldTrip] 1 PostDoc + 2 PhD positions in Computational Cognitive NeuroImaging Message-ID: 2 PhD and 1 PostDoc positions in Computational Cognitive Neuroimaging; University of Birmingham, UK In our natural dynamic environment the senses are constantly bombarded with many different signals. How does the human brain integrate information from multiple senses during perception? To study the neural mechanisms of multisensory integration and learning, we combine psychophysics, functional imaging (fMRI, EEG/MEG & interleaved TMS-fMRI) and models of Bayesian Inference and learning. The Computational Cognitive Neuroimaging Group (Prof Uta Noppeney) is seeking 1 enthusiastic PostDoc and 2 PhD candidates. Applicants should have a strong quantitative background and a degree in neuroscience, psychology, computer science, physics, medicine or related areas. Prior experience in functional imaging, MatLab, data analysis and/or machine learning would be an advantage. The lab is part of the Computational Neuroscience and Cognitive Robotics Centre and the Department of Psychology of the University of Birmingham, UK. The centre provides an excellent multidisciplinary and collaborative research environment combining expertise in cognitive neuroimaging, psychophysics and computational neuroscience. The psychology department was rated 3rd in the UK research assessment exercise. Applications will be considered until the positions are filled. Starting dates are flexible. For further information, please contact u.noppeney at bham.ac.uk and see http://www.birmingham.ac.uk/research/activity/cncr/index.aspx< http://www.birmingham.ac.uk/schools/psychology/index.aspx> http://www.birmingham.ac.uk/schools/psychology/index.aspx< http://www.birmingham.ac.uk/schools/psychology/people/profile.aspx?ReferenceId=29516 > http://www.birmingham.ac.uk/schools/psychology/people/profile.aspx?ReferenceId=29516 For application to the PostDoc positions, please send applications to http://www.jobs.ac.uk/job/AIM528/research-fellow/ For application to the PhD positions, please send application including CV, statement of research interests, and the names and full contact details of two referees to: u.noppeney at bham.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From luca.turella at unitn.it Fri Apr 4 13:31:47 2014 From: luca.turella at unitn.it (Luca Turella) Date: Fri, 4 Apr 2014 13:31:47 +0200 Subject: [FieldTrip] PostDoc opportunity at CIMeC - Neural substrates and temporal dynamics of prehension (fMRI/MEG) Message-ID: PostDoc opportunity at CIMeC - University of Trento Neural substrates and temporal dynamics of prehension (fMRI/MEG) A postdoctoral position (funded by italian "FIRB 2013" grant) will be available soon at Center for Mind/Brain Sciences (CIMeC, www.unitn.it/en/cimec) at the University of Trento (Italy). The topic of investigation will cover the neural substrates and temporal dynamics of action representations during planning and execution. The focus of the project is on the investigation of the coding of prehension movements at the level of their neural representations using fMRI and at the level of their dynamics using MEG. The requirements for the candidates are the following. Candidates must have a Ph.D. degree in a field related to Cognitive Neuroscience. Previous experience with EEG/MEG or fMRI methods and data analysis is required. The ideal candidate should have good programming skills in Matlab, preferably related to EEG/MEG data analysis (Fieldtrip) and/or to fMRI data analysis (SPM/BrainVoyager). Knowledge of kinematic data analysis is also a plus. Knowledge of Italian language is not required. The Center for Mind/Brain Sciences at the University of Trento is an outstanding working place situated in a beautiful surrounding (e.g. Dolomites, Garda Lake; see http://www.visittrentino.it/en). CIMeC offers an international and vibrant research setting with access to state-of-the-art neuroimaging methodologies, including a research-only MR scanner, MEG, EEG and TMS, as well as behavioural, eye tracking and motion tracking laboratories. The University of Trento is ranked first among research universities in Italy and the Trentino region is consistently at the top for quality of life and for the most efficient services in Italy. English is the official language of the CIMeC, where a large proportion of the faculty, post-docs and students come from a wide range of countries outside of Italy. The salary will be proportional to the level of experience and the starting date of the appointment is negotiable, but within the next 6 months. Applications will be considered until the position is filled. The contract will have a duration of 2 years. Applications should be sent to luca.turella at unitn.it, including complete CV, statement of research interests, and contact details of two referees. Potential candidates are also encouraged to send me directly informal inquires luca.turella at unitn.it . -- Luca Turella, PhD Assistant Professor CIMeC - Center for Mind/Brain Sciences University of Trento Mattarello (TN), Via Delle Regole 101 Tel.+39 0461-28 3098 http://www.unitn.it/cimec -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Fri Apr 4 14:27:17 2014 From: julian.keil at gmail.com (Julian Keil) Date: Fri, 4 Apr 2014 14:27:17 +0200 Subject: [FieldTrip] =?iso-8859-1?q?PhD-Position_in_Multisensory_Integrati?= =?iso-8859-1?q?on_=28Charit=E9_Berlin=29?= Message-ID: <758A5578-4860-4834-B8AB-071E74B039A9@gmail.com> The Department of Psychiatry and Psychotherapy, Charité – Universitätsmedizin Berlin invites applications for a PhD position A project grant of the Deutsche Forschungsgemeinschaft (DFG), entitled “Predicting the multisensory future: Role of neuronal connectivity for integrative information processing across modalities“ will fund the currently open position (initially 24 months). The main objective of this project is to examine neural markers of multisensory integration and to test a new hypothesis that considers dynamic interplay of synchronized neural populations as a key to multisensory processes (Senkowski et al. 2008, TINS; Keil et al. 2013, Cerebral Cortex). The studies within this program include EEG, TMS and possibly other neuroimaging methods. Multisensory processes will be examined in a series of experiments requiring both bottom-up and top-down processing. Applicants should have a background in psychology, medicine, biology, physics, engineering, or neuroscience. Basic experience in human EEG or MEG studies, Matlab programming skills, as well as basic German language skills for interacting with the study participants are prerequisites for the position. An interest in neurophysiological studies including clinical populations is expected. Applicants are asked to submit their CV, a motivation letter including information about a possible starting date, 2 names of referees, and documentation of relevant qualifications (e.g., copies of diplomas and/or transcripts of grades) until April 30, 2014, electronically to: julian.keil at charite.de http://psy-ccm.charite.de/en/research/neuroimaging/multisensory_integration/ ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail URL: From Heng-RuMay.Tan at glasgow.ac.uk Fri Apr 4 15:12:04 2014 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Fri, 4 Apr 2014 14:12:04 +0100 Subject: [FieldTrip] MRC-Ph.D. Studentship at University of Glasgow Message-ID: <533EAFA4.9010105@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Fri Apr 4 16:19:11 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Fri, 4 Apr 2014 14:19:11 +0000 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: References: <533E6AB3.3080003@donders.ru.nl>, Message-ID: <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com> Hello All, So once I have calculated the preprocessing data, timelock data, headmodel, lead field and source. I have the following code to create virtual EEG channels of data (similar to the tutorial): % find sensor names and indices chans = ft_channelselection( 'EEG', data.label); chans = match_str( data.label, chans); % compute virtual channels virtual_chans = []; virtual_chans.label = data.label; virtual_chans.time = data.time; virtual_chans.trial = source.avg.filter{ 1} * timelock.trial{ 1}(chans,:); However as I have 642 source.avg.filter, which filter do I chose? Or do I calculate EEG channels for each voxel I landed with (I only had one trial). Btw, the source was calculated with the following code: cfg = []; cfg.method = 'lcmv'; cfg.grid.inside = grid.inside; cfg.grid.outside = []; cfg.vol = vol; cfg.keepfilter = 'yes'; source = ft_sourceanalysis( cfg, timelock); Thankyou for all the help you have provided me thus far. tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of jan-mathijs schoffelen Sent: Friday, 4 April 2014 7:02 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] spatial and temporal ICA after beamformer Hi all, Allow me to chime in here. As I understand it Tyler wants to do ICA on the output of an LCMV beamformer. This is in general allowed, and can be done if you know how to handle the data. In Fieldtrip there is no pre-cooked way of doing it. What you need is to fool ft_componentanalysis into believing that your source reconstructed data is of the type 'raw'. To get started, you can have a look at http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors. In this particular tutorial, only a few 'virtual channels' are created. You probably want many of those, defined on a 3D grid. The only constraint there is probably the amount of RAM on your computer. Note that you want to do (and will do) temporal ICA in this case. Also, note that you probably should pre-PCA your data (this will be a parameter in the specs for the options for the ICA algorithm you are going to use). If you want to apply the ICA algorithm on amplitude envelope timeseries of band-limited activity, rumour has it that the fastica method works quite well. Cheers, Jan-Mathijs On Apr 4, 2014, at 10:17 AM, Jörn M. Horschig wrote: Hi Tyler, sorry, I realized too late that you want to use LCMV on ICA components - mostly because your approach resulted in many different erros ;). Afaik, it is not possible to use beamforming on ICA components. On Wednesday we talked about this in our weekly FieldTrip meeting and identified some occasions where FieldTrip is not handling IC-data well. This can lead to unexpected results and missing warnings or errors. However, you can use dipole modelling (like EEGlab does) or MNE if you want to. These should work with ICs. Any reason why you want to use LCMV on ICs? In theory, both steps constitute a spatial filter, so you can try to be smart and first to LCMV on all your channel level data, and then apply the LCMV spatial filter on the individual backprojected ICs. Somewhat a complicated procedure, but I think it would work? Best, Jörn On 4/4/2014 7:23 AM, Tyler Grummett wrote: Hello fieldtrip, I was wondering whether it was possible in the fieldtrip toolbox to run a spatial and temporal ICA on data after it has been run through ft_sourceanalysis (We can a LCMV beamformer on EEG data that had been timelocked). Currently it is saying that I need raw data for it to be processed. Tyler ************************* /Tyler Grummett ( BBSc, BSc(Hons I))/ /PhD Candidate/ /Brain Signals Laboratory/ /Flinders University/ /Rm 5A301/ /Ext 66124/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Fri Apr 4 17:40:26 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Fri, 4 Apr 2014 15:40:26 +0000 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com> References: <533E6AB3.3080003@donders.ru.nl>, , <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com> Message-ID: <2E1BAFBE-15C2-46FD-B507-69A274CCB79D@flinders.edu.au> This line was meant to be: virtual_chans.trial = source.avg.filter{ 1} * data.trial{ 1}(chans,:); Tyler > On 5 Apr 2014, at 12:52 am, "Tyler Grummett" wrote: > > virtual_chans.trial = source.avg.filter{ 1} * timelock.trial{ 1}(chans,:); From dave at davebritton.com Fri Apr 4 19:35:09 2014 From: dave at davebritton.com (Dave Britton) Date: Fri, 04 Apr 2014 13:35:09 -0400 Subject: [FieldTrip] grandaveraging EEG question Message-ID: <533EED4D.1070904@davebritton.com> I have EEG data that consist of two separate file sets for each subject, and 20 subjects. When I process this to get ERPs for various conditions, does it matter if I just use ft_appenddata to concatenate all 40 files together and then run ft_timelockanalysis on the result, or should I use ft_grandaverage to combine the two runs for each subject, using the "within" parameter" and then combine the 20 resulting grandaverages with another call to ft_grandaverage using the "between parameter? -Dave From jm.horschig at donders.ru.nl Sat Apr 5 10:51:38 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Sat, 05 Apr 2014 10:51:38 +0200 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com> References: <533E6AB3.3080003@donders.ru.nl>, <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com> Message-ID: <533FC41A.8060309@donders.ru.nl> Hi Tyler, > However as I have 642 source.avg.filter, which filter do I chose? Or > do I calculate EEG channels for each voxel I landed with (I only had > one trial). Yep, you will (should) get 642 virtual channels, where each of these virtual channels correspond to the activity at the grid-point you specified when computing the spatial filter. Best, Jörn On 4/4/2014 4:19 PM, Tyler Grummett wrote: > > Hello All, > > > So once I have calculated the preprocessing data, timelock data, > headmodel, lead field and source. > > > I have the following code to create virtual EEG channels of data > (similar to the tutorial): > > % find sensor names and indices > chans = ft_channelselection( 'EEG', data.label); > chans = match_str( data.label, chans); > % compute virtual channels > virtual_chans = []; > virtual_chans.label = data.label; > virtual_chans.time = data.time; > virtual_chans.trial = source.avg.filter{ 1} * > timelock.trial{ 1}(chans,:); > > However as I have 642 source.avg.filter, which filter do I chose? Or > do I calculate EEG channels for each voxel I landed with (I only had > one trial). > > Btw, the source was calculated with the following code: > > ** > cfg = []; > cfg.method = 'lcmv'; > cfg.grid.inside = grid.inside; > cfg.grid.outside = []; > cfg.vol = vol; > cfg.keepfilter = 'yes'; > source = ft_sourceanalysis( cfg, timelock); > > Thankyou for all the help you have provided me thus far. > > tyler > > > > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > ------------------------------------------------------------------------ > *From:* fieldtrip-bounces at science.ru.nl > on behalf of jan-mathijs schoffelen > > *Sent:* Friday, 4 April 2014 7:02 PM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] spatial and temporal ICA after beamformer > Hi all, > > Allow me to chime in here. As I understand it Tyler wants to do ICA on > the output of an LCMV beamformer. This is in general allowed, and can > be done if you know how to handle the data. In Fieldtrip there is no > pre-cooked way of doing it. What you need is to fool > ft_componentanalysis into believing that your source reconstructed > data is of the type 'raw'. To get started, you can have a look at > http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors. In this > particular tutorial, only a few 'virtual channels' are created. You > probably want many of those, defined on a 3D grid. The only constraint > there is probably the amount of RAM on your computer. Note that you > want to do (and will do) temporal ICA in this case. Also, note that > you probably should pre-PCA your data (this will be a parameter in the > specs for the options for the ICA algorithm you are going to use). If > you want to apply the ICA algorithm on amplitude envelope timeseries > of band-limited activity, rumour has it that the fastica method works > quite well. > > Cheers, > Jan-Mathijs > > On Apr 4, 2014, at 10:17 AM, Jörn M. Horschig wrote: > >> Hi Tyler, >> >> sorry, I realized too late that you want to use LCMV on ICA >> components - mostly because your approach resulted in many different >> erros ;). Afaik, it is not possible to use beamforming on ICA >> components. On Wednesday we talked about this in our weekly FieldTrip >> meeting and identified some occasions where FieldTrip is not handling >> IC-data well. This can lead to unexpected results and missing >> warnings or errors. However, you can use dipole modelling (like >> EEGlab does) or MNE if you want to. These should work with ICs. >> >> Any reason why you want to use LCMV on ICs? In theory, both steps >> constitute a spatial filter, so you can try to be smart and first to >> LCMV on all your channel level data, and then apply the LCMV spatial >> filter on the individual backprojected ICs. Somewhat a complicated >> procedure, but I think it would work? >> >> Best, >> Jörn >> >> >> >> On 4/4/2014 7:23 AM, Tyler Grummett wrote: >>> >>> Hello fieldtrip, >>> >>> >>> I was wondering whether it was possible in the fieldtrip toolbox to >>> run a spatial and temporal ICA on data after it has been run through >>> ft_sourceanalysis (We can a LCMV beamformer on EEG data that had >>> been timelocked). >>> >>> >>> Currently it is saying that I need raw data for it to be processed. >>> >>> >>> Tyler >>> >>> >>> ************************* >>> >>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>> /PhD Candidate/ >>> /Brain Signals Laboratory/ >>> /Flinders University/ >>> /Rm 5A301/ >>> /Ext 66124/ >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From j.herring at fcdonders.ru.nl Sat Apr 5 22:20:53 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Sat, 5 Apr 2014 22:20:53 +0200 (CEST) Subject: [FieldTrip] grandaveraging EEG question In-Reply-To: <533EED4D.1070904@davebritton.com> References: <533EED4D.1070904@davebritton.com> Message-ID: Hi Dave, I would read in, and preprocess, the two files per subject and run ft_appenddata to combine the data from both files. Then I would run ft_timelockanalysis to get the erps for each condition. As soon as you have done this for all subjects, run ft_timelockgrandaverage to get the group averaged erps. Best, Jim > On 4 apr. 2014, at 19:38, Dave Britton wrote: > > I have EEG data that consist of two separate file sets for each subject, and 20 subjects. When I process this to get ERPs for various conditions, does it matter if I just use ft_appenddata to concatenate all 40 files together and then run ft_timelockanalysis on the result, or should I use ft_grandaverage to combine the two runs for each subject, using the "within" parameter" and then combine the 20 resulting grandaverages with another call to ft_grandaverage using the "between parameter? > -Dave > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tyler.grummett at flinders.edu.au Sun Apr 6 07:43:25 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Sun, 6 Apr 2014 05:43:25 +0000 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: <533FC41A.8060309@donders.ru.nl> References: <533E6AB3.3080003@donders.ru.nl>, <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com>, <533FC41A.8060309@donders.ru.nl> Message-ID: <99348662ba6848c587a589caa50167d4@SIXPR03MB368.apcprd03.prod.outlook.com> Hi Jorn, I think the fundamental issue with this is that the spatial filter has three dimensions, each corresponding to either x y or z. I must admit I am confused at this point, because I dont know whether to choose x, y or z or somehow combine them or have them as additional channels. >> source_inside.avg.filter ans = [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] etc.... Currently I am chosing only the first dimension ie source_inside.avg.filter{ 1}( 1, :) and then multiplying that by the data. for j = 1:numel( source_inside.avg.filter), temp{ j} = source_inside.avg.filter{ j}( 1, :) * data.trial{ 1}(chans,:); virtual_chans.trial( j, :) = temp{ j}; end to end up with: virtual_chans = label: {1x642 cell} time: {[1x19767 double]} trial: [642x19767 double] Like I said, I dont know what to with the 2nd and 3rd dimension filters. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" Sent: Saturday, 5 April 2014 7:21 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] spatial and temporal ICA after beamformer Hi Tyler, > However as I have 642 source.avg.filter, which filter do I chose? Or > do I calculate EEG channels for each voxel I landed with (I only had > one trial). Yep, you will (should) get 642 virtual channels, where each of these virtual channels correspond to the activity at the grid-point you specified when computing the spatial filter. Best, Jörn On 4/4/2014 4:19 PM, Tyler Grummett wrote: > > Hello All, > > > So once I have calculated the preprocessing data, timelock data, > headmodel, lead field and source. > > > I have the following code to create virtual EEG channels of data > (similar to the tutorial): > > % find sensor names and indices > chans = ft_channelselection( 'EEG', data.label); > chans = match_str( data.label, chans); > % compute virtual channels > virtual_chans = []; > virtual_chans.label = data.label; > virtual_chans.time = data.time; > virtual_chans.trial = source.avg.filter{ 1} * > timelock.trial{ 1}(chans,:); > > However as I have 642 source.avg.filter, which filter do I chose? Or > do I calculate EEG channels for each voxel I landed with (I only had > one trial). > > Btw, the source was calculated with the following code: > > ** > cfg = []; > cfg.method = 'lcmv'; > cfg.grid.inside = grid.inside; > cfg.grid.outside = []; > cfg.vol = vol; > cfg.keepfilter = 'yes'; > source = ft_sourceanalysis( cfg, timelock); > > Thankyou for all the help you have provided me thus far. > > tyler > > > > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > ------------------------------------------------------------------------ > *From:* fieldtrip-bounces at science.ru.nl > on behalf of jan-mathijs schoffelen > > *Sent:* Friday, 4 April 2014 7:02 PM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] spatial and temporal ICA after beamformer > Hi all, > > Allow me to chime in here. As I understand it Tyler wants to do ICA on > the output of an LCMV beamformer. This is in general allowed, and can > be done if you know how to handle the data. In Fieldtrip there is no > pre-cooked way of doing it. What you need is to fool > ft_componentanalysis into believing that your source reconstructed > data is of the type 'raw'. To get started, you can have a look at > http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors. In this > particular tutorial, only a few 'virtual channels' are created. You > probably want many of those, defined on a 3D grid. The only constraint > there is probably the amount of RAM on your computer. Note that you > want to do (and will do) temporal ICA in this case. Also, note that > you probably should pre-PCA your data (this will be a parameter in the > specs for the options for the ICA algorithm you are going to use). If > you want to apply the ICA algorithm on amplitude envelope timeseries > of band-limited activity, rumour has it that the fastica method works > quite well. > > Cheers, > Jan-Mathijs > > On Apr 4, 2014, at 10:17 AM, Jörn M. Horschig wrote: > >> Hi Tyler, >> >> sorry, I realized too late that you want to use LCMV on ICA >> components - mostly because your approach resulted in many different >> erros ;). Afaik, it is not possible to use beamforming on ICA >> components. On Wednesday we talked about this in our weekly FieldTrip >> meeting and identified some occasions where FieldTrip is not handling >> IC-data well. This can lead to unexpected results and missing >> warnings or errors. However, you can use dipole modelling (like >> EEGlab does) or MNE if you want to. These should work with ICs. >> >> Any reason why you want to use LCMV on ICs? In theory, both steps >> constitute a spatial filter, so you can try to be smart and first to >> LCMV on all your channel level data, and then apply the LCMV spatial >> filter on the individual backprojected ICs. Somewhat a complicated >> procedure, but I think it would work? >> >> Best, >> Jörn >> >> >> >> On 4/4/2014 7:23 AM, Tyler Grummett wrote: >>> >>> Hello fieldtrip, >>> >>> >>> I was wondering whether it was possible in the fieldtrip toolbox to >>> run a spatial and temporal ICA on data after it has been run through >>> ft_sourceanalysis (We can a LCMV beamformer on EEG data that had >>> been timelocked). >>> >>> >>> Currently it is saying that I need raw data for it to be processed. >>> >>> >>> Tyler >>> >>> >>> ************************* >>> >>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>> /PhD Candidate/ >>> /Brain Signals Laboratory/ >>> /Flinders University/ >>> /Rm 5A301/ >>> /Ext 66124/ >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From haiteng.jiang at gmail.com Sun Apr 6 09:54:38 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Sun, 6 Apr 2014 09:54:38 +0200 Subject: [FieldTrip] denoising data Message-ID: Hi Fred , This is an interesting/smart pipeline. However, I don't think it is proper to use EEG VEOG/ECG channel as reference on the IC component. The argument is that character of artifact components in EEG and MEG are different though similar . Best, Haiteng > > > > > Hi Ana, Haiteng and everyone else, > > I am joining in on this discussion as I am thinking about a way of > combining > ft_componentanalysis with ft_denoise_pca to remove EOG, ECG and EMG > activity. > > The pipeline that I would like to try is the following: > > %% ICA decomposition > cfg = []; > cfg.method = 'runica'; > > ICs = ft_componentanalysis(cfg,meg_data); % here meg_data has undergone > basic preprocessing including bp-filtering as well as > & ft_artifact_jump and > ft_artifact_clip > %% Substract artifacts from ICA components > cfg = []; > cfg.refchannel = eeg_data.label(1); % eeg_data contains the EOG (1-2), > ECG(3) and EMG(4) ref-channels > cfg.channel = {'runica'}; > cfg.zscore = 'yes'; > cfg.pertrial = 'yes'; > cfg.trials = 'all'; > > [ICs] = ft_denoise_pca(cfg,ICs,eeg_data); % substract VEOG activity from > all ICs > %% > > The idea is to repeat this step for all refchannels in order to substract > the artifacts. > > Then backproject ICs to original data: > > %% Backproject data > cfg = []; > meg_data = ft_rejectcomponent(cfg,ICs,meg_data); > > The advantage is that you don't have to "throw away" the entire component > as sometimes ICs > contain a mix of artifacts and brain activity. So by regressing out the > artifacts, you could > avoid throwing away the good stuff. > > However, I don't know if this is a good approach. There may be pitfalls > that I am not thinking > of right now. > Therefore any suggestions or comments about whether this is a good idea > would be very welcome! > I am hoping that some of the ft_guru's could drop a line or two about this! > > Fred > > > ----- Original Message ----- > From: "Haiteng Jiang" > To: fieldtrip at science.ru.nl > Sent: Thursday, April 3, 2014 8:27:30 AM > Subject: Re: [FieldTrip] denoising data > > > > > > > > Dear Ana, > > > If I understand correctly , we use ft_denoise_synthetic and ft_denoise_pca > to reduce noise due to recording (e.g. environment noise , thermal noise... > ) not the brain signal artefact (e.g eye blink). Normally ,I use these two > functions in the very early stage . > > Best, > Haiteng > > > > Message: 5 > Date: Thu, 3 Apr 2014 00:54:42 +0200 (CEST) > From: "Todorovic, A." < a.todorovic at fcdonders.ru.nl > > To: FieldTrip List < fieldtrip at donders.ru.nl > > Subject: [FieldTrip] denoising data > Message-ID: > < 124252612.215995.1396479282885.JavaMail.root at monoceros.zimbra.ru.nl > > Content-Type: text/plain; charset=utf-8 > > Dear 'trippers, > > I'm curious to hear your thoughts on how to best denoise data. What I'm > doing is working, but I'd like to hear whether it's logical or reasonable. > > In particular, I have two issues. One is that I use ICA to remove blinks, > so I have to fit denoising into a pipeline that incorporates ICA (which, I > am guessing, works well only without including reference channels). > > The other is that I see there are two functions for denoising, > ft_denoise_synthetic and ft_denoise_pca. > > In sum (1) I'm not really sure WHEN the best moment for denoising is, > given that I use ICA, and (2) I don't understand when it's better to use > ft_denoise_synthetic and when ft_denoise_pca. I do see that ft_denoise_pca > has the option of preprocessing reference channels separately, which makes > it easier to use after ICA. > > I used to know only about the first function, and my solution was to do > ft_denoise_synthetic (using the 'G3BR' option) prior to the ICA. Then I > would remove components which contain artifacts, and continue with making > ERF/TFRs/whatever. This produces data that is somewhat cleaner than when I > skip the denoising step. > > I was curious about the ft_denoise_pca when I saw it, so I tried running > it on filtered, preprocessed data that I had after I rejected ICA > components. [In the process of doing ICA, I used the ft_denoise_synthetic > option, as above.] This produced a different TFR at the end of the road, > which again looked cleaner. Significantly cleaner, actually, but N=1. > > Now I'm not sure if it was a logical step to use both denoising functions, > and if it would have been a better idea to do things differently. I'd like > to hear both whether something in the logic is wrong, and whether it's > inelegant. > > Cheers, > Ana > > > > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From sarathykousik at gmail.com Sun Apr 6 11:09:24 2014 From: sarathykousik at gmail.com (kousik sarathy) Date: Sun, 6 Apr 2014 11:09:24 +0200 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: <99348662ba6848c587a589caa50167d4@SIXPR03MB368.apcprd03.prod.outlook.com> References: <533E6AB3.3080003@donders.ru.nl> <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com> <533FC41A.8060309@donders.ru.nl> <99348662ba6848c587a589caa50167d4@SIXPR03MB368.apcprd03.prod.outlook.com> Message-ID: Hey Tyler, Check out the "Computation of virtual MEG channels in source-space" in this page (http://fieldtrip.fcdonders.nl/tutorial/connectivityextended). It gives some hints on what x-y-z components are, how to collapse it and use the filters. -- Regards, Kousik Sarathy, S On Sun, Apr 6, 2014 at 7:43 AM, Tyler Grummett < tyler.grummett at flinders.edu.au> wrote: > Hi Jorn, > > I think the fundamental issue with this is that the spatial filter has > three dimensions, each corresponding to either x y or z. > > I must admit I am confused at this point, because I dont know whether to > choose x, y or z or somehow combine them or have them as additional > channels. > > >> source_inside.avg.filter > > ans = > > [3x123 double] > [3x123 double] > [3x123 double] > [3x123 double] > [3x123 double] > [3x123 double] > [3x123 double] > [3x123 double] > [3x123 double] > [3x123 double] > etc.... > > Currently I am chosing only the first dimension ie > source_inside.avg.filter{ 1}( 1, :) and then multiplying that by the data. > > for j = 1:numel( source_inside.avg.filter), > temp{ j} = source_inside.avg.filter{ j}( 1, :) * > data.trial{ 1}(chans,:); > virtual_chans.trial( j, :) = temp{ j}; > end > > to end up with: > > virtual_chans = > > label: {1x642 cell} > time: {[1x19767 double]} > trial: [642x19767 double] > > Like I said, I dont know what to with the 2nd and 3rd dimension filters. > > Tyler > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl > on behalf of "Jörn M. Horschig" > Sent: Saturday, 5 April 2014 7:21 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] spatial and temporal ICA after beamformer > > Hi Tyler, > > > However as I have 642 source.avg.filter, which filter do I chose? Or > > do I calculate EEG channels for each voxel I landed with (I only had > > one trial). > > Yep, you will (should) get 642 virtual channels, where each of these > virtual channels correspond to the activity at the grid-point you > specified when computing the spatial filter. > > > Best, > Jörn > > > On 4/4/2014 4:19 PM, Tyler Grummett wrote: > > > > Hello All, > > > > > > So once I have calculated the preprocessing data, timelock data, > > headmodel, lead field and source. > > > > > > I have the following code to create virtual EEG channels of data > > (similar to the tutorial): > > > > % find sensor names and indices > > chans = ft_channelselection( 'EEG', data.label); > > chans = match_str( data.label, chans); > > % compute virtual channels > > virtual_chans = []; > > virtual_chans.label = data.label; > > virtual_chans.time = data.time; > > virtual_chans.trial = source.avg.filter{ 1} * > > timelock.trial{ 1}(chans,:); > > > > However as I have 642 source.avg.filter, which filter do I chose? Or > > do I calculate EEG channels for each voxel I landed with (I only had > > one trial). > > > > Btw, the source was calculated with the following code: > > > > ** > > cfg = []; > > cfg.method = 'lcmv'; > > cfg.grid.inside = grid.inside; > > cfg.grid.outside = []; > > cfg.vol = vol; > > cfg.keepfilter = 'yes'; > > source = ft_sourceanalysis( cfg, timelock); > > > > Thankyou for all the help you have provided me thus far. > > > > tyler > > > > > > > > > > > > ************************* > > > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > > /PhD Candidate/ > > /Brain Signals Laboratory/ > > /Flinders University/ > > /Rm 5A301/ > > /Ext 66124/ > > ------------------------------------------------------------------------ > > *From:* fieldtrip-bounces at science.ru.nl > > on behalf of jan-mathijs schoffelen > > > > *Sent:* Friday, 4 April 2014 7:02 PM > > *To:* FieldTrip discussion list > > *Subject:* Re: [FieldTrip] spatial and temporal ICA after beamformer > > Hi all, > > > > Allow me to chime in here. As I understand it Tyler wants to do ICA on > > the output of an LCMV beamformer. This is in general allowed, and can > > be done if you know how to handle the data. In Fieldtrip there is no > > pre-cooked way of doing it. What you need is to fool > > ft_componentanalysis into believing that your source reconstructed > > data is of the type 'raw'. To get started, you can have a look at > > http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors. In this > > particular tutorial, only a few 'virtual channels' are created. You > > probably want many of those, defined on a 3D grid. The only constraint > > there is probably the amount of RAM on your computer. Note that you > > want to do (and will do) temporal ICA in this case. Also, note that > > you probably should pre-PCA your data (this will be a parameter in the > > specs for the options for the ICA algorithm you are going to use). If > > you want to apply the ICA algorithm on amplitude envelope timeseries > > of band-limited activity, rumour has it that the fastica method works > > quite well. > > > > Cheers, > > Jan-Mathijs > > > > On Apr 4, 2014, at 10:17 AM, Jörn M. Horschig wrote: > > > >> Hi Tyler, > >> > >> sorry, I realized too late that you want to use LCMV on ICA > >> components - mostly because your approach resulted in many different > >> erros ;). Afaik, it is not possible to use beamforming on ICA > >> components. On Wednesday we talked about this in our weekly FieldTrip > >> meeting and identified some occasions where FieldTrip is not handling > >> IC-data well. This can lead to unexpected results and missing > >> warnings or errors. However, you can use dipole modelling (like > >> EEGlab does) or MNE if you want to. These should work with ICs. > >> > >> Any reason why you want to use LCMV on ICs? In theory, both steps > >> constitute a spatial filter, so you can try to be smart and first to > >> LCMV on all your channel level data, and then apply the LCMV spatial > >> filter on the individual backprojected ICs. Somewhat a complicated > >> procedure, but I think it would work? > >> > >> Best, > >> Jörn > >> > >> > >> > >> On 4/4/2014 7:23 AM, Tyler Grummett wrote: > >>> > >>> Hello fieldtrip, > >>> > >>> > >>> I was wondering whether it was possible in the fieldtrip toolbox to > >>> run a spatial and temporal ICA on data after it has been run through > >>> ft_sourceanalysis (We can a LCMV beamformer on EEG data that had > >>> been timelocked). > >>> > >>> > >>> Currently it is saying that I need raw data for it to be processed. > >>> > >>> > >>> Tyler > >>> > >>> > >>> ************************* > >>> > >>> /Tyler Grummett ( BBSc, BSc(Hons I))/ > >>> /PhD Candidate/ > >>> /Brain Signals Laboratory/ > >>> /Flinders University/ > >>> /Rm 5A301/ > >>> /Ext 66124/ > >>> > >>> > >>> _______________________________________________ > >>> fieldtrip mailing list > >>> fieldtrip at donders.ru.nl > >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> > >> -- > >> Jörn M. Horschig > >> PhD Student > >> Donders Institute for Brain, Cognition and Behaviour > >> Centre for Cognitive Neuroimaging > >> Radboud University Nijmegen > >> Neuronal Oscillations Group > >> FieldTrip Development Team > >> > >> P.O. Box 9101 > >> NL-6500 HB Nijmegen > >> The Netherlands > >> > >> Contact: > >> E-Mail: jm.horschig at donders.ru.nl > >> Tel: +31-(0)24-36-68493 > >> Web: http://www.ru.nl/donders > >> > >> Visiting address: > >> Trigon, room 2.30 > >> Kapittelweg 29 > >> NL-6525 EN Nijmegen > >> The Netherlands > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > Jan-Mathijs Schoffelen, MD PhD > > > > Donders Institute for Brain, Cognition and Behaviour, > > Centre for Cognitive Neuroimaging, > > Radboud University Nijmegen, The Netherlands > > > > Max Planck Institute for Psycholinguistics, > > Nijmegen, The Netherlands > > > > J.Schoffelen at donders.ru.nl > > Telephone: +31-24-3614793 > > > > http://www.hettaligebrein.nl > > > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Sun Apr 6 22:01:49 2014 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Sun, 6 Apr 2014 16:01:49 -0400 Subject: [FieldTrip] grandaveraging EEG question In-Reply-To: References: <533EED4D.1070904@davebritton.com> Message-ID: <32A64FF3-34C1-4260-B21E-E917E725B239@gmail.com> Hi Dave I would think that appending the data would weigh each subject by the number of trials, something that isn't done when we use timelock_grandaverage. Best, Raquel Sent from my iPhone > On Apr 5, 2014, at 4:20 PM, "Herring, J.D. (Jim)" wrote: > > Hi Dave, > > I would read in, and preprocess, the two files per subject and run ft_appenddata to combine the data from both files. Then I would run ft_timelockanalysis to get the erps for each condition. As soon as you have done this for all subjects, run ft_timelockgrandaverage to get the group averaged erps. > > Best, > > Jim > >> On 4 apr. 2014, at 19:38, Dave Britton wrote: >> >> I have EEG data that consist of two separate file sets for each subject, and 20 subjects. When I process this to get ERPs for various conditions, does it matter if I just use ft_appenddata to concatenate all 40 files together and then run ft_timelockanalysis on the result, or should I use ft_grandaverage to combine the two runs for each subject, using the "within" parameter" and then combine the 20 resulting grandaverages with another call to ft_grandaverage using the "between parameter? >> -Dave >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tyler.grummett at flinders.edu.au Mon Apr 7 02:18:28 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 7 Apr 2014 00:18:28 +0000 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: References: <533E6AB3.3080003@donders.ru.nl> <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com> <533FC41A.8060309@donders.ru.nl> <99348662ba6848c587a589caa50167d4@SIXPR03MB368.apcprd03.prod.outlook.com>, Message-ID: <4e7e440fb27846349d7033f7201328ce@SINPR03MB361.apcprd03.prod.outlook.com> ​Dear Kousik, Thank you very much, I was leading up to that tutorial but I didnt know that the information I was looking for was in it! Regards, Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of kousik sarathy Sent: Sunday, 6 April 2014 6:39 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] spatial and temporal ICA after beamformer Hey Tyler, Check out the "Computation of virtual MEG channels in source-space" in this page (http://fieldtrip.fcdonders.nl/tutorial/connectivityextended). It gives some hints on what x-y-z components are, how to collapse it and use the filters. -- Regards, Kousik Sarathy, S On Sun, Apr 6, 2014 at 7:43 AM, Tyler Grummett > wrote: Hi Jorn, I think the fundamental issue with this is that the spatial filter has three dimensions, each corresponding to either x y or z. I must admit I am confused at this point, because I dont know whether to choose x, y or z or somehow combine them or have them as additional channels. >> source_inside.avg.filter ans = [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] etc.... Currently I am chosing only the first dimension ie source_inside.avg.filter{ 1}( 1, :) and then multiplying that by the data. for j = 1:numel( source_inside.avg.filter), temp{ j} = source_inside.avg.filter{ j}( 1, :) * data.trial{ 1}(chans,:); virtual_chans.trial( j, :) = temp{ j}; end to end up with: virtual_chans = label: {1x642 cell} time: {[1x19767 double]} trial: [642x19767 double] Like I said, I dont know what to with the 2nd and 3rd dimension filters. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl > on behalf of "Jörn M. Horschig" > Sent: Saturday, 5 April 2014 7:21 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] spatial and temporal ICA after beamformer Hi Tyler, > However as I have 642 source.avg.filter, which filter do I chose? Or > do I calculate EEG channels for each voxel I landed with (I only had > one trial). Yep, you will (should) get 642 virtual channels, where each of these virtual channels correspond to the activity at the grid-point you specified when computing the spatial filter. Best, Jörn On 4/4/2014 4:19 PM, Tyler Grummett wrote: > > Hello All, > > > So once I have calculated the preprocessing data, timelock data, > headmodel, lead field and source. > > > I have the following code to create virtual EEG channels of data > (similar to the tutorial): > > % find sensor names and indices > chans = ft_channelselection( 'EEG', data.label); > chans = match_str( data.label, chans); > % compute virtual channels > virtual_chans = []; > virtual_chans.label = data.label; > virtual_chans.time = data.time; > virtual_chans.trial = source.avg.filter{ 1} * > timelock.trial{ 1}(chans,:); > > However as I have 642 source.avg.filter, which filter do I chose? Or > do I calculate EEG channels for each voxel I landed with (I only had > one trial). > > Btw, the source was calculated with the following code: > > ** > cfg = []; > cfg.method = 'lcmv'; > cfg.grid.inside = grid.inside; > cfg.grid.outside = []; > cfg.vol = vol; > cfg.keepfilter = 'yes'; > source = ft_sourceanalysis( cfg, timelock); > > Thankyou for all the help you have provided me thus far. > > tyler > > > > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > ------------------------------------------------------------------------ > *From:* fieldtrip-bounces at science.ru.nl > > on behalf of jan-mathijs schoffelen > > > *Sent:* Friday, 4 April 2014 7:02 PM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] spatial and temporal ICA after beamformer > Hi all, > > Allow me to chime in here. As I understand it Tyler wants to do ICA on > the output of an LCMV beamformer. This is in general allowed, and can > be done if you know how to handle the data. In Fieldtrip there is no > pre-cooked way of doing it. What you need is to fool > ft_componentanalysis into believing that your source reconstructed > data is of the type 'raw'. To get started, you can have a look at > http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors. In this > particular tutorial, only a few 'virtual channels' are created. You > probably want many of those, defined on a 3D grid. The only constraint > there is probably the amount of RAM on your computer. Note that you > want to do (and will do) temporal ICA in this case. Also, note that > you probably should pre-PCA your data (this will be a parameter in the > specs for the options for the ICA algorithm you are going to use). If > you want to apply the ICA algorithm on amplitude envelope timeseries > of band-limited activity, rumour has it that the fastica method works > quite well. > > Cheers, > Jan-Mathijs > > On Apr 4, 2014, at 10:17 AM, Jörn M. Horschig wrote: > >> Hi Tyler, >> >> sorry, I realized too late that you want to use LCMV on ICA >> components - mostly because your approach resulted in many different >> erros ;). Afaik, it is not possible to use beamforming on ICA >> components. On Wednesday we talked about this in our weekly FieldTrip >> meeting and identified some occasions where FieldTrip is not handling >> IC-data well. This can lead to unexpected results and missing >> warnings or errors. However, you can use dipole modelling (like >> EEGlab does) or MNE if you want to. These should work with ICs. >> >> Any reason why you want to use LCMV on ICs? In theory, both steps >> constitute a spatial filter, so you can try to be smart and first to >> LCMV on all your channel level data, and then apply the LCMV spatial >> filter on the individual backprojected ICs. Somewhat a complicated >> procedure, but I think it would work? >> >> Best, >> Jörn >> >> >> >> On 4/4/2014 7:23 AM, Tyler Grummett wrote: >>> >>> Hello fieldtrip, >>> >>> >>> I was wondering whether it was possible in the fieldtrip toolbox to >>> run a spatial and temporal ICA on data after it has been run through >>> ft_sourceanalysis (We can a LCMV beamformer on EEG data that had >>> been timelocked). >>> >>> >>> Currently it is saying that I need raw data for it to be processed. >>> >>> >>> Tyler >>> >>> >>> ************************* >>> >>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>> /PhD Candidate/ >>> /Brain Signals Laboratory/ >>> /Flinders University/ >>> /Rm 5A301/ >>> /Ext 66124/ >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl > >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl > >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Mon Apr 7 07:49:23 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 7 Apr 2014 05:49:23 +0000 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: References: <533E6AB3.3080003@donders.ru.nl> <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com> <533FC41A.8060309@donders.ru.nl> <99348662ba6848c587a589caa50167d4@SIXPR03MB368.apcprd03.prod.outlook.com>, Message-ID: Hello all, Im really interested in calculating granger causality using method in connectivity extended (last bit of the document). Specifically, I would like to compute the spectrally resolved granger connectivity. How would one go about doing that? Is it just be cfg = []; cfg.output = 'fourier'; cfg.method = 'mtmfft'; cfg.foilim = [5 100]; cfg.tapsmofrq = 5; cfg.keeptrials = 'yes'; cfg.channel = {'visual' 'motor' 'EMGlft' 'EMGrgt'}; freq = ft_freqanalysis(cfg, combineddata); cfg = []; cfg.method = 'granger'; coherence = ft_connectivityanalysis(cfg, freq); or would you need to calculate multivariate autoregressive coefficients. Because my data keeps crashing when I try to running it. cfg = []; cfg.order = 5; cfg.toolbox = 'bsmart'; mdata = ft_mvaranalysis( cfg, comp);​ With an error of: Index exceeds matrix dimensions. Error in ft_mvaranalysis (line 321) tmpcfg.toilim = [timeaxis(sample-floor(tfwin/2)) timeaxis(sample+ceil(tfwin/2)-1)];​ Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of kousik sarathy Sent: Sunday, 6 April 2014 6:39 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] spatial and temporal ICA after beamformer Hey Tyler, Check out the "Computation of virtual MEG channels in source-space" in this page (http://fieldtrip.fcdonders.nl/tutorial/connectivityextended). It gives some hints on what x-y-z components are, how to collapse it and use the filters. -- Regards, Kousik Sarathy, S On Sun, Apr 6, 2014 at 7:43 AM, Tyler Grummett > wrote: Hi Jorn, I think the fundamental issue with this is that the spatial filter has three dimensions, each corresponding to either x y or z. I must admit I am confused at this point, because I dont know whether to choose x, y or z or somehow combine them or have them as additional channels. >> source_inside.avg.filter ans = [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] etc.... Currently I am chosing only the first dimension ie source_inside.avg.filter{ 1}( 1, :) and then multiplying that by the data. for j = 1:numel( source_inside.avg.filter), temp{ j} = source_inside.avg.filter{ j}( 1, :) * data.trial{ 1}(chans,:); virtual_chans.trial( j, :) = temp{ j}; end to end up with: virtual_chans = label: {1x642 cell} time: {[1x19767 double]} trial: [642x19767 double] Like I said, I dont know what to with the 2nd and 3rd dimension filters. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl > on behalf of "Jörn M. Horschig" > Sent: Saturday, 5 April 2014 7:21 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] spatial and temporal ICA after beamformer Hi Tyler, > However as I have 642 source.avg.filter, which filter do I chose? Or > do I calculate EEG channels for each voxel I landed with (I only had > one trial). Yep, you will (should) get 642 virtual channels, where each of these virtual channels correspond to the activity at the grid-point you specified when computing the spatial filter. Best, Jörn On 4/4/2014 4:19 PM, Tyler Grummett wrote: > > Hello All, > > > So once I have calculated the preprocessing data, timelock data, > headmodel, lead field and source. > > > I have the following code to create virtual EEG channels of data > (similar to the tutorial): > > % find sensor names and indices > chans = ft_channelselection( 'EEG', data.label); > chans = match_str( data.label, chans); > % compute virtual channels > virtual_chans = []; > virtual_chans.label = data.label; > virtual_chans.time = data.time; > virtual_chans.trial = source.avg.filter{ 1} * > timelock.trial{ 1}(chans,:); > > However as I have 642 source.avg.filter, which filter do I chose? Or > do I calculate EEG channels for each voxel I landed with (I only had > one trial). > > Btw, the source was calculated with the following code: > > ** > cfg = []; > cfg.method = 'lcmv'; > cfg.grid.inside = grid.inside; > cfg.grid.outside = []; > cfg.vol = vol; > cfg.keepfilter = 'yes'; > source = ft_sourceanalysis( cfg, timelock); > > Thankyou for all the help you have provided me thus far. > > tyler > > > > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > ------------------------------------------------------------------------ > *From:* fieldtrip-bounces at science.ru.nl > > on behalf of jan-mathijs schoffelen > > > *Sent:* Friday, 4 April 2014 7:02 PM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] spatial and temporal ICA after beamformer > Hi all, > > Allow me to chime in here. As I understand it Tyler wants to do ICA on > the output of an LCMV beamformer. This is in general allowed, and can > be done if you know how to handle the data. In Fieldtrip there is no > pre-cooked way of doing it. What you need is to fool > ft_componentanalysis into believing that your source reconstructed > data is of the type 'raw'. To get started, you can have a look at > http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors. In this > particular tutorial, only a few 'virtual channels' are created. You > probably want many of those, defined on a 3D grid. The only constraint > there is probably the amount of RAM on your computer. Note that you > want to do (and will do) temporal ICA in this case. Also, note that > you probably should pre-PCA your data (this will be a parameter in the > specs for the options for the ICA algorithm you are going to use). If > you want to apply the ICA algorithm on amplitude envelope timeseries > of band-limited activity, rumour has it that the fastica method works > quite well. > > Cheers, > Jan-Mathijs > > On Apr 4, 2014, at 10:17 AM, Jörn M. Horschig wrote: > >> Hi Tyler, >> >> sorry, I realized too late that you want to use LCMV on ICA >> components - mostly because your approach resulted in many different >> erros ;). Afaik, it is not possible to use beamforming on ICA >> components. On Wednesday we talked about this in our weekly FieldTrip >> meeting and identified some occasions where FieldTrip is not handling >> IC-data well. This can lead to unexpected results and missing >> warnings or errors. However, you can use dipole modelling (like >> EEGlab does) or MNE if you want to. These should work with ICs. >> >> Any reason why you want to use LCMV on ICs? In theory, both steps >> constitute a spatial filter, so you can try to be smart and first to >> LCMV on all your channel level data, and then apply the LCMV spatial >> filter on the individual backprojected ICs. Somewhat a complicated >> procedure, but I think it would work? >> >> Best, >> Jörn >> >> >> >> On 4/4/2014 7:23 AM, Tyler Grummett wrote: >>> >>> Hello fieldtrip, >>> >>> >>> I was wondering whether it was possible in the fieldtrip toolbox to >>> run a spatial and temporal ICA on data after it has been run through >>> ft_sourceanalysis (We can a LCMV beamformer on EEG data that had >>> been timelocked). >>> >>> >>> Currently it is saying that I need raw data for it to be processed. >>> >>> >>> Tyler >>> >>> >>> ************************* >>> >>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>> /PhD Candidate/ >>> /Brain Signals Laboratory/ >>> /Flinders University/ >>> /Rm 5A301/ >>> /Ext 66124/ >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl > >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl > >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From lmelloni at gmail.com Mon Apr 7 12:45:22 2014 From: lmelloni at gmail.com (Lucia Melloni) Date: Mon, 7 Apr 2014 06:45:22 -0400 Subject: [FieldTrip] Applications open for the Neurobiology of Cognition GRC/GRS! In-Reply-To: References: Message-ID: Dear colleague, Applications are now open for the Gordon Research Seminar (GRS) and Conference (GRC) on the Neurobiology of Cognition to be held from the 19-20 July (Seminar) and 20-25 July (Conference), 2014. Space is limited. Don't forger to apply soon! Looking forward to seeing you at the GRS/GRC! Lucia Melloni. Ayelet A. Landau [image: Gordon Research Conferences] Join us at the 2014 *Gordon Conference* and *Seminar* On *Neurobiology of Cognition* Circuits, Dynamics, Action and Perception We are meeting *July 20-25, 2014 -*New GRC site: *Sunday River Resort* Newry, Maine Click *here*to see the *GRC* program. There is also an associated *GRS* *July 19-20 *for students and postdocs Click *here*to see the *GRS* website. *GRS* application & abstract deadline to be considered for oral presentation- *April 30* *Please use attached **flyer **to help spread the word! * The Neurobiology of Cognition is a recently-inaugurated GRC designed to foster convergence of traditional neuroscience investigations with more recent developments in systems, cellular and molecular neurobiology, in engineering and imaging and in computational sciences. Cognition is construed broadly to embrace empirical findings in a range of species including humans, and there is a strong focus on integration of findings and principles across species and levels of analysis. In the opening Keynote Session, two leading neuroscientists with provide an experimental and computational perspective on the recent initiative, termed Brain Research through Advancing Innovative Neurotechnologies (BRAIN). This initiative, spearheaded by the President and NIH, is aimed at developing innovative methodologies to study how complex systems of neurons interact in time and in space during complex behaviors. Along with recent findings in a few traditional "core" areas, formal sessions will then explore several new themes, including: 1) the neuroanatomy and 2) coordination of cognitive circuits in the brain, 3) motor cognition and brain-computer interfaces, 4) music and language, and 5) learning and plasticity. The program juxtaposes human psychophysical, neuroimaging and electrophysiological studies with parallel investigations in rodents and non-human primates, and with computational approaches that explicate empirical findings and construct robust, detailed models to represent the developing picture and guide future experimentation. The program also underscores novel experimental and theoretical approaches that promise to define fundamental principles that guide and integrate the understanding of cognition at a fundamental level, and to extend these to improved treatment of brain dysfunction. The format of the meeting promotes intensive interactions among investigators and trainees from different perspectives and analytic levels, and in particular, between experimentalists and theorists. There is a linked Gordon Research Seminar for trainees, most of whom also attend the GRC. All that is missing now is your *application* to attend. Click *here*for the *GRC*. Click* here*for the *GRS*. (You must apply to both to attend both.) Best regards, GRC Chair: *Charles E. Schroeder* GRC V. Chair:*Tatiana Pasternak* GRS Chair: *Lucia Melloni* GRS Assoc. Chair: *Ayelet N. Landau* *Apply* now and see why our attendees consistently rate GRCs "the best conference I've attended this year"! [image: Like us on Facebook] [image: Follow us on Twitter] [image: View our profile on LinkedIn] *Forward this email * -- -- Lucia. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Tue Apr 8 04:48:08 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 8 Apr 2014 02:48:08 +0000 Subject: [FieldTrip] ft_sourceanalysis using LCMV beamformer and grid from ft_prepare_leadfield Message-ID: Hello fieldtrip, I am trying to perform an LCMV beamformer on timelockanalysis data. timelock = avg: [124x20517 double] var: [124x20517 double] time: [1x20517 double] dof: [124x20517 double] label: {1x124 cell} dimord: 'chan_time' cov: [124x124 double] elec: [1x1 struct] cfg: [1x1 struct] I first run ft_prepare_leadfield cfg = []; cfg.elec = timelock.elec; cfg.vol = vol; cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution cfg.grid.unit = 'cm'; cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window grid = ft_prepare_leadfield( cfg); grid = xgrid: [-5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8] ygrid: [-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7] zgrid: [0 1 2 3 4 5 6 7 8 9 10 11 12] dim: [14 14 13] pos: [2548x3 double] unit: 'cm' inside: [1x1409 double] outside: [1x1139 double] cfg: [1x1 struct] leadfield: {1x2548 cell} I then try to run the ft_sourceanalysis code: cfg = []; cfg.channel = timelock.label; cfg.method = 'lcmv'; cfg.grid = grid; cfg.vol = vol; cfg.keepfilter = 'yes'; source = ft_sourceanalysis( cfg, timelock); And it crashes with the error message: Error using * Inner matrix dimensions must agree. Error in beamformer_lcmv (line 268) filt = pinv(lf' * invCy * lf) * lf' * invCy; % van Veen eqn. 23, use PINV/SVD to cover rank deficient leadfield Error in ft_sourceanalysis (line 794) dip(i) = beamformer_lcmv(grid, sens, vol, squeeze_avg, squeeze(Cy(i,:,:)), optarg{:}); However, the code does work if it is: cfg = []; cfg.channel = timelock.label; cfg.method = 'lcmv'; cfg.grid.inside = grid.inside; cfg.vol = vol; cfg.keepfilter = 'yes'; source = ft_sourceanalysis( cfg, timelock); However, I run the sourceplot code produces something that looks like the picture attached. What is interesting is that when I run the interp code: the input is source data with 16777216 positions on a [256 256 256] grid not plotting anatomy But when you run the same code from sourcePost_nocon from the beamformer tutorial, you get the following when you run the code: the input is source data with 3042 positions on a [18 13 13] grid the input is volume data with dimensions [256 256 256] I have used the same mri file for both. ? Please help, I cant work out the issue. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: sourceplot_example.png Type: image/png Size: 15766 bytes Desc: sourceplot_example.png URL: From tyler.grummett at flinders.edu.au Tue Apr 8 07:15:08 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 8 Apr 2014 05:15:08 +0000 Subject: [FieldTrip] ft_sourceanalysis using LCMV beamformer and grid from ft_prepare_leadfield In-Reply-To: References: Message-ID: <4b26ee20682b439b8bca1332f9ec9d66@SIXPR03MB368.apcprd03.prod.outlook.com> Fieldtrip, Ive got it working now. The follow error: ***************************************************************** Error using * Inner matrix dimensions must agree. Error in beamformer_lcmv (line 268) filt = pinv(lf' * invCy * lf) * lf' * invCy; % van Veen eqn. 23, use PINV/SVD to cover rank deficient leadfield Error in ft_sourceanalysis (line 794) dip(i) = beamformer_lcmv(grid, sens, vol, squeeze_avg, squeeze(Cy(i,:,:)), optarg{:}); ***************************************************************** It is because: if is 128x3 invCy is 124x124 When I ran the code: cfg = []; cfg.channel = 'EEG'; % only works for preprocessing cfg.vartrllength = 2; % accept variable length trials cfg.covariance = 'yes'; cfg.covariancewindow = 'all'; cfg.keeptrials = 'no'; timelock = ft_timelockanalysis(cfg, data); It did the timelockanalysis on 124 channels, but it didnt remove the non-EEG channels from timelock.elec and so the four EOG channels explains the 128. timelock = avg: [124x11758 double] var: [124x11758 double] time: [1x11758 double] dof: [124x11758 double] label: {1x124 cell} dimord: 'chan_time' cov: [124x124 double] elec: [1x1 struct] cfg: [1x1 struct] timelock.elec = chanpos: [128x3 double] elecpos: [128x3 double] label: {1x128 cell} type: 'eeg1005' unit: 'mm' I dont know if this is a bug or not. Please advise. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Tyler Grummett Sent: Tuesday, 8 April 2014 12:18 PM To: FieldTrip discussion list Subject: [FieldTrip] ft_sourceanalysis using LCMV beamformer and grid from ft_prepare_leadfield Hello fieldtrip, I am trying to perform an LCMV beamformer on timelockanalysis data. timelock = avg: [124x20517 double] var: [124x20517 double] time: [1x20517 double] dof: [124x20517 double] label: {1x124 cell} dimord: 'chan_time' cov: [124x124 double] elec: [1x1 struct] cfg: [1x1 struct] I first run ft_prepare_leadfield cfg = []; cfg.elec = timelock.elec; cfg.vol = vol; cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution cfg.grid.unit = 'cm'; cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window grid = ft_prepare_leadfield( cfg); grid = xgrid: [-5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8] ygrid: [-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7] zgrid: [0 1 2 3 4 5 6 7 8 9 10 11 12] dim: [14 14 13] pos: [2548x3 double] unit: 'cm' inside: [1x1409 double] outside: [1x1139 double] cfg: [1x1 struct] leadfield: {1x2548 cell} I then try to run the ft_sourceanalysis code: cfg = []; cfg.channel = timelock.label; cfg.method = 'lcmv'; cfg.grid = grid; cfg.vol = vol; cfg.keepfilter = 'yes'; source = ft_sourceanalysis( cfg, timelock); And it crashes with the error message: Error using * Inner matrix dimensions must agree. Error in beamformer_lcmv (line 268) filt = pinv(lf' * invCy * lf) * lf' * invCy; % van Veen eqn. 23, use PINV/SVD to cover rank deficient leadfield Error in ft_sourceanalysis (line 794) dip(i) = beamformer_lcmv(grid, sens, vol, squeeze_avg, squeeze(Cy(i,:,:)), optarg{:}); However, the code does work if it is: cfg = []; cfg.channel = timelock.label; cfg.method = 'lcmv'; cfg.grid.inside = grid.inside; cfg.vol = vol; cfg.keepfilter = 'yes'; source = ft_sourceanalysis( cfg, timelock); However, I run the sourceplot code produces something that looks like the picture attached. What is interesting is that when I run the interp code: the input is source data with 16777216 positions on a [256 256 256] grid not plotting anatomy But when you run the same code from sourcePost_nocon from the beamformer tutorial, you get the following when you run the code: the input is source data with 3042 positions on a [18 13 13] grid the input is volume data with dimensions [256 256 256] I have used the same mri file for both. ? Please help, I cant work out the issue. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.todorovic at fcdonders.ru.nl Tue Apr 8 07:25:18 2014 From: a.todorovic at fcdonders.ru.nl (Todorovic, A.) Date: Tue, 8 Apr 2014 07:25:18 +0200 (CEST) Subject: [FieldTrip] denoising data Message-ID: <818248357.305942.1396934718615.JavaMail.root@monoceros.zimbra.ru.nl> Hi Haiteng, Thanks for your reply. Just to be sure if I understand you correctly - do you use BOTH denoise_pca and denoise_synthetic on the same data? If not, how do you choose which one to use? Cheers, Ana > > Dear Ana, > > > If I understand correctly , we use ft_denoise_synthetic and > ft_denoise_pca to reduce noise due to recording (e.g. environment noise , > thermal noise... ) not the brain signal artefact (e.g eye blink). Normally > ,I use these two functions in the very early stage . > > Best, > Haiteng From marlene.boenstrup at googlemail.com Tue Apr 8 09:07:46 2014 From: marlene.boenstrup at googlemail.com (=?ISO-8859-1?Q?Marlene_B=F6nstrup?=) Date: Tue, 8 Apr 2014 09:07:46 +0200 Subject: [FieldTrip] surfaceplot made by ft_sourceplot sparing the frontal lobes Message-ID: Dear fieldtrip-experts, The plot I generated by ft_sourceplot using cfg.method = 'surface' with either projectionemthod 'nearest' or 'project' looks funny. The frontal lobes don't show any activation, they are just left grey. And also specific activations on the cortex are shifted towards the back (y-axis). I compared the same 3-D- sourceactivation data (interpolated on the standard T1 output of ft_interpolate with ft_interpolate) in an orthoplot and there the sourceactivation is neatly arranged in the whole brain volume, including the frontal lobes. So that the mistake must origin in the ft_sourceplot function. I use the version of the 18th of December 2013. Do you know this problem and can help me with it? If not, do you have an idea to solve it or cirumvent it? Thanks in advance, Marlene -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Tue Apr 8 10:59:00 2014 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Tue, 8 Apr 2014 10:59:00 +0200 Subject: [FieldTrip] surfaceplot made by ft_sourceplot sparing the frontal lobes In-Reply-To: References: Message-ID: Hi Marlene, Could you download today's version of FieldTrip, and let us know whether this problem still occurs? I'm saying because we just made an update to surface plotting, potentially solving your issue. Best, Arjen 2014-04-08 9:07 GMT+02:00 Marlene Bönstrup : > Dear fieldtrip-experts, > > The plot I generated by ft_sourceplot using cfg.method = 'surface' with > either projectionemthod 'nearest' or 'project' looks funny. The frontal > lobes don't show any activation, they are just left grey. And also specific > activations on the cortex are shifted towards the back (y-axis). I compared > the same 3-D- sourceactivation data (interpolated on the standard T1 output > of ft_interpolate with ft_interpolate) in an orthoplot and there the > sourceactivation is neatly arranged in the whole brain volume, including > the frontal lobes. So that the mistake must origin in the ft_sourceplot > function. > I use the version of the 18th of December 2013. > > Do you know this problem and can help me with it? > If not, do you have an idea to solve it or cirumvent it? > > Thanks in advance, > Marlene > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Tue Apr 8 11:01:47 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 8 Apr 2014 09:01:47 +0000 Subject: [FieldTrip] fieldtrip2eeglab Message-ID: <36a06a30eef54304859a734a2deb7153@SIXPR03MB368.apcprd03.prod.outlook.com> ?Hey fieldtrip, Is there a fieldtrip2eeglab function somewhere? It says in the documentation of 'integrating with eeglab', and I was wondering whether there already was one. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Tue Apr 8 11:19:34 2014 From: julian.keil at gmail.com (Julian Keil) Date: Tue, 8 Apr 2014 11:19:34 +0200 Subject: [FieldTrip] fieldtrip2eeglab References: Message-ID: <60EC99B5-A742-420D-84A2-3B86336EB37A@gmail.com> Hi Tyler, there was a mail by Arno Delorme last year containing the function. See below. Best, Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Anfang der weitergeleiteten E-Mail: > Von: Arnaud Delorme > Betreff: Re: [FieldTrip] Channel layout FT to EEGLAB > Datum: 29. Oktober 2013 01:27:53 MEZ > An: FieldTrip discussion list > Antwort an: FieldTrip discussion list > > Dear Rajat, > > this old function transforms EEG data contained in the Fieldtrip structure into an EEGLAB structure. > After you have done that, to transform a channel location file, simply type in > > EEG.chanlocs = struct('labels', cfg.elec.label, 'X', mattocell(cfg.elec.pnt(1,:)), 'Y', mattocell(cfg.elec.pnt(2,:)),'Z', mattocell(cfg.elec.pnt(3,:))); > EEG.chanlocs = convertlocs(EEG.chanlocs, 'cart2all'); > > This code is untested. You might have to switch X, Y and Z to obtain the correct orientation for the electrode cap. > Best, > > Arno > > > > On Oct 28, 2013, at 7:36 AM, Raquel Bibi wrote: > >> Hi Rajat, >> I don't know EEGLAB, but I use the "ordered" option in Fieldtrip to display my time-locked ICA components. >> >> Best, >> >> Raquel >> >> >> On Mon, Oct 28, 2013 at 9:39 AM, Rajat Thomas wrote: >> Dear all, >> >> I made a layout file using the image of the ecog array I had, just like described in the >> tutorial. >> >> I would like to port this to EEGLAB, so that I can use the various ICA options to plot >> the components at the channel locations and so on. >> >> Could anyone either point me to a file that does this conversion? or >> Any way of using ICA within fieldtrip to plot the various components on the different >> channels using the layout file? >> >> I know it is used for channel rejection and so on but any help on plotting the components >> back on the ICA would be appreciated. >> >> Thanks a lot in advance. >> >> Rajat >> >> -- >> Rajat Mani Thomas >> Netherlands Institute for Neuroscience >> Amsterdam, The Netherlands >> http://www.cita.utoronto.ca/~thomas >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fieldtrip2eeglab.m Type: application/octet-stream Size: 1141 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.rombetto at cib.na.cnr.it Tue Apr 8 11:51:12 2014 From: s.rombetto at cib.na.cnr.it (s.rombetto at cib.na.cnr.it) Date: Tue, 8 Apr 2014 11:51:12 +0200 Subject: [FieldTrip] denoising data In-Reply-To: <818248357.305942.1396934718615.JavaMail.root@monoceros.zimbra.ru.nl> References: <818248357.305942.1396934718615.JavaMail.root@monoceros.zimbra.ru.nl> Message-ID: <20140408115112.cn1ddeuo840s8s84@arco.cib.na.cnr.it> Hi I am interested in this topic too. As I have mainly environmental noise I use denoise_pca but I would like to understand if with a different code I couold improve my S/N ratio. Moreover I would ask if there is any difference if you apply first one denoising procedure or the other. Regards Sara Rombetto, PhD > Hi Haiteng, > > Thanks for your reply. > > Just to be sure if I understand you correctly - do you use BOTH > denoise_pca and denoise_synthetic on the same data? > > If not, how do you choose which one to use? > > Cheers, > Ana > >> >> Dear Ana, >> >> >> If I understand correctly , we use ft_denoise_synthetic and >> ft_denoise_pca to reduce noise due to recording (e.g. environment noise , >> thermal noise... ) not the brain signal artefact (e.g eye blink). Normally >> ,I use these two functions in the very early stage . >> >> Best, >> Haiteng > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > ------------------------- Dott.ssa Sara Rombetto Istituto di Cibernetica "E. Caianiello" Via Campi Flegrei, 34 80078 Pozzuoli (NA) Italy mob +39 3401689815 tel +39 0818675361 fax +39 0818675128 Lab MEG 0817483511 -------------------------- "I disapprove of what you say, but I will defend to the death your right to say it." [Evelyn Beatrice Hall, The Friends Of Voltaire] ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. From marlene.boenstrup at googlemail.com Tue Apr 8 13:31:25 2014 From: marlene.boenstrup at googlemail.com (=?ISO-8859-1?Q?Marlene_B=F6nstrup?=) Date: Tue, 8 Apr 2014 13:31:25 +0200 Subject: [FieldTrip] fieldtrip Digest, Vol 41, Issue 16 In-Reply-To: References: Message-ID: Dear Arjen, thanks for your quick reply. With the version of sunday (yesterdays version the file was invalid, my windows couldn't open it and there is not yet a version of today) the misplotting still occurs. I dont know if attachments work in this email list, but attached there is the surface and the orthoplot of exactly the same interploated data. 2014-04-08 12:00 GMT+02:00 : > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: denoising data (Todorovic, A.) > 2. surfaceplot made by ft_sourceplot sparing the frontal lobes > (Marlene B?nstrup) > 3. Re: surfaceplot made by ft_sourceplot sparing the frontal > lobes (Arjen Stolk) > 4. fieldtrip2eeglab (Tyler Grummett) > 5. fieldtrip2eeglab (Julian Keil) > 6. Re: denoising data (s.rombetto at cib.na.cnr.it) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 8 Apr 2014 07:25:18 +0200 (CEST) > From: "Todorovic, A." > To: FieldTrip List > Subject: Re: [FieldTrip] denoising data > Message-ID: > < > 818248357.305942.1396934718615.JavaMail.root at monoceros.zimbra.ru.nl> > Content-Type: text/plain; charset=utf-8 > > Hi Haiteng, > > Thanks for your reply. > > Just to be sure if I understand you correctly - do you use BOTH > denoise_pca and denoise_synthetic on the same data? > > If not, how do you choose which one to use? > > Cheers, > Ana > > > > > Dear Ana, > > > > > > If I understand correctly , we use ft_denoise_synthetic and > > ft_denoise_pca to reduce noise due to recording (e.g. environment > noise , > > thermal noise... ) not the brain signal artefact (e.g eye blink). > Normally > > ,I use these two functions in the very early stage . > > > > Best, > > Haiteng > > > ------------------------------ > > Message: 2 > Date: Tue, 8 Apr 2014 09:07:46 +0200 > From: Marlene B?nstrup > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] surfaceplot made by ft_sourceplot sparing the > frontal lobes > Message-ID: > hQuwNwyu2qf-GFmF84qzVje7ENjq86MSsrpE31_J2vQ at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Dear fieldtrip-experts, > > The plot I generated by ft_sourceplot using cfg.method = 'surface' with > either projectionemthod 'nearest' or 'project' looks funny. The frontal > lobes don't show any activation, they are just left grey. And also specific > activations on the cortex are shifted towards the back (y-axis). I compared > the same 3-D- sourceactivation data (interpolated on the standard T1 output > of ft_interpolate with ft_interpolate) in an orthoplot and there the > sourceactivation is neatly arranged in the whole brain volume, including > the frontal lobes. So that the mistake must origin in the ft_sourceplot > function. > I use the version of the 18th of December 2013. > > Do you know this problem and can help me with it? > If not, do you have an idea to solve it or cirumvent it? > > Thanks in advance, > Marlene > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/80ef0af7/attachment-0001.html > > > > ------------------------------ > > Message: 3 > Date: Tue, 8 Apr 2014 10:59:00 +0200 > From: Arjen Stolk > To: FieldTrip discussion list > Subject: Re: [FieldTrip] surfaceplot made by ft_sourceplot sparing the > frontal lobes > Message-ID: > nRhoRBQ at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Hi Marlene, > > Could you download today's version of FieldTrip, and let us know whether > this problem still occurs? I'm saying because we just made an update to > surface plotting, potentially solving your issue. > > Best, > Arjen > > > 2014-04-08 9:07 GMT+02:00 Marlene B?nstrup < > marlene.boenstrup at googlemail.com > >: > > > Dear fieldtrip-experts, > > > > The plot I generated by ft_sourceplot using cfg.method = 'surface' with > > either projectionemthod 'nearest' or 'project' looks funny. The frontal > > lobes don't show any activation, they are just left grey. And also > specific > > activations on the cortex are shifted towards the back (y-axis). I > compared > > the same 3-D- sourceactivation data (interpolated on the standard T1 > output > > of ft_interpolate with ft_interpolate) in an orthoplot and there the > > sourceactivation is neatly arranged in the whole brain volume, including > > the frontal lobes. So that the mistake must origin in the ft_sourceplot > > function. > > I use the version of the 18th of December 2013. > > > > Do you know this problem and can help me with it? > > If not, do you have an idea to solve it or cirumvent it? > > > > Thanks in advance, > > Marlene > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/842e34a6/attachment-0001.html > > > > ------------------------------ > > Message: 4 > Date: Tue, 8 Apr 2014 09:01:47 +0000 > From: Tyler Grummett > To: FieldTrip discussion list > Subject: [FieldTrip] fieldtrip2eeglab > Message-ID: > < > 36a06a30eef54304859a734a2deb7153 at SIXPR03MB368.apcprd03.prod.outlook.com> > > Content-Type: text/plain; charset="us-ascii" > > ?Hey fieldtrip, > > > Is there a fieldtrip2eeglab function somewhere? > > > It says in the documentation of 'integrating with eeglab', and I was > wondering whether there already was one. > > > Tyler > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/6cd8cccb/attachment-0001.html > > > > ------------------------------ > > Message: 5 > Date: Tue, 8 Apr 2014 11:19:34 +0200 > From: Julian Keil > To: Tyler Grummett , FieldTrip > discussion list > Subject: [FieldTrip] fieldtrip2eeglab > Message-ID: <60EC99B5-A742-420D-84A2-3B86336EB37A at gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Hi Tyler, > > there was a mail by Arno Delorme last year containing the function. > > See below. > > Best, > > Julian > ******************** > Dr. Julian Keil > > AG Multisensorische Integration > Psychiatrische Universit?tsklinik > der Charit? im St. Hedwig-Krankenhaus > Gro?e Hamburger Stra?e 5-11, Raum E 307 > 10115 Berlin > > Telefon: +49-30-2311-1879 > Fax: +49-30-2311-2209 > > http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration > > Anfang der weitergeleiteten E-Mail: > > > Von: Arnaud Delorme > > Betreff: Re: [FieldTrip] Channel layout FT to EEGLAB > > Datum: 29. Oktober 2013 01:27:53 MEZ > > An: FieldTrip discussion list > > Antwort an: FieldTrip discussion list > > > > Dear Rajat, > > > > this old function transforms EEG data contained in the Fieldtrip > structure into an EEGLAB structure. > > After you have done that, to transform a channel location file, simply > type in > > > > EEG.chanlocs = struct('labels', cfg.elec.label, 'X', > mattocell(cfg.elec.pnt(1,:)), 'Y', mattocell(cfg.elec.pnt(2,:)),'Z', > mattocell(cfg.elec.pnt(3,:))); > > EEG.chanlocs = convertlocs(EEG.chanlocs, 'cart2all'); > > > > This code is untested. You might have to switch X, Y and Z to obtain the > correct orientation for the electrode cap. > > Best, > > > > Arno > > > > > > > > On Oct 28, 2013, at 7:36 AM, Raquel Bibi wrote: > > > >> Hi Rajat, > >> I don't know EEGLAB, but I use the "ordered" option in Fieldtrip to > display my time-locked ICA components. > >> > >> Best, > >> > >> Raquel > >> > >> > >> On Mon, Oct 28, 2013 at 9:39 AM, Rajat Thomas > wrote: > >> Dear all, > >> > >> I made a layout file using the image of the ecog array I had, just like > described in the > >> tutorial. > >> > >> I would like to port this to EEGLAB, so that I can use the various ICA > options to plot > >> the components at the channel locations and so on. > >> > >> Could anyone either point me to a file that does this conversion? or > >> Any way of using ICA within fieldtrip to plot the various components on > the different > >> channels using the layout file? > >> > >> I know it is used for channel rejection and so on but any help on > plotting the components > >> back on the ICA would be appreciated. > >> > >> Thanks a lot in advance. > >> > >> Rajat > >> > >> -- > >> Rajat Mani Thomas > >> Netherlands Institute for Neuroscience > >> Amsterdam, The Netherlands > >> http://www.cita.utoronto.ca/~thomas > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0002.html > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: fieldtrip2eeglab.m > Type: application/octet-stream > Size: 1141 bytes > Desc: not available > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0001.obj > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0003.html > > > > ------------------------------ > > Message: 6 > Date: Tue, 8 Apr 2014 11:51:12 +0200 > From: s.rombetto at cib.na.cnr.it > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] denoising data > Message-ID: <20140408115112.cn1ddeuo840s8s84 at arco.cib.na.cnr.it> > Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; > format="flowed" > > Hi > I am interested in this topic too. > As I have mainly environmental noise I use denoise_pca but I would > like to understand if with a different code I couold improve my S/N > ratio. Moreover I would ask if there is any difference if you apply > first one denoising procedure or the other. > > Regards > Sara Rombetto, PhD > > > Hi Haiteng, > > > > Thanks for your reply. > > > > Just to be sure if I understand you correctly - do you use BOTH > > denoise_pca and denoise_synthetic on the same data? > > > > If not, how do you choose which one to use? > > > > Cheers, > > Ana > > > >> > >> Dear Ana, > >> > >> > >> If I understand correctly , we use ft_denoise_synthetic and > >> ft_denoise_pca to reduce noise due to recording (e.g. environment > noise , > >> thermal noise... ) not the brain signal artefact (e.g eye blink). > Normally > >> ,I use these two functions in the very early stage . > >> > >> Best, > >> Haiteng > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > ------------------------- > Dott.ssa Sara Rombetto > Istituto di Cibernetica > "E. Caianiello" > Via Campi Flegrei, 34 > 80078 Pozzuoli (NA) > Italy > mob +39 3401689815 > tel +39 0818675361 > fax +39 0818675128 > Lab MEG 0817483511 > -------------------------- > "I disapprove of what you say, but I will defend to the death your > right to say > it." [Evelyn Beatrice Hall, The Friends Of Voltaire] > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 16 > ***************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ortho.png Type: image/png Size: 48141 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: surface.png Type: image/png Size: 136550 bytes Desc: not available URL: From f.roux at bcbl.eu Tue Apr 8 14:46:22 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Tue, 8 Apr 2014 14:46:22 +0200 (CEST) Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs Message-ID: <591175772.1312154.1396961182187.JavaMail.root@bcbl.eu> Dear all, I have a general question relating to the usage of cfg.runica.pca during the call to ft_componentanalysis. Is it correct to assume that cfg.runica.pca = length(meg_data.label) will force the algorithm to return n = length(meg_data.label) ICs, and that as a result artifacts can be "spread" across several ICs? If that's true, then I imagine that cfg.runica.pac = n/4 will return less components and reduce the "spread" of artifacts over several components. My question is how to choose the number of principal components to which the data is reduced before ICA? Best, Fred --------------------------------------------------------------------------- From Holger.Krause at med.uni-duesseldorf.de Tue Apr 8 15:11:45 2014 From: Holger.Krause at med.uni-duesseldorf.de (Holger Krause) Date: Tue, 08 Apr 2014 15:11:45 +0200 Subject: [FieldTrip] Zip file of yesterday's version seems to be corrupted (2014-04-07) Message-ID: <201404081511.46850.Holger.Krause@med.uni-duesseldorf.de> Hi, Yesterday night my script for downloading the latest fieldtrip version failed. Today I manually downloaded , of which the md5sum is 7ebc176eedc038581d17ecbb46bd0832. zipinfo complains about invalid archive: $ zipinfo fieldtrip-20140407.zip Archive: fieldtrip-20140407.zip Zip file size: 296098459 bytes, number of entries: 8079 error [fieldtrip-20140407.zip]: start of central directory not found; zipfile corrupt. Other users seem to be affected as well (see Marlene Bönstrup's mail from today.) BR, Holger -- Dr. rer. nat. Holger Krause MEG-Labor, Raum 13.54.-1.84 Telefon: +49 211 81-19031 Institut für klinische Neurowissenschaften http://www.uniklinik-duesseldorf.de/klinneurowiss Uniklinik Düsseldorf From haiteng.jiang at gmail.com Tue Apr 8 15:15:01 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Tue, 8 Apr 2014 15:15:01 +0200 Subject: [FieldTrip] denoising data Message-ID: Hi Ana& Sara, denoise_synthetic use linear regression to regress the noise out . The parameters are set by the manufacture company technicians while denoise_pca is a data- driven method by removing reference channels background noise. In principle , either is fine. Personally, I prefer to only use denoise_synthetic. You don't need to denoise twice and you do the component analysis later anyway. Best, Haiteng On 8 April 2014 12:00, wrote: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: denoising data (Todorovic, A.) > 2. surfaceplot made by ft_sourceplot sparing the frontal lobes > (Marlene B?nstrup) > 3. Re: surfaceplot made by ft_sourceplot sparing the frontal > lobes (Arjen Stolk) > 4. fieldtrip2eeglab (Tyler Grummett) > 5. fieldtrip2eeglab (Julian Keil) > 6. Re: denoising data (s.rombetto at cib.na.cnr.it) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 8 Apr 2014 07:25:18 +0200 (CEST) > From: "Todorovic, A." > To: FieldTrip List > Subject: Re: [FieldTrip] denoising data > Message-ID: > < > 818248357.305942.1396934718615.JavaMail.root at monoceros.zimbra.ru.nl> > Content-Type: text/plain; charset=utf-8 > > Hi Haiteng, > > Thanks for your reply. > > Just to be sure if I understand you correctly - do you use BOTH > denoise_pca and denoise_synthetic on the same data? > > If not, how do you choose which one to use? > > Cheers, > Ana > > > > > Dear Ana, > > > > > > If I understand correctly , we use ft_denoise_synthetic and > > ft_denoise_pca to reduce noise due to recording (e.g. environment > noise , > > thermal noise... ) not the brain signal artefact (e.g eye blink). > Normally > > ,I use these two functions in the very early stage . > > > > Best, > > Haiteng > > > ------------------------------ > > Message: 2 > Date: Tue, 8 Apr 2014 09:07:46 +0200 > From: Marlene B?nstrup > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] surfaceplot made by ft_sourceplot sparing the > frontal lobes > Message-ID: > hQuwNwyu2qf-GFmF84qzVje7ENjq86MSsrpE31_J2vQ at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Dear fieldtrip-experts, > > The plot I generated by ft_sourceplot using cfg.method = 'surface' with > either projectionemthod 'nearest' or 'project' looks funny. The frontal > lobes don't show any activation, they are just left grey. And also specific > activations on the cortex are shifted towards the back (y-axis). I compared > the same 3-D- sourceactivation data (interpolated on the standard T1 output > of ft_interpolate with ft_interpolate) in an orthoplot and there the > sourceactivation is neatly arranged in the whole brain volume, including > the frontal lobes. So that the mistake must origin in the ft_sourceplot > function. > I use the version of the 18th of December 2013. > > Do you know this problem and can help me with it? > If not, do you have an idea to solve it or cirumvent it? > > Thanks in advance, > Marlene > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/80ef0af7/attachment-0001.html > > > > ------------------------------ > > Message: 3 > Date: Tue, 8 Apr 2014 10:59:00 +0200 > From: Arjen Stolk > To: FieldTrip discussion list > Subject: Re: [FieldTrip] surfaceplot made by ft_sourceplot sparing the > frontal lobes > Message-ID: > nRhoRBQ at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Hi Marlene, > > Could you download today's version of FieldTrip, and let us know whether > this problem still occurs? I'm saying because we just made an update to > surface plotting, potentially solving your issue. > > Best, > Arjen > > > 2014-04-08 9:07 GMT+02:00 Marlene B?nstrup < > marlene.boenstrup at googlemail.com > >: > > > Dear fieldtrip-experts, > > > > The plot I generated by ft_sourceplot using cfg.method = 'surface' with > > either projectionemthod 'nearest' or 'project' looks funny. The frontal > > lobes don't show any activation, they are just left grey. And also > specific > > activations on the cortex are shifted towards the back (y-axis). I > compared > > the same 3-D- sourceactivation data (interpolated on the standard T1 > output > > of ft_interpolate with ft_interpolate) in an orthoplot and there the > > sourceactivation is neatly arranged in the whole brain volume, including > > the frontal lobes. So that the mistake must origin in the ft_sourceplot > > function. > > I use the version of the 18th of December 2013. > > > > Do you know this problem and can help me with it? > > If not, do you have an idea to solve it or cirumvent it? > > > > Thanks in advance, > > Marlene > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/842e34a6/attachment-0001.html > > > > ------------------------------ > > Message: 4 > Date: Tue, 8 Apr 2014 09:01:47 +0000 > From: Tyler Grummett > To: FieldTrip discussion list > Subject: [FieldTrip] fieldtrip2eeglab > Message-ID: > < > 36a06a30eef54304859a734a2deb7153 at SIXPR03MB368.apcprd03.prod.outlook.com> > > Content-Type: text/plain; charset="us-ascii" > > ?Hey fieldtrip, > > > Is there a fieldtrip2eeglab function somewhere? > > > It says in the documentation of 'integrating with eeglab', and I was > wondering whether there already was one. > > > Tyler > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/6cd8cccb/attachment-0001.html > > > > ------------------------------ > > Message: 5 > Date: Tue, 8 Apr 2014 11:19:34 +0200 > From: Julian Keil > To: Tyler Grummett , FieldTrip > discussion list > Subject: [FieldTrip] fieldtrip2eeglab > Message-ID: <60EC99B5-A742-420D-84A2-3B86336EB37A at gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Hi Tyler, > > there was a mail by Arno Delorme last year containing the function. > > See below. > > Best, > > Julian > ******************** > Dr. Julian Keil > > AG Multisensorische Integration > Psychiatrische Universit?tsklinik > der Charit? im St. Hedwig-Krankenhaus > Gro?e Hamburger Stra?e 5-11, Raum E 307 > 10115 Berlin > > Telefon: +49-30-2311-1879 > Fax: +49-30-2311-2209 > > http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration > > Anfang der weitergeleiteten E-Mail: > > > Von: Arnaud Delorme > > Betreff: Re: [FieldTrip] Channel layout FT to EEGLAB > > Datum: 29. Oktober 2013 01:27:53 MEZ > > An: FieldTrip discussion list > > Antwort an: FieldTrip discussion list > > > > Dear Rajat, > > > > this old function transforms EEG data contained in the Fieldtrip > structure into an EEGLAB structure. > > After you have done that, to transform a channel location file, simply > type in > > > > EEG.chanlocs = struct('labels', cfg.elec.label, 'X', > mattocell(cfg.elec.pnt(1,:)), 'Y', mattocell(cfg.elec.pnt(2,:)),'Z', > mattocell(cfg.elec.pnt(3,:))); > > EEG.chanlocs = convertlocs(EEG.chanlocs, 'cart2all'); > > > > This code is untested. You might have to switch X, Y and Z to obtain the > correct orientation for the electrode cap. > > Best, > > > > Arno > > > > > > > > On Oct 28, 2013, at 7:36 AM, Raquel Bibi wrote: > > > >> Hi Rajat, > >> I don't know EEGLAB, but I use the "ordered" option in Fieldtrip to > display my time-locked ICA components. > >> > >> Best, > >> > >> Raquel > >> > >> > >> On Mon, Oct 28, 2013 at 9:39 AM, Rajat Thomas > wrote: > >> Dear all, > >> > >> I made a layout file using the image of the ecog array I had, just like > described in the > >> tutorial. > >> > >> I would like to port this to EEGLAB, so that I can use the various ICA > options to plot > >> the components at the channel locations and so on. > >> > >> Could anyone either point me to a file that does this conversion? or > >> Any way of using ICA within fieldtrip to plot the various components on > the different > >> channels using the layout file? > >> > >> I know it is used for channel rejection and so on but any help on > plotting the components > >> back on the ICA would be appreciated. > >> > >> Thanks a lot in advance. > >> > >> Rajat > >> > >> -- > >> Rajat Mani Thomas > >> Netherlands Institute for Neuroscience > >> Amsterdam, The Netherlands > >> http://www.cita.utoronto.ca/~thomas > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0002.html > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: fieldtrip2eeglab.m > Type: application/octet-stream > Size: 1141 bytes > Desc: not available > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0001.obj > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0003.html > > > > ------------------------------ > > Message: 6 > Date: Tue, 8 Apr 2014 11:51:12 +0200 > From: s.rombetto at cib.na.cnr.it > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] denoising data > Message-ID: <20140408115112.cn1ddeuo840s8s84 at arco.cib.na.cnr.it> > Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; > format="flowed" > > Hi > I am interested in this topic too. > As I have mainly environmental noise I use denoise_pca but I would > like to understand if with a different code I couold improve my S/N > ratio. Moreover I would ask if there is any difference if you apply > first one denoising procedure or the other. > > Regards > Sara Rombetto, PhD > > > Hi Haiteng, > > > > Thanks for your reply. > > > > Just to be sure if I understand you correctly - do you use BOTH > > denoise_pca and denoise_synthetic on the same data? > > > > If not, how do you choose which one to use? > > > > Cheers, > > Ana > > > >> > >> Dear Ana, > >> > >> > >> If I understand correctly , we use ft_denoise_synthetic and > >> ft_denoise_pca to reduce noise due to recording (e.g. environment > noise , > >> thermal noise... ) not the brain signal artefact (e.g eye blink). > Normally > >> ,I use these two functions in the very early stage . > >> > >> Best, > >> Haiteng > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > ------------------------- > Dott.ssa Sara Rombetto > Istituto di Cibernetica > "E. Caianiello" > Via Campi Flegrei, 34 > 80078 Pozzuoli (NA) > Italy > mob +39 3401689815 > tel +39 0818675361 > fax +39 0818675128 > Lab MEG 0817483511 > -------------------------- > "I disapprove of what you say, but I will defend to the death your > right to say > it." [Evelyn Beatrice Hall, The Friends Of Voltaire] > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 16 > ***************************************** > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Tue Apr 8 15:29:03 2014 From: d.lozanosoldevilla at fcdonders.ru.nl (Lozano Soldevilla, D. (Diego)) Date: Tue, 8 Apr 2014 15:29:03 +0200 (CEST) Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs In-Reply-To: <591175772.1312154.1396961182187.JavaMail.root@bcbl.eu> Message-ID: <477456701.6274998.1396963743697.JavaMail.root@sculptor.zimbra.ru.nl> Hi Fred, I don't know the magical number but I see the following options: a) Before ICA, concatenate all single trials and ask for the rank of your data. Use it as your cfg.runica.pca input. b) Some users notice that when you sort IC by variance, beyond component 30, the IC topo/activation does not look like physiologically meaningfull. It matches with the PCA reduction before ICA with other papers: http://www.ncbi.nlm.nih.gov/pubmed/15219593 http://www.ncbi.nlm.nih.gov/pubmed/19699307 Might be somebody in the forum have tried (by simulations or in real data) on the effects of PCA component reduction on ICA. I hope it helps, Diego ----- Original Message ----- > From: "Frédéric Roux" > To: "FieldTrip discussion list" > Sent: Tuesday, 8 April, 2014 2:46:22 PM > Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs > Dear all, > > I have a general question relating to the usage of cfg.runica.pca > during the call to ft_componentanalysis. > > Is it correct to assume that cfg.runica.pca = length(meg_data.label) > will > force the algorithm to return n = length(meg_data.label) ICs, and that > as a > result artifacts can be "spread" across several ICs? > > If that's true, then I imagine that cfg.runica.pac = n/4 will return > less components > and reduce the "spread" of artifacts over several components. > > My question is how to choose the number of principal components to > which the data > is reduced before ICA? > > Best, > Fred > --------------------------------------------------------------------------- > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- PhD Student Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen NL-6525 EN Nijmegen The Netherlands http://www.ru.nl/people/donders/lozano-soldevilla-d/ From mauricio.antelis at gmail.com Tue Apr 8 15:36:42 2014 From: mauricio.antelis at gmail.com (Mauricio Antelis) Date: Tue, 8 Apr 2014 08:36:42 -0500 Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs In-Reply-To: <477456701.6274998.1396963743697.JavaMail.root@sculptor.zimbra.ru.nl> References: <591175772.1312154.1396961182187.JavaMail.root@bcbl.eu> <477456701.6274998.1396963743697.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: Roberto, Aqui algo sobre el cuentionamiento del numero de componentes para realizar ICA, sin embargo en nuestro caso, creo que no sera un parametro sensible ya que tenemos un numero bajo (21) de mediciones Saludos Mauricio On Tue, Apr 8, 2014 at 8:29 AM, Lozano Soldevilla, D. (Diego) < d.lozanosoldevilla at fcdonders.ru.nl> wrote: > Hi Fred, > > I don't know the magical number but I see the following options: > > a) Before ICA, concatenate all single trials and ask for the rank of your > data. Use it as your cfg.runica.pca input. > > b) Some users notice that when you sort IC by variance, beyond component > 30, the IC topo/activation does not look like physiologically meaningfull. > It matches with the PCA reduction before ICA with other papers: > > http://www.ncbi.nlm.nih.gov/pubmed/15219593 > http://www.ncbi.nlm.nih.gov/pubmed/19699307 > > Might be somebody in the forum have tried (by simulations or in real data) > on the effects of PCA component reduction on ICA. > > I hope it helps, > > Diego > > ----- Original Message ----- > > From: "Frédéric Roux" > > To: "FieldTrip discussion list" > > Sent: Tuesday, 8 April, 2014 2:46:22 PM > > Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs > > Dear all, > > > > I have a general question relating to the usage of cfg.runica.pca > > during the call to ft_componentanalysis. > > > > Is it correct to assume that cfg.runica.pca = length(meg_data.label) > > will > > force the algorithm to return n = length(meg_data.label) ICs, and that > > as a > > result artifacts can be "spread" across several ICs? > > > > If that's true, then I imagine that cfg.runica.pac = n/4 will return > > less components > > and reduce the "spread" of artifacts over several components. > > > > My question is how to choose the number of principal components to > > which the data > > is reduced before ICA? > > > > Best, > > Fred > > > --------------------------------------------------------------------------- > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > PhD Student > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > NL-6525 EN Nijmegen > The Netherlands > http://www.ru.nl/people/donders/lozano-soldevilla-d/ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Javier M. Antelis -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Tue Apr 8 15:38:38 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Tue, 8 Apr 2014 15:38:38 +0200 (CEST) Subject: [FieldTrip] fieldtrip Digest, Vol 41, Issue 16 In-Reply-To: Message-ID: <213148632.6275386.1396964318753.JavaMail.root@sculptor.zimbra.ru.nl> Hi Marlene, The fix was implemented yesterday, so Sunday's version unfortunately does not contain it. It seems there is currently a problem with the ftp file, so please try again as soon as you can download the latest version. If the problem still exists, please file a bug at http://bugzilla.fcdonders.nl/ and we'll try to replicate your issue. Best, Arjen ----- Oorspronkelijk bericht ----- > Van: "Marlene Bönstrup" > Aan: fieldtrip at science.ru.nl > Verzonden: Dinsdag 8 april 2014 13:31:25 > Onderwerp: Re: [FieldTrip] fieldtrip Digest, Vol 41, Issue 16 > Dear Arjen, > thanks for your quick reply. > With the version of sunday (yesterdays version the file was invalid, > my windows couldn't open it and there is not yet a version of today) > the misplotting still occurs. > I dont know if attachments work in this email list, but attached there > is the surface and the orthoplot of exactly the same interploated > data. > 2014-04-08 12:00 GMT+02:00 < fieldtrip-request at science.ru.nl > : > > Send fieldtrip mailing list submissions to > > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > or, via email, send a message with subject or body 'help' to > > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > > than "Re: Contents of fieldtrip digest..." > > Today's Topics: > > 1. Re: denoising data (Todorovic, A.) > > 2. surfaceplot made by ft_sourceplot sparing the frontal lobes > > (Marlene B?nstrup) > > 3. Re: surfaceplot made by ft_sourceplot sparing the frontal > > lobes (Arjen Stolk) > > 4. fieldtrip2eeglab (Tyler Grummett) > > 5. fieldtrip2eeglab (Julian Keil) > > 6. Re: denoising data ( s.rombetto at cib.na.cnr.it ) > > ---------------------------------------------------------------------- > > Message: 1 > > Date: Tue, 8 Apr 2014 07:25:18 +0200 (CEST) > > From: "Todorovic, A." < a.todorovic at fcdonders.ru.nl > > > To: FieldTrip List < fieldtrip at donders.ru.nl > > > Subject: Re: [FieldTrip] denoising data > > Message-ID: > > < > > 818248357.305942.1396934718615.JavaMail.root at monoceros.zimbra.ru.nl > > > > > Content-Type: text/plain; charset=utf-8 > > Hi Haiteng, > > Thanks for your reply. > > Just to be sure if I understand you correctly - do you use BOTH > > denoise_pca and denoise_synthetic on the same data? > > If not, how do you choose which one to use? > > Cheers, > > Ana > > > > > > Dear Ana, > > > > > > > > > If I understand correctly , we use ft_denoise_synthetic and > > > ft_denoise_pca to reduce noise due to recording (e.g. environment > > > noise , > > > thermal noise... ) not the brain signal artefact (e.g eye blink). > > > Normally > > > ,I use these two functions in the very early stage . > > > > > > Best, > > > Haiteng > > ------------------------------ > > Message: 2 > > Date: Tue, 8 Apr 2014 09:07:46 +0200 > > From: Marlene B?nstrup < marlene.boenstrup at googlemail.com > > > To: fieldtrip at science.ru.nl > > Subject: [FieldTrip] surfaceplot made by ft_sourceplot sparing the > > frontal lobes > > Message-ID: > > > > > > Content-Type: text/plain; charset="iso-8859-1" > > Dear fieldtrip-experts, > > The plot I generated by ft_sourceplot using cfg.method = 'surface' > > with > > either projectionemthod 'nearest' or 'project' looks funny. The > > frontal > > lobes don't show any activation, they are just left grey. And also > > specific > > activations on the cortex are shifted towards the back (y-axis). I > > compared > > the same 3-D- sourceactivation data (interpolated on the standard T1 > > output > > of ft_interpolate with ft_interpolate) in an orthoplot and there the > > sourceactivation is neatly arranged in the whole brain volume, > > including > > the frontal lobes. So that the mistake must origin in the > > ft_sourceplot > > function. > > I use the version of the 18th of December 2013. > > Do you know this problem and can help me with it? > > If not, do you have an idea to solve it or cirumvent it? > > Thanks in advance, > > Marlene > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: < > > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/80ef0af7/attachment-0001.html > > > > > ------------------------------ > > Message: 3 > > Date: Tue, 8 Apr 2014 10:59:00 +0200 > > From: Arjen Stolk < a.stolk8 at gmail.com > > > To: FieldTrip discussion list < fieldtrip at science.ru.nl > > > Subject: Re: [FieldTrip] surfaceplot made by ft_sourceplot sparing > > the > > frontal lobes > > Message-ID: > > > > > > Content-Type: text/plain; charset="iso-8859-1" > > Hi Marlene, > > Could you download today's version of FieldTrip, and let us know > > whether > > this problem still occurs? I'm saying because we just made an update > > to > > surface plotting, potentially solving your issue. > > Best, > > Arjen > > 2014-04-08 9:07 GMT+02:00 Marlene B?nstrup < > > marlene.boenstrup at googlemail.com > > >: > > > Dear fieldtrip-experts, > > > > > > The plot I generated by ft_sourceplot using cfg.method = 'surface' > > > with > > > either projectionemthod 'nearest' or 'project' looks funny. The > > > frontal > > > lobes don't show any activation, they are just left grey. And also > > > specific > > > activations on the cortex are shifted towards the back (y-axis). I > > > compared > > > the same 3-D- sourceactivation data (interpolated on the standard > > > T1 > > > output > > > of ft_interpolate with ft_interpolate) in an orthoplot and there > > > the > > > sourceactivation is neatly arranged in the whole brain volume, > > > including > > > the frontal lobes. So that the mistake must origin in the > > > ft_sourceplot > > > function. > > > I use the version of the 18th of December 2013. > > > > > > Do you know this problem and can help me with it? > > > If not, do you have an idea to solve it or cirumvent it? > > > > > > Thanks in advance, > > > Marlene > > > > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: < > > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/842e34a6/attachment-0001.html > > > > > ------------------------------ > > Message: 4 > > Date: Tue, 8 Apr 2014 09:01:47 +0000 > > From: Tyler Grummett < tyler.grummett at flinders.edu.au > > > To: FieldTrip discussion list < fieldtrip at science.ru.nl > > > Subject: [FieldTrip] fieldtrip2eeglab > > Message-ID: > > < > > 36a06a30eef54304859a734a2deb7153 at SIXPR03MB368.apcprd03.prod.outlook.com > > > > > Content-Type: text/plain; charset="us-ascii" > > ?Hey fieldtrip, > > Is there a fieldtrip2eeglab function somewhere? > > It says in the documentation of 'integrating with eeglab', and I was > > wondering whether there already was one. > > Tyler > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > > PhD Candidate > > Brain Signals Laboratory > > Flinders University > > Rm 5A301 > > Ext 66124 > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: < > > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/6cd8cccb/attachment-0001.html > > > > > ------------------------------ > > Message: 5 > > Date: Tue, 8 Apr 2014 11:19:34 +0200 > > From: Julian Keil < julian.keil at gmail.com > > > To: Tyler Grummett < tyler.grummett at flinders.edu.au >, FieldTrip > > discussion list < fieldtrip at science.ru.nl > > > Subject: [FieldTrip] fieldtrip2eeglab > > Message-ID: < 60EC99B5-A742-420D-84A2-3B86336EB37A at gmail.com > > > Content-Type: text/plain; charset="iso-8859-1" > > Hi Tyler, > > there was a mail by Arno Delorme last year containing the function. > > See below. > > Best, > > Julian > > ******************** > > Dr. Julian Keil > > AG Multisensorische Integration > > Psychiatrische Universit?tsklinik > > der Charit? im St. Hedwig-Krankenhaus > > Gro?e Hamburger Stra?e 5-11, Raum E 307 > > 10115 Berlin > > Telefon: +49-30-2311-1879 > > Fax: +49-30-2311-2209 > > http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration > > Anfang der weitergeleiteten E-Mail: > > > Von: Arnaud Delorme < arno at cerco.ups-tlse.fr > > > > Betreff: Re: [FieldTrip] Channel layout FT to EEGLAB > > > Datum: 29. Oktober 2013 01:27:53 MEZ > > > An: FieldTrip discussion list < fieldtrip at science.ru.nl > > > > Antwort an: FieldTrip discussion list < fieldtrip at science.ru.nl > > > > > > > Dear Rajat, > > > > > > this old function transforms EEG data contained in the Fieldtrip > > > structure into an EEGLAB structure. > > > After you have done that, to transform a channel location file, > > > simply type in > > > > > > EEG.chanlocs = struct('labels', cfg.elec.label, 'X', > > > mattocell(cfg.elec.pnt(1,:)), 'Y', > > > mattocell(cfg.elec.pnt(2,:)),'Z', > > > mattocell(cfg.elec.pnt(3,:))); > > > EEG.chanlocs = convertlocs(EEG.chanlocs, 'cart2all'); > > > > > > This code is untested. You might have to switch X, Y and Z to > > > obtain > > > the correct orientation for the electrode cap. > > > Best, > > > > > > Arno > > > > > > > > > > > > On Oct 28, 2013, at 7:36 AM, Raquel Bibi < bibi.raquel at gmail.com > > > > wrote: > > > > > >> Hi Rajat, > > >> I don't know EEGLAB, but I use the "ordered" option in Fieldtrip > > >> to > > >> display my time-locked ICA components. > > >> > > >> Best, > > >> > > >> Raquel > > >> > > >> > > >> On Mon, Oct 28, 2013 at 9:39 AM, Rajat Thomas < > > >> rajatthomas at gmail.com > wrote: > > >> Dear all, > > >> > > >> I made a layout file using the image of the ecog array I had, > > >> just > > >> like described in the > > >> tutorial. > > >> > > >> I would like to port this to EEGLAB, so that I can use the > > >> various > > >> ICA options to plot > > >> the components at the channel locations and so on. > > >> > > >> Could anyone either point me to a file that does this conversion? > > >> or > > >> Any way of using ICA within fieldtrip to plot the various > > >> components on the different > > >> channels using the layout file? > > >> > > >> I know it is used for channel rejection and so on but any help on > > >> plotting the components > > >> back on the ICA would be appreciated. > > >> > > >> Thanks a lot in advance. > > >> > > >> Rajat > > >> > > >> -- > > >> Rajat Mani Thomas > > >> Netherlands Institute for Neuroscience > > >> Amsterdam, The Netherlands > > >> http://www.cita.utoronto.ca/~thomas > > >> > > >> _______________________________________________ > > >> fieldtrip mailing list > > >> fieldtrip at donders.ru.nl > > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > >> > > >> _______________________________________________ > > >> fieldtrip mailing list > > >> fieldtrip at donders.ru.nl > > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: < > > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0002.html > > > > > -------------- next part -------------- > > A non-text attachment was scrubbed... > > Name: fieldtrip2eeglab.m > > Type: application/octet-stream > > Size: 1141 bytes > > Desc: not available > > URL: < > > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0001.obj > > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: < > > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0003.html > > > > > ------------------------------ > > Message: 6 > > Date: Tue, 8 Apr 2014 11:51:12 +0200 > > From: s.rombetto at cib.na.cnr.it > > To: fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] denoising data > > Message-ID: < 20140408115112.cn1ddeuo840s8s84 at arco.cib.na.cnr.it > > > Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; > > format="flowed" > > Hi > > I am interested in this topic too. > > As I have mainly environmental noise I use denoise_pca but I would > > like to understand if with a different code I couold improve my S/N > > ratio. Moreover I would ask if there is any difference if you apply > > first one denoising procedure or the other. > > Regards > > Sara Rombetto, PhD > > > Hi Haiteng, > > > > > > Thanks for your reply. > > > > > > Just to be sure if I understand you correctly - do you use BOTH > > > denoise_pca and denoise_synthetic on the same data? > > > > > > If not, how do you choose which one to use? > > > > > > Cheers, > > > Ana > > > > > >> > > >> Dear Ana, > > >> > > >> > > >> If I understand correctly , we use ft_denoise_synthetic and > > >> ft_denoise_pca to reduce noise due to recording (e.g. environment > > >> noise , > > >> thermal noise... ) not the brain signal artefact (e.g eye blink). > > >> Normally > > >> ,I use these two functions in the very early stage . > > >> > > >> Best, > > >> Haiteng > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > ------------------------- > > Dott.ssa Sara Rombetto > > Istituto di Cibernetica > > "E. Caianiello" > > Via Campi Flegrei, 34 > > 80078 Pozzuoli (NA) > > Italy > > mob +39 3401689815 > > tel +39 0818675361 > > fax +39 0818675128 > > Lab MEG 0817483511 > > -------------------------- > > "I disapprove of what you say, but I will defend to the death your > > right to say > > it." [Evelyn Beatrice Hall, The Friends Of Voltaire] > > ---------------------------------------------------------------- > > This message was sent using IMP, the Internet Messaging Program. > > ------------------------------ > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 16 > > ***************************************** > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Tue Apr 8 15:56:09 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Tue, 8 Apr 2014 15:56:09 +0200 Subject: [FieldTrip] Investigating phase synchronisation in resting state eeg data Message-ID: Dear all, I'm investigating phase synchronisation on resting state eeg data. However, I'm not sure if what I'm doing is appropriate. It will be great if someone could help me on this. So, I've segmented my resting state data into smaller chunks of 10240 timepoints, which is approximately 2s per trial for my dataset. Since I'm mainly interested to know the phase changes at each frequency band, I thought the best way is to perform a mtmfft, using a hanning taper, with 'fourier' as output. I then performed a connectivity analysis on all the channels paired with all channels. Is this appropriate at all? Can one look at phase changes at each frequency band without taking account into time? Or should one look at phase changes at each frequency band along the temporal domain (time, in this case, it would be 2 s per trial)? Also, I noticed that there's the possibility to calculate phase locking value (PLV) and weighted paired wise consistency (WPPC). What are the differences between these two methods? As I'm interested to know which pair of channels are phase synchronised, how should I perform the statistical calculation? Also, how do I represent the data in this case, given that my reference channel is all against all channels? Thanks. Best regards, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.roux at bcbl.eu Tue Apr 8 16:06:36 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Tue, 8 Apr 2014 16:06:36 +0200 (CEST) Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs In-Reply-To: Message-ID: <39462649.1313399.1396965996516.JavaMail.root@bcbl.eu> Hi Diego, thanks for the quick reply. When I compute the rank of the concatenated trials I get rank(concat1) = 202, which is the number of channels that are in the data (planar gradiometers only). So in fact that number corresponds to the default output returned by ft_componentanalysis. Alos, I usually run ICA without PCA component reduction and can identify EOG and ECG quite easily by eye-balling. But, I'd like to figure out what the advantages of PCA reduction are. For instance, will reducing the number of ICs through PCA help to isolate better EOG and ECG components or will the decomposition be the same the only difference being that the algorithm will run faster? Best, Fred Frédéric Roux ----- Original Message ----- From: "Mauricio Antelis" To: "Diego Lozano" , "FieldTrip discussion list" Sent: Tuesday, April 8, 2014 3:36:42 PM Subject: Re: [FieldTrip] using cfg.runica.pca to reduce number of ICs Roberto, Aqui algo sobre el cuentionamiento del numero de componentes para realizar ICA, sin embargo en nuestro caso, creo que no sera un parametro sensible ya que tenemos un numero bajo (21) de mediciones Saludos Mauricio On Tue, Apr 8, 2014 at 8:29 AM, Lozano Soldevilla, D. (Diego) < d.lozanosoldevilla at fcdonders.ru.nl > wrote: Hi Fred, I don't know the magical number but I see the following options: a) Before ICA, concatenate all single trials and ask for the rank of your data. Use it as your cfg.runica.pca input. b) Some users notice that when you sort IC by variance, beyond component 30, the IC topo/activation does not look like physiologically meaningfull. It matches with the PCA reduction before ICA with other papers: http://www.ncbi.nlm.nih.gov/pubmed/15219593 http://www.ncbi.nlm.nih.gov/pubmed/19699307 Might be somebody in the forum have tried (by simulations or in real data) on the effects of PCA component reduction on ICA. I hope it helps, Diego ----- Original Message ----- > From: "Frédéric Roux" < f.roux at bcbl.eu > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > > Sent: Tuesday, 8 April, 2014 2:46:22 PM > Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs > Dear all, > > I have a general question relating to the usage of cfg.runica.pca > during the call to ft_componentanalysis. > > Is it correct to assume that cfg.runica.pca = length(meg_data.label) > will > force the algorithm to return n = length(meg_data.label) ICs, and that > as a > result artifacts can be "spread" across several ICs? > > If that's true, then I imagine that cfg.runica.pac = n/4 will return > less components > and reduce the "spread" of artifacts over several components. > > My question is how to choose the number of principal components to > which the data > is reduced before ICA? > > Best, > Fred > --------------------------------------------------------------------------- > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- PhD Student Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen NL-6525 EN Nijmegen The Netherlands http://www.ru.nl/people/donders/lozano-soldevilla-d/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Javier M. Antelis _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From gopalar.ccf at gmail.com Tue Apr 8 16:14:56 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Tue, 8 Apr 2014 10:14:56 -0400 Subject: [FieldTrip] regressconfound and timefrequency Message-ID: Arjen, Thanks for all your previous help on using regressconfound. It would be great if you can shed light on some questions I asked earlier (See below). Also, when applying regressconfound to time-frequency (TF) data, regressconfound removes variance from TF from individual trials. So, utimately regressconfound helps to improve the induced TF responses rather than evoked responses. (By induced, I mean calculating TF on trial by trial basis and then computing average, But evoked I mean calculating TF on averaged data) If one is interested in only evoked, then regressconfound would not be of much help. Is that correct? Thanks, Raghavan Date: Wed, 26 Feb 2014 11:38:23 -0500 From: Raghavan Gopalakrishnan To: fieldtrip at science.ru.nl Arjen, I agree with your steps and your assumptions about my data, though I am only interested in evoked activity. I am indeed doing the steps 1 and 2 in the correct order. I just kept the 4 blocks and confounds associated with them separate from each other (for book keeping purposes), but I used the mean head position of all 4 blocks to demean the translations and rotations in each block. Technically, I guess this is the same as appending the blocks prior to running regress confound. When I said, "However, the problem is, whatever significance I found earlier (i.e. by comparing means rather than t-statistic) doesn?t test significant now.? I was comparing the means of the data that has been run through regress confound. When I plot (sum square of all gradiometers in each subject in each condition) before and after regress confound, I see some differences. Should I not see any differences at all? But there is one catch. What do I do if I am comparing a condition across different time points, rather than 2 conditions in one time point? MEG collected at two different time points will have different average head positions. In that case, should I use one average head position (computed from time point - 1) and use that to demean the translations and rotations in rest of the time points? Thanks for your support. -- *Raghavan Gopalakrishnan,* *Principal Research Engineer, * *Cleveland Clinic* -------------- next part -------------- An HTML attachment was scrubbed... URL: From gopalar.ccf at gmail.com Mon Apr 7 18:59:33 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Mon, 7 Apr 2014 12:59:33 -0400 Subject: [FieldTrip] regressconfound Message-ID: Arjen, Thanks for all your previous help on using regressconfound. It would be great if you can shed light on some questions I asked earlier (See below). Also, when applying regressconfound to time-frequency (TF) data, regressconfound removes variance from TF from individual trials. So, utimately regressconfound helps to improve the induced TF responses rather than evoked responses. (By induced, I mean calculating TF on trial by trial basis and then computing average, But evoked I mean calculating TF on averaged data) If one is interested in only evoked, then regressconfound would not be of much help. Is that correct? Thanks, Raghavan Date: Wed, 26 Feb 2014 11:38:23 -0500 From: Raghavan Gopalakrishnan To: fieldtrip at science.ru.nl Subject: [FieldTrip] regressconfound and statistics Message-ID: Content-Type: text/plain; charset=windows-1252 Arjen, I agree with your steps and your assumptions about my data, though I am only interested in evoked activity. I am indeed doing the steps 1 and 2 in the correct order. I just kept the 4 blocks and confounds associated with them separate from each other (for book keeping purposes), but I used the mean head position of all 4 blocks to demean the translations and rotations in each block. Technically, I guess this is the same as appending the blocks prior to running regress confound. When I said, "However, the problem is, whatever significance I found earlier (i.e. by comparing means rather than t-statistic) doesn?t test significant now.? I was comparing the means of the data that has been run through regress confound. When I plot (sum square of all gradiometers in each subject in each condition) before and after regress confound, I see some differences. Should I not see any differences at all? But there is one catch. What do I do if I am comparing a condition across different time points, rather than 2 conditions in one time point? MEG collected at two different time points will have different average head positions. In that case, should I use one average head position (computed from time point - 1) and use that to demean the translations and rotations in rest of the time points? Thanks for your support. Raghavan -- -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Tue Apr 8 17:45:19 2014 From: d.lozanosoldevilla at fcdonders.ru.nl (Lozano Soldevilla, D. (Diego)) Date: Tue, 8 Apr 2014 17:45:19 +0200 (CEST) Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs In-Reply-To: <39462649.1313399.1396965996516.JavaMail.root@bcbl.eu> Message-ID: <2014237779.6280165.1396971919021.JavaMail.root@sculptor.zimbra.ru.nl> Hi Fred, This is a difficult question and I don't know the answer. Searching a bit more, I've found that some experts strongly do not recommend PCA before ICA with very good reasons: http://sccn.ucsd.edu/pipermail/eeglablist/2010/003339.html http://sccn.ucsd.edu/pipermail/eeglablist/2013/006101.html Another possibility (the one I'm using in my data) is to correlate the vertical EOG time courses (or the horizontal EOG) with all ICs. The rationale is that you want to find the independent component whose time courses are more similar to the EOG time courses. Then you can reduce the potential IC candidates that contain the prototypical artifacts using prior knowledge. You'll see that 2/3 of them show high correlations (in comparison with other ICs) with topographies that resemble blinks (or eye movements respectively). For ECG you can try the same strategy or use a very similar approach using coherence: http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts However, you should had recorded the ECG, vertical and horizontal EOGs, butI don't know if this is the case. If not, I'd recommend you to record them in future experiments (just by my own experience). Best, Diego ----- Original Message ----- > From: "Frédéric Roux" > To: "FieldTrip discussion list" > Sent: Tuesday, 8 April, 2014 4:06:36 PM > Subject: Re: [FieldTrip] using cfg.runica.pca to reduce number of ICs > Hi Diego, > > thanks for the quick reply. > > When I compute the rank of the concatenated trials I get rank(concat1) > = 202, which is the number of > channels that are in the data (planar gradiometers only). So in fact > that number corresponds to the default > output returned by ft_componentanalysis. > > Alos, I usually run ICA without PCA component reduction and can > identify EOG and ECG quite easily by > eye-balling. But, I'd like to figure out what the advantages of PCA > reduction are. > > For instance, will reducing the number of ICs through PCA help to > isolate better EOG and ECG components > or will the decomposition be the same the only difference being that > the algorithm will run faster? > > Best, > > Fred > > Frédéric Roux > > ----- Original Message ----- > From: "Mauricio Antelis" > To: "Diego Lozano" , "FieldTrip > discussion list" > Sent: Tuesday, April 8, 2014 3:36:42 PM > Subject: Re: [FieldTrip] using cfg.runica.pca to reduce number of ICs > > > > Roberto, > > > Aqui algo sobre el cuentionamiento del numero de componentes para > realizar ICA, sin embargo en nuestro caso, creo que no sera un > parametro sensible ya que tenemos un numero bajo (21) de mediciones > > > Saludos > > > Mauricio > > > > > > On Tue, Apr 8, 2014 at 8:29 AM, Lozano Soldevilla, D. (Diego) < > d.lozanosoldevilla at fcdonders.ru.nl > wrote: > > > Hi Fred, > > I don't know the magical number but I see the following options: > > a) Before ICA, concatenate all single trials and ask for the rank of > your data. Use it as your cfg.runica.pca input. > > b) Some users notice that when you sort IC by variance, beyond > component 30, the IC topo/activation does not look like > physiologically meaningfull. It matches with the PCA reduction before > ICA with other papers: > > http://www.ncbi.nlm.nih.gov/pubmed/15219593 > http://www.ncbi.nlm.nih.gov/pubmed/19699307 > > Might be somebody in the forum have tried (by simulations or in real > data) on the effects of PCA component reduction on ICA. > > I hope it helps, > > Diego > > ----- Original Message ----- > > From: "Frédéric Roux" < f.roux at bcbl.eu > > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > > > Sent: Tuesday, 8 April, 2014 2:46:22 PM > > Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs > > Dear all, > > > > I have a general question relating to the usage of cfg.runica.pca > > during the call to ft_componentanalysis. > > > > Is it correct to assume that cfg.runica.pca = length(meg_data.label) > > will > > force the algorithm to return n = length(meg_data.label) ICs, and > > that > > as a > > result artifacts can be "spread" across several ICs? > > > > If that's true, then I imagine that cfg.runica.pac = n/4 will return > > less components > > and reduce the "spread" of artifacts over several components. > > > > My question is how to choose the number of principal components to > > which the data > > is reduced before ICA? > > > > Best, > > Fred > > --------------------------------------------------------------------------- > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > PhD Student > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > NL-6525 EN Nijmegen > The Netherlands > http://www.ru.nl/people/donders/lozano-soldevilla-d/ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > > Javier M. Antelis > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- PhD Student Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen NL-6525 EN Nijmegen The Netherlands http://www.ru.nl/people/donders/lozano-soldevilla-d/ From a.stolk at fcdonders.ru.nl Tue Apr 8 18:16:37 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Tue, 8 Apr 2014 18:16:37 +0200 (CEST) Subject: [FieldTrip] regressconfound In-Reply-To: Message-ID: <1308756546.6280583.1396973797760.JavaMail.root@sculptor.zimbra.ru.nl> Hey Raghavan, You're welcome. A quick solution to set you in the right direction would be to point you to the respective documentation: http://www.sciencedirect.com/science/article/pii/S1053811912011597 I believe some, maybe most, of your points are addressed by that paper (saving some copy&pasting in here). best, Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: "fieldtrip" > Verzonden: Maandag 7 april 2014 18:59:33 > Onderwerp: [FieldTrip] regressconfound > Arjen, > Thanks for all your previous help on using regressconfound. > It would be great if you can shed light on some questions I asked > earlier (See below). > Also, when applying regressconfound to time-frequency (TF) data, > regressconfound removes variance from TF from individual trials. So, > utimately regressconfound helps to improve the induced TF responses > rather than evoked responses. (By induced, I mean calculating TF on > trial by trial basis and then computing average, But evoked I mean > calculating TF on averaged data) > If one is interested in only evoked, then regressconfound would not be > of much help. Is that correct? > Thanks, > Raghavan > Date: Wed, 26 Feb 2014 11:38:23 -0500 > From: Raghavan Gopalakrishnan < gopalar.ccf at gmail.com > > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] regressconfound and statistics > Message-ID: < A36DB35E-1C8A-4C8A-A0F3-083B8E1131C1 at gmail.com > > Content-Type: text/plain; charset=windows-1252 > Arjen , > I agree with your steps and your assumptions about my data, though I > am only interested in evoked activity. I am indeed doing the steps 1 > and 2 in the correct order. I just kept the 4 blocks and confounds > associated with them separate from each other (for book keeping > purposes), but I used the mean head position of all 4 blocks to demean > the translations and rotations in each block. Technically, I guess > this is the same as appending the blocks prior to running regress > confound. > When I said, "However, the problem is, whatever significance I found > earlier (i.e. by comparing means rather than t-statistic) doesn?t test > significant now.? I was comparing the means of the data that has been > run through regress confound. When I plot (sum square of all > gradiometers in each subject in each condition) before and after > regress confound, I see some differences. Should I not see any > differences at all? > But there is one catch. What do I do if I am comparing a condition > across different time points, rather than 2 conditions in one time > point? MEG collected at two different time points will have different > average head positions. In that case, should I use one average head > position (computed from time point - 1) and use that to demean the > translations and rotations in rest of the time points? > Thanks for your support. > Raghavan > -- > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Tue Apr 8 18:31:41 2014 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Tue, 8 Apr 2014 12:31:41 -0400 Subject: [FieldTrip] regressconfound In-Reply-To: References: Message-ID: Hello Raghavan, I am actually looking at GLM head motion correction method (FieldTrip regressconfound) with some phantom MEG data and found a few things that might be of interest to you: - the method is best for Evoked Response analysis as it requires trial averaging at the end of the correction (you want to average motion corrected data not data that has motion); the method works for the resting state too but with an error linearly increasing with the amount of motion - you should see differences in before and after regressconfound correction as the method re-aligns the waveforms for one (initial=averaged) head position; you will even see the differences if comparing true recordings (no motions) to recordings with the motion (which I did with the phantom) as the method is not perfect and can't possibly remove all motion confounds/effects completely - your question: "What do I do if I am comparing a condition across different time points, rather than 2 conditions in one time point?", my answer: I would use one (initial) averaged head position (for 1st trail for example) to compare, because you want to convert/correct your measurements for *relative comparison* and they should represent the same head position (for better statistical sensitivity). Arjen, Please correct me if I am mistaking. Cheers, Inna Wake Forest Baptist Health MEG lab Inna McGowin On Mon, Apr 7, 2014 at 12:59 PM, Raghavan Gopalakrishnan < gopalar.ccf at gmail.com> wrote: > Arjen, > > Thanks for all your previous help on using regressconfound. > It would be great if you can shed light on some questions I asked earlier > (See below). > Also, when applying regressconfound to time-frequency (TF) data, > regressconfound removes variance from TF from individual trials. So, > utimately regressconfound helps to improve the induced TF responses rather > than evoked responses. (By induced, I mean calculating TF on trial by trial > basis and then computing average, But evoked I mean calculating TF on > averaged data) > If one is interested in only evoked, then regressconfound would not be of > much help. Is that correct? > > Thanks, > Raghavan > > > > > > > Date: Wed, 26 Feb 2014 11:38:23 -0500 > From: Raghavan Gopalakrishnan > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] regressconfound and statistics > Message-ID: > Content-Type: text/plain; charset=windows-1252 > > Arjen, > > I agree with your steps and your assumptions about my data, though I am > only interested in evoked activity. I am indeed doing the steps 1 and 2 in > the correct order. I just kept the 4 blocks and confounds associated with > them separate from each other (for book keeping purposes), but I used the > mean head position of all 4 blocks to demean the translations and rotations > in each block. Technically, I guess this is the same as appending the > blocks prior to running regress confound. > > When I said, "However, the problem is, whatever significance I found > earlier (i.e. by comparing means rather than t-statistic) doesn?t test > significant now.? I was comparing the means of the data that has been run > through regress confound. When I plot (sum square of all gradiometers in > each subject in each condition) before and after regress confound, I see > some differences. Should I not see any differences at all? > > But there is one catch. What do I do if I am comparing a condition across > different time points, rather than 2 conditions in one time point? MEG > collected at two different time points will have different average head > positions. In that case, should I use one average head position (computed > from time point - 1) and use that to demean the translations and rotations > in rest of the time points? > > > Thanks for your support. > Raghavan > -- > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Wed Apr 9 09:21:24 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Wed, 9 Apr 2014 09:21:24 +0200 Subject: [FieldTrip] =?utf-8?q?Re=EF=BC=9AInvestigating_phase_synchronisat?= =?utf-8?q?ion_in_resting_state_eeg_data?= Message-ID: > > Dear Hwee, > In your case, you can calculate the phase consistency across trials at each frequency, thus , you don't temporal domain information within each trial. I recommend you to use imagery part of coherence since it is insensitive to the volume conduction . In FT . you can specify ft_connectivityanalysis with cfg.output = 'imag'. After this , you get chan*Chan connectivity matrix . Regarding to the statistic, you can do permutation test by randomize the time sequence within each trial 1000 times then calculate randomized chan*chan connectivity distribution. In the end ,you can use cluster-statistic framework to find the synchronized channel clusters. I don't know how to incorporate within FT. Hope it helps, Haiteng > Message: 7 > Date: Tue, 8 Apr 2014 15:56:09 +0200 > From: Hwee Ling Lee > To: FieldTrip discussion list > Subject: [FieldTrip] Investigating phase synchronisation in resting > state eeg data > Message-ID: > Z-zVfb2S-Zovo8_k9pw at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Dear all, > > I'm investigating phase synchronisation on resting state eeg data. However, > I'm not sure if what I'm doing is appropriate. It will be great if someone > could help me on this. > > So, I've segmented my resting state data into smaller chunks of 10240 > timepoints, which is approximately 2s per trial for my dataset. > > Since I'm mainly interested to know the phase changes at each frequency > band, I thought the best way is to perform a mtmfft, using a hanning taper, > with 'fourier' as output. I then performed a connectivity analysis on all > the channels paired with all channels. Is this appropriate at all? Can one > look at phase changes at each frequency band without taking account into > time? Or should one look at phase changes at each frequency band along the > temporal domain (time, in this case, it would be 2 s per trial)? > > > Also, I noticed that there's the possibility to calculate phase locking > value (PLV) and weighted paired wise consistency (WPPC). What are the > differences between these two methods? As I'm interested to know which pair > of channels are phase synchronised, how should I perform the statistical > calculation? Also, how do I represent the data in this case, given that my > reference channel is all against all channels? > > Thanks. > > Best regards, > Hweeling > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/96bf9c22/attachment.html > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 18 > ***************************************** > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From marlene.boenstrup at googlemail.com Wed Apr 9 10:35:16 2014 From: marlene.boenstrup at googlemail.com (=?ISO-8859-1?Q?Marlene_B=F6nstrup?=) Date: Wed, 9 Apr 2014 10:35:16 +0200 Subject: [FieldTrip] surfaceplot made by ft_sourceplot sparing the frontal lobes Message-ID: Dear Arjen, I followed your advice to use the most recent version of fieldtrip again for checking the update on ft_sourceplot . But the one of Monday and Tuesday (7th and 8th) don't seem to work. I can't unzip them, the file is apparently invalid. Would it be possible to send me the updated ft_sourceplot function until the problem with the serverversion is fixed? Best, Marlene -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Wed Apr 9 11:12:52 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Wed, 9 Apr 2014 11:12:52 +0200 (CEST) Subject: [FieldTrip] surfaceplot made by ft_sourceplot sparing the frontal lobes In-Reply-To: Message-ID: <94880540.6290098.1397034772571.JavaMail.root@sculptor.zimbra.ru.nl> Hi Marlene, Yes, that would be a good idea indeed, see attached. However, no guarantee that it would work as functions typically depend on other functionalities. But have a try, and see if it fixes your issue. If the issue is still there, it might be unrelated to that particular fix, and it may be worth reporting its as a potential bug, with sufficient information for replicating your steps . See some useful documentation below. where to report: http://bugzilla.fcdonders.nl/ how to report: http://fieldtrip.fcdonders.nl/bugzilla best, Arjen ----- Oorspronkelijk bericht ----- > Van: "Marlene Bönstrup" > Aan: fieldtrip at science.ru.nl > Verzonden: Woensdag 9 april 2014 10:35:16 > Onderwerp: [FieldTrip] surfaceplot made by ft_sourceplot sparing the > frontal lobes > Dear Arjen, > I followed your advice to use the most recent version of fieldtrip > again for checking the update on ft_sourceplot . But the one of Monday > and Tuesday (7th and 8th) don't seem to work. I can't unzip them, the > file is apparently invalid. Would it be possible to send me the > updated ft_sourceplot function until the problem with the > serverversion is fixed? > Best, Marlene > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ft_sourceplot.m Type: text/x-matlab Size: 62372 bytes Desc: not available URL: From r.oostenveld at donders.ru.nl Wed Apr 9 14:32:42 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 9 Apr 2014 14:32:42 +0200 Subject: [FieldTrip] Zip file of yesterday's version seems to be corrupted (2014-04-07) In-Reply-To: <201404081511.46850.Holger.Krause@med.uni-duesseldorf.de> References: <201404081511.46850.Holger.Krause@med.uni-duesseldorf.de> Message-ID: Hi Holger and Marlene The zip file was indeed corrupt, due to the file system getting too full. I have removed the zipfile and checked all others that are now there, they all seem fine to me. I hope you can live without the 20140407 and that the later versions work. For all people that do very regular updates of fieldtrip, please do consider svn or git as alternatives to ftp. Those are shortly described (with additional pointes to other documentation) on http://fieldtrip.fcdonders.nl/faq/i_am_having_problems_downloading_from_the_ftp_server. best regards, Robert On 08 Apr 2014, at 15:11, Holger Krause wrote: > Hi, > > Yesterday night my script for downloading the latest fieldtrip version failed. > Today I manually downloaded > , of which the > md5sum is 7ebc176eedc038581d17ecbb46bd0832. > > zipinfo complains about invalid archive: > > $ zipinfo fieldtrip-20140407.zip > Archive: fieldtrip-20140407.zip > Zip file size: 296098459 bytes, number of entries: 8079 > error [fieldtrip-20140407.zip]: start of central directory not found; > zipfile corrupt. > > Other users seem to be affected as well (see Marlene Bönstrup's mail from > today.) > > BR, > > Holger > > -- > Dr. rer. nat. Holger Krause MEG-Labor, Raum 13.54.-1.84 > Telefon: +49 211 81-19031 Institut für klinische Neurowissenschaften > http://www.uniklinik-duesseldorf.de/klinneurowiss Uniklinik Düsseldorf > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From r.vandermeij at donders.ru.nl Thu Apr 10 12:01:29 2014 From: r.vandermeij at donders.ru.nl (Roemer van der Meij) Date: Thu, 10 Apr 2014 12:01:29 +0200 Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs In-Reply-To: <591175772.1312154.1396961182187.JavaMail.root@bcbl.eu> References: <591175772.1312154.1396961182187.JavaMail.root@bcbl.eu> Message-ID: Hi Fred, cfg.runica.pca sets cfg.numcomponent for runica (corrected in revision on ft tonight). If you use ICA to remove artifacts for subsequent analyses, please keep in mind that any structure not covered by the extracted components is lost. As such, I would advice you to extract the maximum number of components, or if to computationally expensive, the number of components that explain, say, 99% of the variance of the covariance matrix. You can do this for example by: % determine cfg.numcomponent by doing an eig on the covariance matrix covar = zeros(numel(data.label)); for itrial = 1:numel(data.trial) currtrial = data.trial{itrial}; covar = covar + currtrial*currtrial.'; end [V, D] = eig(covar); D = sort(diag(D),'descend'); D = D ./ sum(D); Dcum = cumsum(D); cfg.numcomponent = find(Dcum>.99,1,'first'); Best, Roemer On Tue, Apr 8, 2014 at 2:46 PM, Frédéric Roux wrote: > Dear all, > > I have a general question relating to the usage of cfg.runica.pca > during the call to ft_componentanalysis. > > Is it correct to assume that cfg.runica.pca = length(meg_data.label) will > force the algorithm to return n = length(meg_data.label) ICs, and that as a > result artifacts can be "spread" across several ICs? > > If that's true, then I imagine that cfg.runica.pac = n/4 will return less > components > and reduce the "spread" of artifacts over several components. > > My question is how to choose the number of principal components to which > the data > is reduced before ICA? > > Best, > Fred > --------------------------------------------------------------------------- > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Roemer van der Meij M.Sc. PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3655932 E-mail: r.vandermeij at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From gopalar.ccf at gmail.com Thu Apr 10 22:15:44 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Thu, 10 Apr 2014 16:15:44 -0400 Subject: [FieldTrip] artifact routines - cfg.trl Message-ID: Dear all, When detecting artifacts in EEG data, all the folllowing routines requires cfg.trl to be specified ft_artifact_eog, ft_artifact_muscle and ft_artifact_threshold. However, if I have the data already parsed into trials, i.e. run through ft_preprocessing, can I run these above mentioned routines? I see ft_artifact_zvalue does not require the cfg.trl field, but all others (mentioned above) do? Can this be addressed. Please advise. Thanks, Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Fri Apr 11 00:28:28 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Thu, 10 Apr 2014 22:28:28 +0000 Subject: [FieldTrip] artifact routines - cfg.trl In-Reply-To: References: Message-ID: <6C755E38-CB80-403F-A2EC-8DE32DF1AE6D@flinders.edu.au> I don't know I this will help but I found that the making cfg.trl = [data.sample info, 0] to work fine. How have you found the artefact correction algorithms? I've noticed that some take out unnecessary segments of EEG. Kin regards, Tyler > On 11 Apr 2014, at 5:47 am, "Raghavan Gopalakrishnan" wrote: > > Dear all, > > When detecting artifacts in EEG data, all the folllowing routines requires cfg.trl to be specified > ft_artifact_eog, ft_artifact_muscle and ft_artifact_threshold. > However, if I have the data already parsed into trials, i.e. run through ft_preprocessing, can I run these above mentioned routines? > I see ft_artifact_zvalue does not require the cfg.trl field, but all others (mentioned above) do? Can this be addressed. > Please advise. > > Thanks, > Raghavan > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tyler.grummett at flinders.edu.au Fri Apr 11 04:38:01 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Fri, 11 Apr 2014 02:38:01 +0000 Subject: [FieldTrip] TRENTOOL bad channel combinations Message-ID: ?Hello fieldtrip, Has anyone worked out how to handle bad channel combinations in TRENTOOL using TEprepare? In my experience it just crashes. I am hoping for a way to calculate the bad channel combinations before running TEprepare. If anyone can help, that will be greatly appreciated!! Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patricia.Wollstadt at gmx.de Fri Apr 11 11:12:23 2014 From: Patricia.Wollstadt at gmx.de (Patricia Wollstadt) Date: Fri, 11 Apr 2014 11:12:23 +0200 Subject: [FieldTrip] TRENTOOL bad channel combinations In-Reply-To: References: Message-ID: <5347B1F7.1080303@gmx.de> Hello Tyler, TRENTOOL does not support the exclusion of channels like FieldTrip does (e.g. {'all', '-MLx', '-EOG'}), you have to explicitly specify channels OR combinations of channels for analysis in the cfg structure passed to TEprepare: % cfg.sgncmb = list of channelpairs cell array (Nx(source, target)) % or % cfg.channel = list of channels cell array - testing will be done all-by-all If you provide a list of channel combinations in cfg.sgncmb, TRENTOOL will analyze these combinations only; if you provide a list of channels in cfg.channel, TEprepare will build all possible channel combinations from the list and TRENTOOL will analyze these combinations. (Also, channel names have to match the channel labels in data.label.) So, a way to exclude bad channel combinations would be to provide a list of all channels that should be included in the analysis in cfg.channel and let TEprepare build the channel combinations from that. I hope this answers your question. Please let me know if you encounter any more problems. Best, Patricia On 04/11/2014 04:38 AM, Tyler Grummett wrote: > > Hello fieldtrip, > > > Has anyone worked out how to handle bad channel combinations in > TRENTOOL using TEprepare? > > > In my experience it just crashes. I am hoping for a way to calculate > the bad channel combinations before running TEprepare. > > > If anyone can help, that will be greatly appreciated!! > > > Tyler > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip ------------------------------------------------------------ Patricia Wollstadt, PhD Student MEG Unit, Brain Imaging Center Goethe University, Frankfurt, Germany Heinrich Hoffmann Strasse 10, Haus 93 B D - 60528 Frankfurt am Main -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Fri Apr 11 11:36:29 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Fri, 11 Apr 2014 09:36:29 +0000 Subject: [FieldTrip] append trials after artefact correction Message-ID: <1e1f1c2ba0864d8c86dd3dd6a22a106c@SIXPR03MB368.apcprd03.prod.outlook.com> ?Hello everyone, Is there any way to append trials after running artefact correction algorithms that break the data up into trials. It has issues in later calculations, such as transfer entropy in TRENTOOL Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Fri Apr 11 12:44:45 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Fri, 11 Apr 2014 10:44:45 +0000 Subject: [FieldTrip] TRENTOOL bad channel combinations In-Reply-To: <5347B1F7.1080303@gmx.de> References: , <5347B1F7.1080303@gmx.de> Message-ID: ?Hello Patricia, I have previously selected the channels that are EEG, I am not entering in 'EEG' or anything. cfgTEP = []; cfgTEP.Path2TSTOOL = fullfile( matlabrootpath, 'Matlab', 'OpenTSTOOL'); % dont add this to matlab path cfgTEP.toi = [ min( [vchan.time{ :}]), max( [vchan.time{ :}])]; cfgTEP.channel = vchan.label( comps);? After playing around with it for a bit I dont think it is the channel combinations, but the data. If I can ask a separate question, what is an optimal length for the trials? My trials are about 500 ms long and it gives me the following error: Error using TEprepare (line 710) TRENTOOL ERROR: Not enough points in timeseries for current analysis settings: cfg.repPred too big, or max(cfg.ragdim)*max(cfg.ragtaurange) too big, or maximum u to big It is recommended that the cfgTEP.repPred is size(data.trial{1,1},2)*(3/4) However it only works for me if it is size(data.trial{1,1},2)*(3/9)?. Then it runs fine, but Im worried about changing this. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Patricia Wollstadt Sent: Friday, 11 April 2014 6:42 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] TRENTOOL bad channel combinations Hello Tyler, TRENTOOL does not support the exclusion of channels like FieldTrip does (e.g. {'all', '-MLx', '-EOG'}), you have to explicitly specify channels OR combinations of channels for analysis in the cfg structure passed to TEprepare: % cfg.sgncmb = list of channelpairs cell array (Nx(source, target)) % or % cfg.channel = list of channels cell array - testing will be done all-by-all If you provide a list of channel combinations in cfg.sgncmb, TRENTOOL will analyze these combinations only; if you provide a list of channels in cfg.channel, TEprepare will build all possible channel combinations from the list and TRENTOOL will analyze these combinations. (Also, channel names have to match the channel labels in data.label.) So, a way to exclude bad channel combinations would be to provide a list of all channels that should be included in the analysis in cfg.channel and let TEprepare build the channel combinations from that. I hope this answers your question. Please let me know if you encounter any more problems. Best, Patricia On 04/11/2014 04:38 AM, Tyler Grummett wrote: ?Hello fieldtrip, Has anyone worked out how to handle bad channel combinations in TRENTOOL using TEprepare? In my experience it just crashes. I am hoping for a way to calculate the bad channel combinations before running TEprepare. If anyone can help, that will be greatly appreciated!! Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip ------------------------------------------------------------ Patricia Wollstadt, PhD Student MEG Unit, Brain Imaging Center Goethe University, Frankfurt, Germany Heinrich Hoffmann Strasse 10, Haus 93 B D - 60528 Frankfurt am Main -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at fcdonders.ru.nl Fri Apr 11 12:48:11 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Fri, 11 Apr 2014 12:48:11 +0200 (CEST) Subject: [FieldTrip] Question re: TMS-EEG FT Tutorial In-Reply-To: References: Message-ID: <003701cf5573$886ba630$9942f290$@herring@fcdonders.ru.nl> Dear Bingshuo, I am forwarding your e-mail to the Fieldtrip mailinglist so that others can benefit and/or contribute from our discussion. The reason why I like to postpone the interpolation to after the ICA is that I noticed that when interpolating before ICA the interpolated data would load onto one component. Removing this component did not make sense as it would leave a flat line in the TEP, keeping it in did not make sense either because the interpolation was done with, for example, the decay artifact still in the data. After removing the decay artifact with ICA you would be left with a sharp peak in the interpolated segment. I see that it is difficult to reject trials and channels before interpolation but keep in mind that before having done ICA large amounts of variance of the data can be explained by the TMS related artifacts, these will most likely cloud the detection of other types of artifacts with functions such as ft_rejectvisual. In my experience bad channels show up as separate independent components anyway and can be removed after having run the ICA, but that may depend on a number of factors I'm not aware of. If you would like to reject bad channels prior to running ICA you could also try to run ft_rejectvisual and specify cfg.latency to contain only your pre-TMS period or a period post-TMS that does not contain any large artifacts. That way you should at least be able to run metrics on your data to remove bad channels. In any case you can always run ft_databrowser on your data to visually inspect your channel time courses for bad channels prior to running the ICA. In any case you are of course free to try running the ICA after interpolation yourself and share your experiences, perhaps this works fine for you J Best, Jim From: Bingshuo Li [mailto:bingshuo.li at cin.uni-tuebingen.de] Sent: donderdag 10 april 2014 16:36 To: j.herring at fcdonders.ru.nl Subject: Question re: TMS-EEG FT Tutorial Dear Jim, I inquired you about a TMS-EEG question a while ago and you referred me to the TMS-EEG tutorial on Fieldtrip's website. As I was following the steps of the tutorial, there is a new question that come up to me -- Is it really necessary to postpone the interpolation of the TMS artifact until the ICA is done? Would there be any bad consequences if I interpolate first and then run the ICA over the entire interpolated trial(s)? The reason I am asking this question is that I would like to visually inspect my data first and remove bad channels or trials (if any) prior to ICA. If the artifact is not interpolated, it is really difficult to run visual inspection or metrics on the data.. Following the logic of the tutorial, I can only visual inspection after the ICA, which I think might not be a good idea as I was told that a bad channel can easily bias the ICA result.. Do you have any insights in this? Thank you very much for your time in advance! Sincerely, ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at cin.uni-tuebingen.de +49-7071-29-89029 On Mon, Feb 10, 2014 at 3:24 PM, Herring, J.D. (Jim) wrote: Dear Bingshuo, Please have a look at the following tutorial: http://fieldtrip.fcdonders.nl/tutorial/tms-eeg It deals with a number of TMS-EEG related artifacts including the 'evil' decay artifact. Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Bingshuo Li Sent: maandag 10 februari 2014 15:06 To: FieldTrip discussion list Subject: [FieldTrip] TMS-EEG Decay Artifact Dear FT users and developers, Does anyone have any experience in dealing with the so-called decay artifacts found in TMS-EEG? It is a relatively long lasting (up to 100ms) artifact that follows a waveform similar to exponential decay and it occurs sporadically in certain recording channels. Any tips/hints/recommendations are greatly appreciated! Thank you! Regards, ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at student.uni-tuebingen.de +49-152-06054831 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.hasanzadeh22 at yahoo.com Fri Apr 11 15:09:04 2014 From: f.hasanzadeh22 at yahoo.com (=?utf-8?B?4oCqRi5IYXNhbnphZGXigKwg4oCq?=) Date: Fri, 11 Apr 2014 14:09:04 +0100 (BST) Subject: [FieldTrip] (no subject) Message-ID: <1397221744.51555.YahooMailNeo@web171305.mail.ir2.yahoo.com> f.hasanzadeh22 at yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.hasanzadeh22 at yahoo.com Fri Apr 11 15:24:54 2014 From: f.hasanzadeh22 at yahoo.com (=?utf-8?B?4oCqRi5IYXNhbnphZGXigKwg4oCq?=) Date: Fri, 11 Apr 2014 14:24:54 +0100 (BST) Subject: [FieldTrip] a question Message-ID: <1397222694.1541.YahooMailNeo@web171304.mail.ir2.yahoo.com> Dear community, My name is Fateme Hasanzade and I am working on EEG signals. Currently I am analysing data of a project, where we recorded using EEG.I have a data such that every channel has 1 value that is result of some calculation(I mean I have 14 channel thus a data vector of length14).I want to plot map of head how  every channel has a color corresponding its  value... I tried using  ft_topoplotER to assess my data and I made the true layout but when I want to use ft_topoplotER receive the following error message:  Subscript indices must either be real positive integers or logicals. Error in topoplot_common (line 79) data = varargin{indx}; Error in ft_topoplotER (line 169) cfg = topoplot_common(cfg, varargin{:}); Error in top (line 19) figure; ft_topoplotER(cfg,data); colorbar;  my quetion is how should I give this data  to function to  have true topographic plot of my data? Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patricia.Wollstadt at gmx.de Fri Apr 11 17:36:21 2014 From: Patricia.Wollstadt at gmx.de (Patricia Wollstadt) Date: Fri, 11 Apr 2014 17:36:21 +0200 Subject: [FieldTrip] TRENTOOL bad channel combinations In-Reply-To: References: , <5347B1F7.1080303@gmx.de> Message-ID: <53480BF5.1020800@gmx.de> Hello Tyler, okay, I'd say the script should run like this (regarding channel selection). Maybe it's really the data then. If you keep getting errors, you can send me those as well. Regarding the number of data points: The error you are getting depends on a number of parameters TEprepare uses to determine the optimal embedding dimension and embedding delay. TEprepare checks whether you have enough samples in one trial after taking into account the ACT, cfg.actthrvalue, cfg.ragdim, cfg.ragtau and the assumed interaction delay (these parameters determine the maximum possible length, i.e. the worst case, of your embedding). Could you tell me the sampling rate of your data? If your data was sampled at 1000Hz, 3/9th of 500 ms should give you about 167 sample points for cfg.repPred, which would be okay. Otherwise, you may alter the parameters mentioned above, e.g. you can check whether you could lower the actthrvalue. The actthrvalue is used to exclude all trials with an ACT higher than the threshold. The value you put in there should be based on the filtering of the data prior to TE analysis (e.g. if you highpass filter your data at 10 Hz and have a sampling rate of 1000Hz, you shouldn't find any autocorrelation above 100 samples. In that case, you may use 100 as a threshold). What values do you enter for the other parameters (assumed interaction delay u, specified in cfg.predicttimemin_u/cfg.predicttimemax_u, embedding parameters to be scanned in cfg.ragdim and cfg.ragtau)? Maybe you can adjust those as well, to be able to enter a higher value for .repPred. Best, Patricia On 04/11/2014 12:44 PM, Tyler Grummett wrote: > > Hello Patricia, > > > I have previously selected the channels that are EEG, I am not > entering in 'EEG' or anything. > > > cfgTEP = []; > cfgTEP.Path2TSTOOL = fullfile( matlabrootpath, 'Matlab', > 'OpenTSTOOL'); % dont add this to matlab path > cfgTEP.toi = [ min( [vchan.time{ :}]), max( [vchan.time{ > :}])]; > cfgTEP.channel = vchan.label( comps); > > > After playing around with it for a bit I dont think it is the channel > combinations, but the data. > > > If I can ask a separate question, what is an optimal length for the > trials? My trials are about 500 ms long and it gives me the following > error: > > > Error using TEprepare (line 710) > TRENTOOL ERROR: Not enough points in timeseries for current analysis > settings: cfg.repPred too big, or > max(cfg.ragdim)*max(cfg.ragtaurange) too big, or maximum u to big > > It is recommended that the cfgTEP.repPred is size(data.trial{1,1},2)*(3/4) > > However it only works for me if it is size(data.trial{1,1},2)*(3/9) . > > Then it runs fine, but Im worried about changing this. > > Tyler > > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > ------------------------------------------------------------------------ > *From:* fieldtrip-bounces at science.ru.nl > on behalf of Patricia Wollstadt > > *Sent:* Friday, 11 April 2014 6:42 PM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] TRENTOOL bad channel combinations > > Hello Tyler, > > TRENTOOL does not support the exclusion of channels like FieldTrip > does (e.g. {'all', '-MLx', '-EOG'}), you have to explicitly specify > channels OR combinations of channels for analysis in the cfg structure > passed to TEprepare: > > % cfg.sgncmb = list of channelpairs cell array (Nx(source, target)) > % or > % cfg.channel = list of channels cell array - testing will be > done all-by-all > > If you provide a list of channel combinations in cfg.sgncmb, TRENTOOL > will analyze these combinations only; if you provide a list of > channels in cfg.channel, TEprepare will build all possible channel > combinations from the list and TRENTOOL will analyze these > combinations. (Also, channel names have to match the channel labels in > data.label.) > > So, a way to exclude bad channel combinations would be to provide a > list of all channels that should be included in the analysis in > cfg.channel and let TEprepare build the channel combinations from that. > > I hope this answers your question. Please let me know if you encounter > any more problems. > > Best, > Patricia > > > > On 04/11/2014 04:38 AM, Tyler Grummett wrote: >> >> Hello fieldtrip, >> >> >> Has anyone worked out how to handle bad channel combinations in >> TRENTOOL using TEprepare? >> >> >> In my experience it just crashes. I am hoping for a way to calculate >> the bad channel combinations before running TEprepare. >> >> >> If anyone can help, that will be greatly appreciated!! >> >> >> Tyler >> >> >> ************************* >> >> /Tyler Grummett ( BBSc, BSc(Hons I))/ >> /PhD Candidate/ >> /Brain Signals Laboratory/ >> /Flinders University/ >> /Rm 5A301/ >> /Ext 66124/ >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > ------------------------------------------------------------ > > Patricia Wollstadt, PhD Student > > MEG Unit, Brain Imaging Center > > Goethe University, Frankfurt, Germany > > Heinrich Hoffmann Strasse 10, Haus 93 B > > D - 60528 Frankfurt am Main > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- ------------------------------------------------------------ Patricia Wollstadt, PhD Student MEG Unit, Brain Imaging Center Goethe University, Frankfurt, Germany Heinrich Hoffmann Strasse 10, Haus 93 B D - 60528 Frankfurt am Main -------------- next part -------------- An HTML attachment was scrubbed... URL: From politzerahless at gmail.com Sat Apr 12 12:24:32 2014 From: politzerahless at gmail.com (Stephen Politzer-Ahles) Date: Sat, 12 Apr 2014 14:24:32 +0400 Subject: [FieldTrip] a question Message-ID: Hello Fateme, I believe ft_topoplotER needs its input to be a Fieldtrip data structure that is the output of ft_timelockanalysis (i.e., the structure includes an 'avg' field that is a channels x timepoints matrix, and in the fall to ft_topoplotER you specify cfg.param='avg'). It sounds like your pinput is not a structure like this, but is a 1-dimensional vector. You can plot a vector like this pretty easily using the topoplot() function of the EEGLAB toolbox. (There may also be ways to do it in Fieldtrip but I'm not aware of them; I've only ever used ft_topoplotER with a timelock structure. Someone else on the list might know some tricks, though). Best, Steve Stephen Politzer-Ahles New York University, Abu Dhabi Neuroscience of Language Lab http://www.nyu.edu/projects/politzer-ahles/ > > ------------------------------ > > Message: 4 > Date: Fri, 11 Apr 2014 14:24:54 +0100 (BST) > From: ?F.Hasanzade? ? > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] a question > Message-ID: > <1397222694.1541.YahooMailNeo at web171304.mail.ir2.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Dear community, > My name is Fateme Hasanzade and I am working on EEG signals. > Currently I am analysing data of a project, where we recorded using EEG.I > have a data such that every channel has 1 value that is result of some > calculation(I mean I have 14 channel thus a data vector of length14).I want > to plot map of head how? every channel has a color corresponding its? > value... > > > I tried using? ft_topoplotER to assess my data and I made the true layout > but when I want to use ft_topoplotER receive the following error message:? > > Subscript indices must either be real positive integers or logicals. > > Error in topoplot_common (line 79) > data = varargin{indx}; > > Error in ft_topoplotER (line 169) > cfg = topoplot_common(cfg, varargin{:}); > > Error in top (line 19) > figure; ft_topoplotER(cfg,data); colorbar;? > > my quetion is how should I give this data? to function to? have true > topographic plot of my data? > > > Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Sat Apr 12 13:18:00 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Sat, 12 Apr 2014 13:18:00 +0200 Subject: [FieldTrip] a question In-Reply-To: References: Message-ID: <534920E8.8060003@donders.ru.nl> Hi Fateme, in addition to what Stephen said, it might help if you provide more insight into what you are doing by including the function call, this includes: * The cfg you used * The fields of your data structure * The line you called that gave an error / that you would like to ask a question on * The exact error message you got see also http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community also, check out our wiki and make use of the search functionality. There might be some FAQs and example scripts that are useful for you, e.g. http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat?s[]=import Hope any of this helps! Best, Jörn On 4/12/2014 12:24 PM, Stephen Politzer-Ahles wrote: > > Hello Fateme, > > I believe ft_topoplotER needs its input to be a Fieldtrip data > structure that is the output of ft_timelockanalysis (i.e., the > structure includes an 'avg' field that is a channels x timepoints > matrix, and in the fall to ft_topoplotER you specify cfg.param='avg'). > It sounds like your pinput is not a structure like this, but is a > 1-dimensional vector. > > You can plot a vector like this pretty easily using the topoplot() > function of the EEGLAB toolbox. (There may also be ways to do it in > Fieldtrip but I'm not aware of them; I've only ever used ft_topoplotER > with a timelock structure. Someone else on the list might know some > tricks, though). > > Best, > Steve > > > Stephen Politzer-Ahles > New York University, Abu Dhabi > Neuroscience of Language Lab > http://www.nyu.edu/projects/politzer-ahles/ > > > ------------------------------ > > Message: 4 > Date: Fri, 11 Apr 2014 14:24:54 +0100 (BST) > From: ?F.Hasanzade? ? > > To: "fieldtrip at science.ru.nl " > > > Subject: [FieldTrip] a question > Message-ID: > <1397222694.1541.YahooMailNeo at web171304.mail.ir2.yahoo.com > > > Content-Type: text/plain; charset="utf-8" > > Dear community, > My name is Fateme Hasanzade and I am working on EEG signals. > Currently I am analysing data of a project, where we recorded > using EEG.I have a data such that every channel has 1 value that > is result of some calculation(I mean I have 14 channel thus a data > vector of length14).I want to plot map of head how? every channel > has a color corresponding its? value... > > > I tried using? ft_topoplotER to assess my data and I made the true > layout but when I want to use ft_topoplotER receive the following > error message:? > > Subscript indices must either be real positive integers or logicals. > > Error in topoplot_common (line 79) > data = varargin{indx}; > > Error in ft_topoplotER (line 169) > cfg = topoplot_common(cfg, varargin{:}); > > Error in top (line 19) > figure; ft_topoplotER(cfg,data); colorbar;? > > my quetion is how should I give this data? to function to? have > true topographic plot of my data? > > > Thank you > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jan.schoffelen at donders.ru.nl Sat Apr 12 21:03:52 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Sat, 12 Apr 2014 21:03:52 +0200 Subject: [FieldTrip] ft_sourceplot: issue with cfg.method = 'surface' Message-ID: <752EAE5A-22C3-4050-AEEA-E2FF07E81042@donders.ru.nl> Dear fieldtrippers, Despite our best efforts, there has been an inconvenient bug in ft_sourceplot, which has been present in r9031-r9400 (Dec 13, 2013-April 12,2014). In particular, the images constructed when using cfg.method = 'surface' were incorrect. The issue pertains to the on-the-fly interpolation onto a cortical sheet of volumetrically (i.e. on a 3D grid) source-reconstructed data. I updated the cortical sheets last December, and replaced the handcrafted exemplars by the ones from the SPM surfrend toolbox. The motivation for all this would be to have a better reference to the actual data used. The bottom line of all this is that I made a mistake, and directly used the surfaces loaded from the Freesurfer file format, without taking into account the fact that in the Freesurfer convention the coordinate system in these files is slightly different than standard space. As a consequence these surfaces were misregistered to the 3D anatomical image in standard space, and thus to incorrect interpolations of the functional data onto these surfaces. This issue has been identified thanks to Marlene Bönstrup and has been fixed today. Any sourceplots with cfg.method = 'surface' that have been made with FieldTrip versions originating from between the dates mentioned above will incorrectly represent the source reconstructed data, and may need to be re-done. More info can be found on http://fieldtrip.fcdonders.nl/template/anatomy. I am very sorry for any inconvenience this may have caused. Best wishes, Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Mon Apr 14 03:53:10 2014 From: v.piai.research at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Piai?=) Date: Sun, 13 Apr 2014 18:53:10 -0700 Subject: [FieldTrip] freqstatistics with sbj_chan_freq Message-ID: <534B3F86.9070904@gmail.com> Hi all, I'm kinda stuck not being able to figure out what's going wrong with my freqstats, so I thought I could share it here and see if anyone can see where I'm going wrong. When I run freqstatistics on TFRs, I get a negative cluster (p = .001) between 8 and 25 Hz with the topography very similar to the one in the figure. But I just want non-time-resolved spectra. So I have power spectra calculated with mtmfft (dpss tapers) between 1 and 50 Hz (5 Hz smoothing) and this is the one for which I've been trying to run freqstatistics, unsuccessfully. I'm using a pretty standard cfg for freqstats (basically, the same I use for the TFRs, which give me the negative cluster with p =.001) and the data in the comparison are structured as sbj_chan_freq. With this time-unresolved data, only posclusters are detected, with ps > .4! If I plot the stat output, it has the exact same negative cluster as I get for the TFRs (see Figure), and as far as I can see, no real positive cluster, but the function doesn't even detect any negative clusters. I must be doing something wrong because the time-resolved and -unresolved effects are pretty much the same in the descriptives. I remember running stats on time-unresolved data before and getting a reasonable output, so I guess my ft_freqstatistics isn't working well right now. I just can't figure out why. Does anyone have any tips for how I could go about to find out why the negative clusters are being disregarded? Thanks a lot, Vitória -------------- next part -------------- A non-text attachment was scrubbed... Name: freqstats.gif Type: image/gif Size: 28839 bytes Desc: not available URL: From tyler.grummett at flinders.edu.au Mon Apr 14 04:54:16 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 14 Apr 2014 02:54:16 +0000 Subject: [FieldTrip] automatic artifact correction after virtual channels/beamformer Message-ID: ?Hello all, I was just wondering whether it is necessary to use the artifact corrected data when creating virtual channels from beamformer sources or whether you are able to use original, non-artifact corrected data. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Mon Apr 14 06:37:45 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 14 Apr 2014 04:37:45 +0000 Subject: [FieldTrip] TRENTOOL bad channel combinations In-Reply-To: <53480BF5.1020800@gmx.de> References: , <5347B1F7.1080303@gmx.de> , <53480BF5.1020800@gmx.de> Message-ID: Hello Patricia, To answer your questions, yes my sampling rate is 1000Hz. Some additional details about my data: I am analysing continuous data from 10 subjects (as a test). One of the tasks they did is approximately 3 minutes. I have been marking out the data ( which breaks the data up into trials) and then taking a one second epoch from each of the trials. What is the smallest length of data (in seconds) that transfer entropy can be run on? ​Should I leave it as one long length of data? The inherent problem with that is the various trial lengths, I am fairly sure that TEprepare crashes if the trials are of a various length. Interestingly, the function doesnt crash on data that I have artefact corrected (1-second trials) and on sources that explain more than 95% of the variance (after applying beamformer and PCA). For example, if I had 1400 brain sources (after beamformer and virtual channel calculation), and only 12 of the brain sources explain up to 95% of the variance then I pick those 12 and run TEprepare on it and it runs without issue. So I havent needed to change many of the configuration settings around after that. Its only the length of trial and the number of trials that concern me now. One last note, is that there has been discussions on the eeglab discussion list about applying a 1-Hz highpass filter to your data. They think that it may interfere with the 'future' of the signal, ultimately disrupting the transfer entropy calculation (or any other connectivity measure). Tyler. ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Patricia Wollstadt Sent: Saturday, 12 April 2014 1:06 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] TRENTOOL bad channel combinations Hello Tyler, okay, I'd say the script should run like this (regarding channel selection). Maybe it's really the data then. If you keep getting errors, you can send me those as well. Regarding the number of data points: The error you are getting depends on a number of parameters TEprepare uses to determine the optimal embedding dimension and embedding delay. TEprepare checks whether you have enough samples in one trial after taking into account the ACT, cfg.actthrvalue, cfg.ragdim, cfg.ragtau and the assumed interaction delay (these parameters determine the maximum possible length, i.e. the worst case, of your embedding). Could you tell me the sampling rate of your data? If your data was sampled at 1000Hz, 3/9th of 500 ms should give you about 167 sample points for cfg.repPred, which would be okay. Otherwise, you may alter the parameters mentioned above, e.g. you can check whether you could lower the actthrvalue. The actthrvalue is used to exclude all trials with an ACT higher than the threshold. The value you put in there should be based on the filtering of the data prior to TE analysis (e.g. if you highpass filter your data at 10 Hz and have a sampling rate of 1000Hz, you shouldn't find any autocorrelation above 100 samples. In that case, you may use 100 as a threshold). What values do you enter for the other parameters (assumed interaction delay u, specified in cfg.predicttimemin_u/cfg.predicttimemax_u, embedding parameters to be scanned in cfg.ragdim and cfg.ragtau)? Maybe you can adjust those as well, to be able to enter a higher value for .repPred. Best, Patricia On 04/11/2014 12:44 PM, Tyler Grummett wrote: ​Hello Patricia, I have previously selected the channels that are EEG, I am not entering in 'EEG' or anything. cfgTEP = []; cfgTEP.Path2TSTOOL = fullfile( matlabrootpath, 'Matlab', 'OpenTSTOOL'); % dont add this to matlab path cfgTEP.toi = [ min( [vchan.time{ :}]), max( [vchan.time{ :}])]; cfgTEP.channel = vchan.label( comps);​ After playing around with it for a bit I dont think it is the channel combinations, but the data. If I can ask a separate question, what is an optimal length for the trials? My trials are about 500 ms long and it gives me the following error: Error using TEprepare (line 710) TRENTOOL ERROR: Not enough points in timeseries for current analysis settings: cfg.repPred too big, or max(cfg.ragdim)*max(cfg.ragtaurange) too big, or maximum u to big It is recommended that the cfgTEP.repPred is size(data.trial{1,1},2)*(3/4) However it only works for me if it is size(data.trial{1,1},2)*(3/9)​ . Then it runs fine, but Im worried about changing this. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Patricia Wollstadt Sent: Friday, 11 April 2014 6:42 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] TRENTOOL bad channel combinations Hello Tyler, TRENTOOL does not support the exclusion of channels like FieldTrip does (e.g. {'all', '-MLx', '-EOG'}), you have to explicitly specify channels OR combinations of channels for analysis in the cfg structure passed to TEprepare: % cfg.sgncmb = list of channelpairs cell array (Nx(source, target)) % or % cfg.channel = list of channels cell array - testing will be done all-by-all If you provide a list of channel combinations in cfg.sgncmb, TRENTOOL will analyze these combinations only; if you provide a list of channels in cfg.channel, TEprepare will build all possible channel combinations from the list and TRENTOOL will analyze these combinations. (Also, channel names have to match the channel labels in data.label.) So, a way to exclude bad channel combinations would be to provide a list of all channels that should be included in the analysis in cfg.channel and let TEprepare build the channel combinations from that. I hope this answers your question. Please let me know if you encounter any more problems. Best, Patricia On 04/11/2014 04:38 AM, Tyler Grummett wrote: ​Hello fieldtrip, Has anyone worked out how to handle bad channel combinations in TRENTOOL using TEprepare? In my experience it just crashes. I am hoping for a way to calculate the bad channel combinations before running TEprepare. If anyone can help, that will be greatly appreciated!! Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip ------------------------------------------------------------ Patricia Wollstadt, PhD Student MEG Unit, Brain Imaging Center Goethe University, Frankfurt, Germany Heinrich Hoffmann Strasse 10, Haus 93 B D - 60528 Frankfurt am Main _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- ------------------------------------------------------------ Patricia Wollstadt, PhD Student MEG Unit, Brain Imaging Center Goethe University, Frankfurt, Germany Heinrich Hoffmann Strasse 10, Haus 93 B D - 60528 Frankfurt am Main -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Mon Apr 14 08:08:34 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Mon, 14 Apr 2014 08:08:34 +0200 Subject: [FieldTrip] freqstatistics with sbj_chan_freq (Vit?ria Piai) Message-ID: Hi Viotira, If you don't care about time information , you can average it by specifying cfg.avgovertime = 'yes' on the TFR , then the cluster will be formed in channel-frequency format. If you use mtmfft , you should pre-select effect interval . Otherwise, it could be not consistent . Best, Haiteng > Message: 1 > Date: Sun, 13 Apr 2014 18:53:10 -0700 > From: Vit?ria Piai > To: FieldTrip discussion list > Subject: [FieldTrip] freqstatistics with sbj_chan_freq > Message-ID: <534B3F86.9070904 at gmail.com> > Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" > > Hi all, > > I'm kinda stuck not being able to figure out what's going wrong with my > freqstats, so I thought I could share it here and see if anyone can see > where I'm going wrong. > When I run freqstatistics on TFRs, I get a negative cluster (p = .001) > between 8 and 25 Hz with the topography very similar to the one in the > figure. But I just want non-time-resolved spectra. > So I have power spectra calculated with mtmfft (dpss tapers) between 1 > and 50 Hz (5 Hz smoothing) and this is the one for which I've been > trying to run freqstatistics, unsuccessfully. > I'm using a pretty standard cfg for freqstats (basically, the same I use > for the TFRs, which give me the negative cluster with p =.001) and the > data in the comparison are structured as sbj_chan_freq. With this > time-unresolved data, only posclusters are detected, with ps > .4! If I > plot the stat output, it has the exact same negative cluster as I get > for the TFRs (see Figure), and as far as I can see, no real positive > cluster, but the function doesn't even detect any negative clusters. > I must be doing something wrong because the time-resolved and > -unresolved effects are pretty much the same in the descriptives. I > remember running stats on time-unresolved data before and getting a > reasonable output, so I guess my ft_freqstatistics isn't working well > right now. I just can't figure out why. > Does anyone have any tips for how I could go about to find out why the > negative clusters are being disregarded? > > Thanks a lot, Vit?ria > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Mon Apr 14 08:23:30 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Mon, 14 Apr 2014 08:23:30 +0200 Subject: [FieldTrip] automatic artifact correction after virtual channels/beamformer Message-ID: Hi Tyler, It is always nice to computate virtual MEG channels based on artifact-corrected CLEAN data . Note that we use clean data to get the inverse spatial filter by DICS. Regrading to how to create virtual channel , please have a look at tutorial: http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors Best, Haiteng > Message: 2 > Date: Mon, 14 Apr 2014 02:54:16 +0000 > From: Tyler Grummett > To: FieldTrip discussion list > Subject: [FieldTrip] automatic artifact correction after virtual > channels/beamformer > Message-ID: > < > d9f26aff9ba640b29bfa36febf84e9cc at SIXPR03MB368.apcprd03.prod.outlook.com> > > Content-Type: text/plain; charset="us-ascii" > > ?Hello all, > > > I was just wondering whether it is necessary to use the artifact corrected > data when creating virtual channels from beamformer sources > > or whether you are able to use original, non-artifact corrected data. > > > Tyler > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140414/dca251ee/attachment-0001.html > > > > ------------------------------ > > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Mon Apr 14 09:26:44 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 14 Apr 2014 07:26:44 +0000 Subject: [FieldTrip] automatic artifact correction after virtual channels/beamformer In-Reply-To: References: Message-ID: <149bb27d65e749c5b37bb3bfab16e87b@SIXPR03MB368.apcprd03.prod.outlook.com> Hello Haiteng, Thankyou for the response. Yes I have gone through the tutorial. I use clean data to make the inverse spatial filter. But do then apply it to marked out data or can apply it to non-marked out data. Also, is there a way to append trials after you run an automatic artefact rejection algorithm over it? At the moment, I am trying to use a function that requires equal trial lengths. I can use ft_redefinetrial to grab a 2 second epoch from each 'trial'. However that feel a little crude as I am throwing out a lot of data. Your help will be greatly appreciated. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Haiteng Jiang Sent: Monday, 14 April 2014 3:53 PM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] automatic artifact correction after virtual channels/beamformer Hi Tyler, It is always nice to computate virtual MEG channels based on artifact-corrected CLEAN data . Note that we use clean data to get the inverse spatial filter by DICS. Regrading to how to create virtual channel , please have a look at tutorial: http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors Best, Haiteng Message: 2 Date: Mon, 14 Apr 2014 02:54:16 +0000 From: Tyler Grummett > To: FieldTrip discussion list > Subject: [FieldTrip] automatic artifact correction after virtual channels/beamformer Message-ID: > Content-Type: text/plain; charset="us-ascii" ?Hello all, I was just wondering whether it is necessary to use the artifact corrected data when creating virtual channels from beamformer sources or whether you are able to use original, non-artifact corrected data. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Mon Apr 14 13:34:11 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Mon, 14 Apr 2014 13:34:11 +0200 Subject: [FieldTrip] automatic artifact correction after virtual channels/beamformer Message-ID: > > Hi Tyler , > I think it makes sense to apply the inverse spatial filter on the the marked out data since you build it on this interval. In other words, non-marked out intervals data has different inverse filter. I don't understand appending trials after automatic artefact detection. Do you mean keep trials after automatic artefact detection ? Best, Haiteng > > Message: 3 > Date: Mon, 14 Apr 2014 07:26:44 +0000 > From: Tyler Grummett > To: FieldTrip discussion list > Subject: Re: [FieldTrip] automatic artifact correction after virtual > channels/beamformer > Message-ID: > < > 149bb27d65e749c5b37bb3bfab16e87b at SIXPR03MB368.apcprd03.prod.outlook.com> > > Content-Type: text/plain; charset="us-ascii" > > Hello Haiteng, > > > Thankyou for the response. Yes I have gone through the tutorial. I use > clean data to make the inverse spatial filter. But do then apply it to > > marked out data or can apply it to non-marked out data. Also, is there a > way to append trials after you run an automatic artefact > > rejection algorithm over it? At the moment, I am trying to use a function > that requires equal trial lengths. I can use ft_redefinetrial > > to grab a 2 second epoch from each 'trial'. However that feel a little > crude as I am throwing out a lot of data. > > > Your help will be greatly appreciated. > > > Tyler > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > ________________________________ > From: fieldtrip-bounces at science.ru.nl > on behalf of Haiteng Jiang > Sent: Monday, 14 April 2014 3:53 PM > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] automatic artifact correction after virtual > channels/beamformer > > Hi Tyler, > It is always nice to computate virtual MEG channels based on > artifact-corrected CLEAN data . Note that we use clean data to get the > inverse spatial filter by DICS. Regrading to how to create virtual > channel , please have a look at tutorial: > http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors > > Best, > Haiteng > > > > Message: 2 > Date: Mon, 14 Apr 2014 02:54:16 +0000 > From: Tyler Grummett tyler.grummett at flinders.edu.au>> > To: FieldTrip discussion list fieldtrip at science.ru.nl>> > Subject: [FieldTrip] automatic artifact correction after virtual > channels/beamformer > Message-ID: > < > d9f26aff9ba640b29bfa36febf84e9cc at SIXPR03MB368.apcprd03.prod.outlook.com > d9f26aff9ba640b29bfa36febf84e9cc at SIXPR03MB368.apcprd03.prod.outlook.com>> > > Content-Type: text/plain; charset="us-ascii" > > ?Hello all, > > > I was just wondering whether it is necessary to use the artifact corrected > data when creating virtual channels from beamformer sources > > or whether you are able to use original, non-artifact corrected data. > > > Tyler > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140414/dca251ee/attachment-0001.html > > > > ------------------------------ > > > > > -- > Haiteng Jiang > PhD candidate > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Visiting address > Room 2.32 > Donders Centre for Cognitive Neuroimaging > Kapittelweg 29 > 6525 EN Nijmegen > the Netherlands > > Tel.: +31 (0)243668291 > Web: https://sites.google.com/site/haitengjiang/ > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140414/c2da1c20/attachment-0001.html > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 25 > ***************************************** > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Mon Apr 14 17:45:05 2014 From: v.piai.research at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Piai?=) Date: Mon, 14 Apr 2014 08:45:05 -0700 Subject: [FieldTrip] freqstatistics with sbj_chan_freq (Vit?ria Piai) In-Reply-To: References: Message-ID: <534C0281.6010807@gmail.com> Thanks a lot, Haiteng, but that was not really the issue. I have a specific interval I'm interested in and by using dpss over that interval, my frequency resolution is better than if I use TFRs and then average. The problem really was in my cfg for the stats and I've just found out what it was. Don't know why (stupid me!!), but I set cfg.tail = 1 and that of course will only give me the right tail (posclusters!!) Thanks anyways, Vitória On 4/13/2014 11:08 PM, Haiteng Jiang wrote: > Hi Viotira, > If you don't care about time information , you can average it by > specifying cfg.avgovertime = 'yes' on the TFR , then the cluster will > be formed in channel-frequency format. If you use mtmfft , you > should pre-select effect interval . Otherwise, it could be not > consistent . > Best, > Haiteng > > > > > Message: 1 > Date: Sun, 13 Apr 2014 18:53:10 -0700 > From: Vit?ria Piai > > To: FieldTrip discussion list > > Subject: [FieldTrip] freqstatistics with sbj_chan_freq > Message-ID: <534B3F86.9070904 at gmail.com > > > Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" > > Hi all, > > I'm kinda stuck not being able to figure out what's going wrong > with my > freqstats, so I thought I could share it here and see if anyone > can see > where I'm going wrong. > When I run freqstatistics on TFRs, I get a negative cluster (p = .001) > between 8 and 25 Hz with the topography very similar to the one in the > figure. But I just want non-time-resolved spectra. > So I have power spectra calculated with mtmfft (dpss tapers) between 1 > and 50 Hz (5 Hz smoothing) and this is the one for which I've been > trying to run freqstatistics, unsuccessfully. > I'm using a pretty standard cfg for freqstats (basically, the same > I use > for the TFRs, which give me the negative cluster with p =.001) and the > data in the comparison are structured as sbj_chan_freq. With this > time-unresolved data, only posclusters are detected, with ps > .4! > If I > plot the stat output, it has the exact same negative cluster as I get > for the TFRs (see Figure), and as far as I can see, no real positive > cluster, but the function doesn't even detect any negative clusters. > I must be doing something wrong because the time-resolved and > -unresolved effects are pretty much the same in the descriptives. I > remember running stats on time-unresolved data before and getting a > reasonable output, so I guess my ft_freqstatistics isn't working well > right now. I just can't figure out why. > Does anyone have any tips for how I could go about to find out why the > negative clusters are being disregarded? > > Thanks a lot, Vit?ria > > -- > Haiteng Jiang > PhD candidate > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Visiting address > Room 2.32 > Donders Centre for Cognitive Neuroimaging > Kapittelweg 29 > 6525 EN Nijmegen > the Netherlands > > Tel.: +31 (0)243668291 > Web: https://sites.google.com/site/haitengjiang/ > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Tue Apr 15 08:13:18 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 15 Apr 2014 06:13:18 +0000 Subject: [FieldTrip] plotting virtual channels on TRENTOOL's TEplot2D Message-ID: ?Hello TRENTOOL and fieldtrip users, Has anyone been able to plot virtual channels using TRENTOOL's TEplot2D function? It requires a layout file that is prepared in ft_prepare_layout, but I cant seem to work it out with virtual channels. Tyler. ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Tue Apr 15 08:22:59 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 15 Apr 2014 06:22:59 +0000 Subject: [FieldTrip] TRENTOOL no edges Message-ID: Hello fieldtrip and TRENTOOL users, I have just finished running some TE analyses on a subject and when I have run TEgraphanalysis, it has told me that I have 16 vertexes (channels) and no edges. I had a look at the permutation values and they are pretty much all: 1.0000 0 0 NaN 1.0000 ?I must be going wrong somewhere because I find it hard to think that the channels I have chosen have no functional relationship. Can anyone help? Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Tue Apr 15 09:03:00 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 15 Apr 2014 07:03:00 +0000 Subject: [FieldTrip] automatic artifact correction after virtual channels/beamformer In-Reply-To: References: Message-ID: Hi Haiteng, Basically the automatic artefact detection algorithms removes some EEG (if artefactual) and splits the data into two trials. These trials are not the same size. TRENTOOL can only work on trials that are the same length. So I determined what the biggest trial length was and redefined the trials. ie cfg = [] cfg.length = x length ​ft_redefinetrial( cfg, data) However this is causing computational errors later on. So I was wondering whether you could append the trials together and place a discontinuation marker between them. The other thing I tried was to pass in the argument 'nan' into the reject artefact function, but then this causes an issue with the virtual channel procedure. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Haiteng Jiang Sent: Monday, 14 April 2014 9:04 PM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] automatic artifact correction after virtual channels/beamformer Hi Tyler , I think it makes sense to apply the inverse spatial filter on the the marked out data since you build it on this interval. In other words, non-marked out intervals data has different inverse filter. I don't understand appending trials after automatic artefact detection. Do you mean keep trials after automatic artefact detection ? Best, Haiteng Message: 3 Date: Mon, 14 Apr 2014 07:26:44 +0000 From: Tyler Grummett > To: FieldTrip discussion list > Subject: Re: [FieldTrip] automatic artifact correction after virtual channels/beamformer Message-ID: <149bb27d65e749c5b37bb3bfab16e87b at SIXPR03MB368.apcprd03.prod.outlook.com> Content-Type: text/plain; charset="us-ascii" Hello Haiteng, Thankyou for the response. Yes I have gone through the tutorial. I use clean data to make the inverse spatial filter. But do then apply it to marked out data or can apply it to non-marked out data. Also, is there a way to append trials after you run an automatic artefact rejection algorithm over it? At the moment, I am trying to use a function that requires equal trial lengths. I can use ft_redefinetrial to grab a 2 second epoch from each 'trial'. However that feel a little crude as I am throwing out a lot of data. Your help will be greatly appreciated. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl > on behalf of Haiteng Jiang > Sent: Monday, 14 April 2014 3:53 PM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] automatic artifact correction after virtual channels/beamformer Hi Tyler, It is always nice to computate virtual MEG channels based on artifact-corrected CLEAN data . Note that we use clean data to get the inverse spatial filter by DICS. Regrading to how to create virtual channel , please have a look at tutorial: http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors Best, Haiteng Message: 2 Date: Mon, 14 Apr 2014 02:54:16 +0000 From: Tyler Grummett >> To: FieldTrip discussion list >> Subject: [FieldTrip] automatic artifact correction after virtual channels/beamformer Message-ID: >> Content-Type: text/plain; charset="us-ascii" ?Hello all, I was just wondering whether it is necessary to use the artifact corrected data when creating virtual channels from beamformer sources or whether you are able to use original, non-artifact corrected data. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip End of fieldtrip Digest, Vol 41, Issue 25 ***************************************** -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Apr 15 11:47:13 2014 From: jm.horschig at donders.ru.nl (=?UTF-8?B?IkrDtnJuIE0uIEhvcnNjaGlnIg==?=) Date: Tue, 15 Apr 2014 11:47:13 +0200 Subject: [FieldTrip] automatic artifact correction after virtual channels/beamformer In-Reply-To: References: Message-ID: <534D0021.401@donders.ru.nl> Hi Tyler, the only way to keep the trial as a whole and still 'mark' artifactual periods is by calling ft_rejectartifact on your preprocessed data (i.e. original data incl. artifacts) using cfg.artctdef.reject = 'nan'. This will sets periods in which an artifact was detected to nan. However, there might be several downsides with this, as not all fieldtrip functions work with nans in your data. I have absolutely no clue how trentool is handling this. The only other alternative you have is to remove the whole trial, so that all your trials are of equal lengths. Maybe you can achieve a similar thing (nan-ing of artifacts) by ft_redefinetrial and specify the original .trl-matrix (given that you have not resampled). Not exactly sure, but you can give it a try if you do not have the original preprocessed data at hand anymore. Best, Jörn On 4/15/2014 9:03 AM, Tyler Grummett wrote: > > Hi Haiteng, > > > Basically the automatic artefact detection algorithms removes some EEG > (if artefactual) and splits the data into two trials. These trials are > not the same size. > > > TRENTOOL can only work on trials that are the same length. So I > determined what the biggest trial length was and redefined the trials. > > > ie cfg = [] > > cfg.length = x length > > ​ft_redefinetrial( cfg, data) > > > However this is causing computational errors later on. So I was > wondering whether you could append the trials together and place a > discontinuation marker between them. > > > The other thing I tried was to pass in the argument 'nan' into the > reject artefact function, but then this causes an issue with the > virtual channel procedure. > > > Tyler > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > ------------------------------------------------------------------------ > *From:* fieldtrip-bounces at science.ru.nl > on behalf of Haiteng Jiang > > *Sent:* Monday, 14 April 2014 9:04 PM > *To:* fieldtrip at science.ru.nl > *Subject:* Re: [FieldTrip] automatic artifact correction after virtual > channels/beamformer > > Hi Tyler , > > I think it makes sense to apply the inverse spatial filter on the the > marked out data since you build it on this interval. In other words, > non-marked out intervals data has different inverse filter. I don't > understand appending trials after automatic artefact detection. Do you > mean keep trials after automatic artefact detection ? > > Best, > Haiteng > > > Message: 3 > Date: Mon, 14 Apr 2014 07:26:44 +0000 > From: Tyler Grummett > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] automatic artifact correction after virtual > channels/beamformer > Message-ID: > <149bb27d65e749c5b37bb3bfab16e87b at SIXPR03MB368.apcprd03.prod.outlook.com > > > > Content-Type: text/plain; charset="us-ascii" > > Hello Haiteng, > > > Thankyou for the response. Yes I have gone through the tutorial. I > use clean data to make the inverse spatial filter. But do then > apply it to > > marked out data or can apply it to non-marked out data. Also, is > there a way to append trials after you run an automatic artefact > > rejection algorithm over it? At the moment, I am trying to use a > function that requires equal trial lengths. I can use ft_redefinetrial > > to grab a 2 second epoch from each 'trial'. However that feel a > little crude as I am throwing out a lot of data. > > > Your help will be greatly appreciated. > > > Tyler > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > ________________________________ > From: fieldtrip-bounces at science.ru.nl > > > on behalf of Haiteng > Jiang > > Sent: Monday, 14 April 2014 3:53 PM > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] automatic artifact correction after > virtual channels/beamformer > > Hi Tyler, > It is always nice to computate virtual MEG channels based on > artifact-corrected CLEAN data . Note that we use clean data to get > the inverse spatial filter by DICS. Regrading to how to create > virtual channel , please have a look at tutorial: > http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors > > Best, > Haiteng > > > > Message: 2 > Date: Mon, 14 Apr 2014 02:54:16 +0000 > From: Tyler Grummett >> > To: FieldTrip discussion list >> > Subject: [FieldTrip] automatic artifact correction after virtual > channels/beamformer > Message-ID: > >> > > Content-Type: text/plain; charset="us-ascii" > > ?Hello all, > > > I was just wondering whether it is necessary to use the artifact > corrected data when creating virtual channels from beamformer sources > > or whether you are able to use original, non-artifact corrected data. > > > Tyler > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > > > > -- > Haiteng Jiang > PhD candidate > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Visiting address > Room 2.32 > Donders Centre for Cognitive Neuroimaging > Kapittelweg 29 > 6525 EN Nijmegen > the Netherlands > > Tel.: +31 (0)243668291 > Web: https://sites.google.com/site/haitengjiang/ > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 25 > ***************************************** > > > > > -- > Haiteng Jiang > PhD candidate > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Visiting address > Room 2.32 > Donders Centre for Cognitive Neuroimaging > Kapittelweg 29 > 6525 EN Nijmegen > the Netherlands > > Tel.: +31 (0)243668291 > Web: https://sites.google.com/site/haitengjiang/ > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From bingshuo.li at student.uni-tuebingen.de Tue Apr 15 13:22:09 2014 From: bingshuo.li at student.uni-tuebingen.de (Bingshuo Li) Date: Tue, 15 Apr 2014 13:22:09 +0200 Subject: [FieldTrip] Question re: TMS-EEG FT Tutorial In-Reply-To: <5347ccb3.05c60e0a.716a.fffffe45SMTPIN_ADDED_BROKEN@mx.google.com> References: <5347ccb3.05c60e0a.716a.fffffe45SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: Hi Jim, Thank you very much again for your thoughtful response! I truly appreciate it! I see your point now why you interpolate after ICA. It makes sense and I think your argument is very valid. Indeed, bad channels always come up fairly independently anyways. I can for sure do my channel inspection after the ICA. Another question along the same line: Would you suggest to categorize all the IC with more than, say 30 uV, on the time-locked averaged IC, as muscle artifacts as suggested by Korhonen et al. (2011)? I often feel very puzzled when it comes to picking up ICs for removal. I feel that if I remove those high amplitude ICs, my averaged TEPs look worse. However, by keeping those high amplitude ICs, I am letting in signals with no biological plausibility. Any thoughts on that? Thanks very much! Regards, Bingshuo ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at student.uni-tuebingen.de +49-7071-29-89029 On Fri, Apr 11, 2014 at 12:48 PM, Herring, J.D. (Jim) < j.herring at fcdonders.ru.nl> wrote: > Dear Bingshuo, > > > > I am forwarding your e-mail to the Fieldtrip mailinglist so that others > can benefit and/or contribute from our discussion. > > > > The reason why I like to postpone the interpolation to after the ICA is > that I noticed that when interpolating before ICA the interpolated data > would load onto one component. Removing this component did not make sense > as it would leave a flat line in the TEP, keeping it in did not make sense > either because the interpolation was done with, for example, the decay > artifact still in the data. After removing the decay artifact with ICA you > would be left with a sharp peak in the interpolated segment. > > > > I see that it is difficult to reject trials and channels before > interpolation but keep in mind that before having done ICA large amounts of > variance of the data can be explained by the TMS related artifacts, these > will most likely cloud the detection of other types of artifacts with > functions such as ft_rejectvisual. > > > > In my experience bad channels show up as separate independent components > anyway and can be removed after having run the ICA, but that may depend on > a number of factors I’m not aware of. > > > > If you would like to reject bad channels prior to running ICA you could > also try to run ft_rejectvisual and specify cfg.latency to contain only > your pre-TMS period or a period post-TMS that does not contain any large > artifacts. That way you should at least be able to run metrics on your data > to remove bad channels. In any case you can always run ft_databrowser on > your data to visually inspect your channel time courses for bad channels > prior to running the ICA. > > > > In any case you are of course free to try running the ICA after > interpolation yourself and share your experiences, perhaps this works fine > for you J > > > > Best, > > > > Jim > > > > *From:* Bingshuo Li [mailto:bingshuo.li at cin.uni-tuebingen.de] > *Sent:* donderdag 10 april 2014 16:36 > *To:* j.herring at fcdonders.ru.nl > *Subject:* Question re: TMS-EEG FT Tutorial > > > > Dear Jim, > > I inquired you about a TMS-EEG question a while ago and you referred me to > the TMS-EEG tutorial on Fieldtrip's website. As I was following the steps > of the tutorial, there is a new question that come up to me -- Is it really > necessary to postpone the interpolation of the TMS artifact until the ICA > is done? Would there be any bad consequences if I interpolate first and > then run the ICA over the entire interpolated trial(s)? The reason I am > asking this question is that I would like to visually inspect my data first > and remove bad channels or trials (if any) prior to ICA. If the artifact is > not interpolated, it is really difficult to run visual inspection or > metrics on the data.. Following the logic of the tutorial, I can only > visual inspection after the ICA, which I think might not be a good idea as > I was told that a bad channel can easily bias the ICA result.. > > Do you have any insights in this? Thank you very much for your time in > advance! > > Sincerely, > > > ----- > Bingshuo Li (MSc. candidate) > Systems Neurophysiology Group > Centre for Integrative Neuroscience > University of Tuebingen > Otfried-Mueller-Str. 25 > D-72076 Tuebingen, Germany > > bingshuo.li at cin.uni-tuebingen.de > > +49-7071-29-89029 > > > > On Mon, Feb 10, 2014 at 3:24 PM, Herring, J.D. (Jim) < > j.herring at fcdonders.ru.nl> wrote: > > Dear Bingshuo, > > > > Please have a look at the following tutorial: > http://fieldtrip.fcdonders.nl/tutorial/tms-eeg > > > > It deals with a number of TMS-EEG related artifacts including the ‘evil’ > decay artifact. > > > > Best, > > > > Jim > > > > *From:* fieldtrip-bounces at science.ru.nl [mailto: > fieldtrip-bounces at science.ru.nl] *On Behalf Of *Bingshuo Li > *Sent:* maandag 10 februari 2014 15:06 > *To:* FieldTrip discussion list > *Subject:* [FieldTrip] TMS-EEG Decay Artifact > > > > Dear FT users and developers, > > Does anyone have any experience in dealing with the so-called decay > artifacts found in TMS-EEG? It is a relatively long lasting (up to 100ms) > artifact that follows a waveform similar to exponential decay and it occurs > sporadically in certain recording channels. > > Any tips/hints/recommendations are greatly appreciated! Thank you! > > Regards, > > > > ----- > Bingshuo Li (MSc. candidate) > Systems Neurophysiology Group > Centre for Integrative Neuroscience > University of Tuebingen > Otfried-Mueller-Str. 25 > D-72076 Tuebingen, Germany > bingshuo.li at student.uni-tuebingen.de > +49-152-06054831 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Tue Apr 15 16:03:00 2014 From: roeysc at gmail.com (Roey Schurr) Date: Tue, 15 Apr 2014 17:03:00 +0300 Subject: [FieldTrip] Resting State Data Source Reconstruction - covriance matrix in beamformer, and "avg" field in eLORETA Message-ID: Dear Fieldtrippers, First of all, a big thank you to all members of the community – it is a wonderful place to learn in and share ideas, thoughts and solutions to common problems we all face. I am writing you since I fear I might be missing something trivial: I am trying to compute an inverse solution to to resting-state EEG data. Two question arise, depending on the method I am trying to use: 1) Using a beamformer technique such as LCMV, a covariance matrix is needed. However, since the data is not time-locked (like ERP), the covariance matrix cannot be easily computed over the averaged trials. Can it be estimated using different resting-state trials? 2) Using eLORETA as the source reconstruction method (since my goal is a time-domain source reconstruction), it seems the the "avg" field is neeed in the data. Once again, no such average is available, since these are not ERP trials. Would you advise me to revise the code and try to fit it to non-ERP data, or is there some easier way I'm missing? Thank you all, Best, roey -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at fcdonders.ru.nl Wed Apr 16 09:44:46 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Wed, 16 Apr 2014 09:44:46 +0200 (CEST) Subject: [FieldTrip] Question re: TMS-EEG FT Tutorial In-Reply-To: References: <5347ccb3.05c60e0a.716a.fffffe45SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: <01e901cf5947$bcc80950$36581bf0$@herring@fcdonders.ru.nl> Hi Bingshuo, Be careful with categorizing IC’s based on their amplitudes alone. The kind people on the mailinglist may correct me if I am wrong but the exact amplitude of sources cannot be extracted using ICA. A very nice introduction to ICA by Arnaud Delorme can be found here: http://sccn.ucsd.edu/~arno/indexica.html. It contains a nice example where you can mix two sources and decompose them using fastICA (make sure to add the fastica toolbox to your matlab path, e.g. fieldtrip/external/fastica): % Create source time course A = sin(linspace(0,50, 1000)); % A B = sin(linspace(0,37, 1000)+5); % B figure; subplot(2,1,1); plot(A); % plot A subplot(2,1,2); plot(B, 'r'); % plot B % Mix sources M1 = A - 2*B; % mixing 1 M2 = 1.73*A+3.41*B; % mixing 2 figure; subplot(2,1,1); plot(M1); % plot mixing 1 subplot(2,1,2); plot(M2, 'r'); % plot mixing 2 % Decompose using ICA figure; c = fastica([M1;M2]); % compute and plot unminxing using fastICA subplot(1,2,1); plot(c(1,:)); subplot(1,2,2); plot(c(2,:)); Using the above line of code you can change the amplitude of the source time courses (e.g. by multiplying A and/or B by a constant) and you can see that the amplitude of the independent components remains unchanged. I am not 100% certain but what I think Korhonen et al. are doing is transforming the individual IC components back to sensor level and then looking at the EEG amplitudes, which would be valid. In fieldtrip you could realize this be using ft_rejectcomponent with ‘cfg.component’ set to all components except the one you would like to keep. I personally prefer to see whether the topography matches the location of areas that are stimulated by the coil and to check whether the averaged IC time courses contains the large exponential decay I would like to remove. Could it be that after removing these high amplitude ICs your TEPs only look more noisy because the vertical scaling changes while plotting? In other words, the noise was already there before but you are just zooming in more because the plotting function does not have to fit the high amplitude components in the figure? Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Bingshuo Li Sent: dinsdag 15 april 2014 13:22 To: FieldTrip discussion list Subject: Re: [FieldTrip] Question re: TMS-EEG FT Tutorial Hi Jim, Thank you very much again for your thoughtful response! I truly appreciate it! I see your point now why you interpolate after ICA. It makes sense and I think your argument is very valid. Indeed, bad channels always come up fairly independently anyways. I can for sure do my channel inspection after the ICA. Another question along the same line: Would you suggest to categorize all the IC with more than, say 30 uV, on the time-locked averaged IC, as muscle artifacts as suggested by Korhonen et al. (2011)? I often feel very puzzled when it comes to picking up ICs for removal. I feel that if I remove those high amplitude ICs, my averaged TEPs look worse. However, by keeping those high amplitude ICs, I am letting in signals with no biological plausibility. Any thoughts on that? Thanks very much! Regards, Bingshuo ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at student.uni-tuebingen.de +49-7071-29-89029 On Fri, Apr 11, 2014 at 12:48 PM, Herring, J.D. (Jim) wrote: Dear Bingshuo, I am forwarding your e-mail to the Fieldtrip mailinglist so that others can benefit and/or contribute from our discussion. The reason why I like to postpone the interpolation to after the ICA is that I noticed that when interpolating before ICA the interpolated data would load onto one component. Removing this component did not make sense as it would leave a flat line in the TEP, keeping it in did not make sense either because the interpolation was done with, for example, the decay artifact still in the data. After removing the decay artifact with ICA you would be left with a sharp peak in the interpolated segment. I see that it is difficult to reject trials and channels before interpolation but keep in mind that before having done ICA large amounts of variance of the data can be explained by the TMS related artifacts, these will most likely cloud the detection of other types of artifacts with functions such as ft_rejectvisual. In my experience bad channels show up as separate independent components anyway and can be removed after having run the ICA, but that may depend on a number of factors I’m not aware of. If you would like to reject bad channels prior to running ICA you could also try to run ft_rejectvisual and specify cfg.latency to contain only your pre-TMS period or a period post-TMS that does not contain any large artifacts. That way you should at least be able to run metrics on your data to remove bad channels. In any case you can always run ft_databrowser on your data to visually inspect your channel time courses for bad channels prior to running the ICA. In any case you are of course free to try running the ICA after interpolation yourself and share your experiences, perhaps this works fine for you J Best, Jim From: Bingshuo Li [mailto:bingshuo.li at cin.uni-tuebingen.de] Sent: donderdag 10 april 2014 16:36 To: j.herring at fcdonders.ru.nl Subject: Question re: TMS-EEG FT Tutorial Dear Jim, I inquired you about a TMS-EEG question a while ago and you referred me to the TMS-EEG tutorial on Fieldtrip's website. As I was following the steps of the tutorial, there is a new question that come up to me -- Is it really necessary to postpone the interpolation of the TMS artifact until the ICA is done? Would there be any bad consequences if I interpolate first and then run the ICA over the entire interpolated trial(s)? The reason I am asking this question is that I would like to visually inspect my data first and remove bad channels or trials (if any) prior to ICA. If the artifact is not interpolated, it is really difficult to run visual inspection or metrics on the data.. Following the logic of the tutorial, I can only visual inspection after the ICA, which I think might not be a good idea as I was told that a bad channel can easily bias the ICA result.. Do you have any insights in this? Thank you very much for your time in advance! Sincerely, ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at cin.uni-tuebingen.de +49-7071-29-89029 On Mon, Feb 10, 2014 at 3:24 PM, Herring, J.D. (Jim) wrote: Dear Bingshuo, Please have a look at the following tutorial: http://fieldtrip.fcdonders.nl/tutorial/tms-eeg It deals with a number of TMS-EEG related artifacts including the ‘evil’ decay artifact. Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Bingshuo Li Sent: maandag 10 februari 2014 15:06 To: FieldTrip discussion list Subject: [FieldTrip] TMS-EEG Decay Artifact Dear FT users and developers, Does anyone have any experience in dealing with the so-called decay artifacts found in TMS-EEG? It is a relatively long lasting (up to 100ms) artifact that follows a waveform similar to exponential decay and it occurs sporadically in certain recording channels. Any tips/hints/recommendations are greatly appreciated! Thank you! Regards, ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at student.uni-tuebingen.de +49-152-06054831 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.reinhart at vanderbilt.edu Wed Apr 16 14:42:14 2014 From: robert.reinhart at vanderbilt.edu (Rob Reinhart) Date: Wed, 16 Apr 2014 07:42:14 -0500 Subject: [FieldTrip] Beamforming Message-ID: Hello, I implemented your beamforming routine using the code that appears online ( http://fieldtrip.fcdonders.nl/tutorial/beamformer#preprocessing) and received this error, below. Can you advise? I appreciate your help. Best regards, Rob Reinhart ??? Error using ==> ft_read_headshape at 888 unknown fileformat "unknown" for head shape information Error in ==> ft_sourceplot at 890 surf = ft_read_headshape(cfg.surffile); Error in ==> FreqSourceAnalysis at 290 ft_sourceplot(cfg, sourceDiffIntNorm); -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Apr 16 16:50:38 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Wed, 16 Apr 2014 16:50:38 +0200 Subject: [FieldTrip] Beamforming In-Reply-To: References: Message-ID: Hi Rob, What's cfg.surffile in your case? It should read 'surface_white_both'. I just updated the tutorial documentation yesterday, because the old specification: 'surface_l4_both' yielded the error you report. If you indeed use 'surface_white_both' it means we have to look into it further. Best, Jan-Mathijs On Apr 16, 2014, at 2:42 PM, Rob Reinhart wrote: > Hello, > > I implemented your beamforming routine using the code that appears online (http://fieldtrip.fcdonders.nl/tutorial/beamformer#preprocessing) and received this error, below. Can you advise? I appreciate your help. > > Best regards, > > Rob Reinhart > > > ??? Error using ==> ft_read_headshape at 888 > unknown fileformat "unknown" for head shape information > > Error in ==> ft_sourceplot at 890 > surf = ft_read_headshape(cfg.surffile); > > Error in ==> FreqSourceAnalysis at 290 > ft_sourceplot(cfg, sourceDiffIntNorm); > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.reinhart at vanderbilt.edu Wed Apr 16 18:20:27 2014 From: robert.reinhart at vanderbilt.edu (Rob Reinhart) Date: Wed, 16 Apr 2014 11:20:27 -0500 Subject: [FieldTrip] Beamforming In-Reply-To: References: Message-ID: Hi Jan-Mathijs, Thanks for your speedy reply. Unfortunately, in the code I'm implementing cfg.surffile = 'surface_white_both.mat' . What do you suggest? Thanks again. Best, Rob On Wed, Apr 16, 2014 at 9:50 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > > Hi Rob, > What's cfg.surffile in your case? It should read 'surface_white_both'. I just updated the tutorial documentation yesterday, because the old specification: 'surface_l4_both' yielded the error you report. If you indeed use 'surface_white_both' it means we have to look into it further. > Best, > Jan-Mathijs > > On Apr 16, 2014, at 2:42 PM, Rob Reinhart wrote: > > Hello, > > I implemented your beamforming routine using the code that appears online (http://fieldtrip.fcdonders.nl/tutorial/beamformer#preprocessing) and received this error, below. Can you advise? I appreciate your help. > > Best regards, > > Rob Reinhart > > > ??? Error using ==> ft_read_headshape at 888 > unknown fileformat "unknown" for head shape information > > Error in ==> ft_sourceplot at 890 > surf = ft_read_headshape(cfg.surffile); > > Error in ==> FreqSourceAnalysis at 290 > ft_sourceplot(cfg, sourceDiffIntNorm); > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From luke.bloy at gmail.com Wed Apr 16 21:29:24 2014 From: luke.bloy at gmail.com (Luke Bloy) Date: Wed, 16 Apr 2014 15:29:24 -0400 Subject: [FieldTrip] covariance computation from ft_timelockanalysis Message-ID: Hi All, I'm interested in using lcmv to do a common mode differential beamformer. My understanding, please correct me if I'm incorrect, is that the best way forward would be to 1) compute a covariance matrix from a time window combining both active and control windows. 2) use this combined covariance to make a common mode lcmv beamformer 3) apply this to both active and control windows separately 4) combine into some sort of psuedo T or NAI. does this sound correct? If so the main thing I'm unclear on is how to compute the covariance for 2 distinct time intervals? is this possible? Thanks, Luke -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.m.groppe at gmail.com Thu Apr 17 04:40:35 2014 From: david.m.groppe at gmail.com (David Groppe) Date: Wed, 16 Apr 2014 22:40:35 -0400 Subject: [FieldTrip] Research Assistant Position Available in Human Brain Mapping at New York's Feinstein Institute for Medical Research Message-ID: The Laboratory for Multimodal Human Brain Mapping at the Feinstein Institute for Medical Research is looking for a research assistant to help with their research into (1) improving the identification of functional and pathological brain regions in individuals suffering from epilepsy, (2) the neural mechanisms of cognition, and (3) characterizing macroscale human brain networks. The lab works exclusively with patients being evaluated for epilepsy surgery using methods such as electrocorticography, MRI, fMRI, and direct electrical brain stimulation. The responsibilities of the research assistant include assisting with the collection and analysis of the aforementioned data, managing data archives and lab equipment, working with a research coordinator on IRB matters, and helping to present lab findings at conferences and in journals. This unique position will expose the successful applicant to basic and clinical neuroscience as well as neurosurgery and neurology. It is a great opportunity for recent post-bacs interested in medical school or graduate school in neuroscience/biomedical engineering. Past research assistants in the lab have been co-authors on lab publications and have gone on to MD or PhD programs after spending 1-2 years in the lab. ------------- Qualifications ------------- Minimum: -B.A./B.S./B.E. in an appropriate discipline (e.g., neuroscience, psychology, biomedical engineering, computer science, physics) -1 year commitment Highly Desirable: -Experience with at least one programming language (preferably MATLAB) and statistical analyses -Prior experience working with neuroimaging, EEG/MEG, or brain stimulation data -Previous experience working with patients -Previous work in a research laboratory that shows evidence of independent scholarship, problem solving, and motivation -2 year commitment preferred For more information about the lab see: http://www.feinsteininstitute.org/faculty/ashesh-mehta-md-phd/ For more information about the position please send curriculum vitae and cover letter to Dr. David Groppe (david.m.groppe at gmail.com) -- David Groppe, Ph.D. Postdoctoral Researcher Laboratory for Multimodal Human Brain Mapping Feinstein Institute for Medical Research Manhasset, New York http://www.cogsci.ucsd.edu/~dgroppe/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Apr 17 10:24:54 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Thu, 17 Apr 2014 10:24:54 +0200 Subject: [FieldTrip] Beamforming In-Reply-To: References: Message-ID: Rob, I cannot reproduce your error. The (rather uninformative) error message you get refers to the fact that FT cannot find the default surffile, which should be in ~/fieldtrip/template/anatomy. This folder should be added automatically to your matlab path if you start fieldtrip in the recommended way, i.e. using the ft_defaults function. Please update your ft-version to a recent version, start matlab and fieldtrip in the recommended way and try again. Best wishes, Jan-Mathijs On Apr 16, 2014, at 6:20 PM, Rob Reinhart wrote: > Hi Jan-Mathijs, > Thanks for your speedy reply. Unfortunately, in the code I'm implementing cfg.surffile = 'surface_white_both.mat' . What do you suggest? Thanks again. > Best, > Rob > > On Wed, Apr 16, 2014 at 9:50 AM, jan-mathijs schoffelen wrote: > > > > Hi Rob, > > What's cfg.surffile in your case? It should read 'surface_white_both'. I just updated the tutorial documentation yesterday, because the old specification: 'surface_l4_both' yielded the error you report. If you indeed use 'surface_white_both' it means we have to look into it further. > > Best, > > Jan-Mathijs > > > > On Apr 16, 2014, at 2:42 PM, Rob Reinhart wrote: > > > > Hello, > > > > I implemented your beamforming routine using the code that appears online (http://fieldtrip.fcdonders.nl/tutorial/beamformer#preprocessing) and received this error, below. Can you advise? I appreciate your help. > > > > Best regards, > > > > Rob Reinhart > > > > > > ??? Error using ==> ft_read_headshape at 888 > > unknown fileformat "unknown" for head shape information > > > > Error in ==> ft_sourceplot at 890 > > surf = ft_read_headshape(cfg.surffile); > > > > Error in ==> FreqSourceAnalysis at 290 > > ft_sourceplot(cfg, sourceDiffIntNorm); > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > Jan-Mathijs Schoffelen, MD PhD > > > > Donders Institute for Brain, Cognition and Behaviour, > > Centre for Cognitive Neuroimaging, > > Radboud University Nijmegen, The Netherlands > > > > Max Planck Institute for Psycholinguistics, > > Nijmegen, The Netherlands > > > > J.Schoffelen at donders.ru.nl > > Telephone: +31-24-3614793 > > > > http://www.hettaligebrein.nl > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Apr 17 10:27:09 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Thu, 17 Apr 2014 10:27:09 +0200 Subject: [FieldTrip] covariance computation from ft_timelockanalysis In-Reply-To: References: Message-ID: Hi Luke, On Apr 16, 2014, at 9:29 PM, Luke Bloy wrote: > Hi All, > > I'm interested in using lcmv to do a common mode differential beamformer. My understanding, please correct me if I'm incorrect, is that the best way forward would be to > 1) compute a covariance matrix from a time window combining both active and control windows. > 2) use this combined covariance to make a common mode lcmv beamformer > 3) apply this to both active and control windows separately > 4) combine into some sort of psuedo T or NAI. > > does this sound correct? Yes it does. > If so the main thing I'm unclear on is how to compute the covariance for 2 distinct time intervals? is this possible? What you could do is call ft_timelockanalysis twice: each time with a different cfg.covariancewindow. Assuming you have an equal number of trials for both time windows, averaging the two covariance matrices will give you the combined covariance matrix. Best, Jan-Mathijs > > Thanks, > Luke > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From walshc11 at tcd.ie Thu Apr 17 11:35:05 2014 From: walshc11 at tcd.ie (Christian Walsh) Date: Thu, 17 Apr 2014 10:35:05 +0100 Subject: [FieldTrip] Problem with unwanted 'normalisation' of data using ft_realtime_signalviewer Message-ID: Dear community, My name is Christian Walsh and I am doing a Neural Engineering MSc. in TCD in Ireland. My thesis is on the effects of timed auditory stimulation on sleep quality. A sort of dumbed down and scaled down version of a recent enough study by Ngo et al. (2013) entitled: Auditory Closed-Loop Stimulation of the Sleep Slow Oscillations Enhances Memory. For this, I detect peaks and troughs in the ongoing EEG data in realtime. On detecting a trough, a sound is played back after an initial delay. This is done so that the sound playback coincides with the peak of the ongoing EEG data. Before I can actually perform this experiment I need to setup the apparatus. To do this I have simulated realtime streaming and analysis using the ft_realtime_signalproxy function in one MATLAB session and an edited_ft_realtime_powerestimate and psychtoolbox function in another session. This is all working fine. The problem is that the data that is streamed in is normalised, scaled or something. i.e. the y-values of the streamed data should range from around -150 uV to 150uV but the edited_ft_realtime_powerestimate function only displays y-values between around -2 and 2??? I'm new to programming so apologies if this is a stupid question. I have looked into editing some of the ft_read_data and ft_preproc_baselinecorrect functions but have not found a solution. Advice would be appreciated, Cheers, Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: From luke.bloy at gmail.com Thu Apr 17 20:16:30 2014 From: luke.bloy at gmail.com (Luke Bloy) Date: Thu, 17 Apr 2014 14:16:30 -0400 Subject: [FieldTrip] covariance computation from ft_timelockanalysis In-Reply-To: References: Message-ID: Dear Jan-Mathijs Thank you for the quick response. Computing the covariance seems to be working fine now. I'm curious what you would suggest for computing the differential power? at the moment I'm not keeping any trial measures (cfg.keeptrials='no') in either ft_timelockanalysis or ft_sourceanalysis. I'm then computing a psuedoT as act_sourceAnalysis.avg.pseudoT = (act_sourceAnalysis.avg.pow - cnt_sourceAnalysis.avg.pow)./(act_sourceAnalysis.avg.noise + cnt_sourceAnalysis.avg.noise); I wanted to compare this pseudoT to a standard T score. I can get trial by trial power estimates by using cfg.keeptrials='yes' in ft_timelockanalysis and cfg.keeptrials='yes' and ctf.rawtrial='yes' in ft_sourceanalysis. but ft_sourcestatistics doesn't seem to let me do a paired T the way I would hope. Is there an alternative route that you might take or is there another method that could be useful? Thanks, Luke On Thu, Apr 17, 2014 at 4:27 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi Luke, > > On Apr 16, 2014, at 9:29 PM, Luke Bloy wrote: > > Hi All, > > I'm interested in using lcmv to do a common mode differential beamformer. > My understanding, please correct me if I'm incorrect, is that the best way > forward would be to > 1) compute a covariance matrix from a time window combining both active > and control windows. > 2) use this combined covariance to make a common mode lcmv beamformer > 3) apply this to both active and control windows separately > 4) combine into some sort of psuedo T or NAI. > > does this sound correct? > > > Yes it does. > > If so the main thing I'm unclear on is how to compute the covariance for 2 > distinct time intervals? is this possible? > > > What you could do is call ft_timelockanalysis twice: each time with a > different cfg.covariancewindow. Assuming you have an equal number of trials > for both time windows, averaging the two covariance matrices will give you > the combined covariance matrix. > > Best, > Jan-Mathijs > > > > Thanks, > Luke > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Fri Apr 18 11:38:12 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Fri, 18 Apr 2014 11:38:12 +0200 Subject: [FieldTrip] Resting State Data Source Reconstruction - covriance matrix in beamformer, and "avg" field in eLORETA Message-ID: > > Dear Roey, > I don't have answer to your question but I have some thoughts. Firstly , you can cut your EEG resting state data into trials (2s per trial) . Since the dominant frequency of resting state is alpha , you can build frequency domain beamformer 'DICS' with (cfg.normalize='yes') to normalize the lead field , which will avoid bias toward the center of the head (http://fieldtrip.fcdonders.nl/tutorial/beamformer). After that , you can use virtual channel (all voxels) to extract the time series ( http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors). However, I am not sure whether it makes sense or not . Maybe the experts can comment on it. Best, Haiteng > > > Message: 2 > Date: Tue, 15 Apr 2014 17:03:00 +0300 > From: Roey Schurr > To: FieldTrip discussion list > Subject: [FieldTrip] Resting State Data Source Reconstruction - > covriance matrix in beamformer, and "avg" field in eLORETA > Message-ID: > zYfDVYjg at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Dear Fieldtrippers, > > > First of all, a big thank you to all members of the community ? it is a > wonderful place to learn in and share ideas, thoughts and solutions to > common problems we all face. > > > I am writing you since I fear I might be missing something trivial: I am > trying to compute an inverse solution to to resting-state EEG data. Two > question arise, depending on the method I am trying to use: > > > 1) Using a beamformer technique such as LCMV, a covariance matrix is > needed. However, since the data is not time-locked (like ERP), the > covariance matrix cannot be easily computed over the averaged trials. Can > it be estimated using different resting-state trials? > > 2) Using eLORETA as the source reconstruction method (since my goal is > a time-domain source reconstruction), it seems the the "avg" field is neeed > in the data. Once again, no such average is available, since these are not > ERP trials. > > Would you advise me to revise the code and try to fit it to non-ERP data, > or is there some easier way I'm missing? > > > Thank you all, > > Best, > > roey > > > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Apr 22 09:01:25 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 22 Apr 2014 09:01:25 +0200 Subject: [FieldTrip] Problem with unwanted 'normalisation' of data using ft_realtime_signalviewer In-Reply-To: References: Message-ID: <535613C5.4040209@donders.ru.nl> Hi Christian, I had a quick look at these function. I think these values are a result of the fact that a) power corresponds to the squared magnitude of a signal b) is line 157 of ft_realtime_powerestimate, the power is divided by the number of channels. Maybe put a breakpoint somewhere around line 130 and check step by step what happens to your data? Note also that this is just an example function, so it might not be practical for real experiment. Best, Jörn On 4/17/2014 11:35 AM, Christian Walsh wrote: > Dear community, > > My name is Christian Walsh and I am doing a Neural Engineering MSc. in > TCD in Ireland. My thesis is on the effects of timed auditory > stimulation on sleep quality. A sort of dumbed down and scaled down > version of a recent enough study by Ngo et al. (2013) entitled: > Auditory Closed-Loop Stimulation of the Sleep Slow Oscillations > Enhances Memory. > > For this, I detect peaks and troughs in the ongoing EEG data in > realtime. On detecting a trough, a sound is played back after an > initial delay. This is done so that the sound playback coincides with > the peak of the ongoing EEG data. Before I can actually perform this > experiment I need to setup the apparatus. > > To do this I have simulated realtime streaming and analysis using the > ft_realtime_signalproxy function in one MATLAB session and an > edited_ft_realtime_powerestimate and psychtoolbox function in another > session. This is all working fine. The problem is that the data that > is streamed in is normalised, scaled or something. i.e. the y-values > of the streamed data should range from around -150 uV to 150uV but the > edited_ft_realtime_powerestimate function only displays y-values > between around -2 and 2??? > > I'm new to programming so apologies if this is a stupid question. I > have looked into editing some of the ft_read_data and > ft_preproc_baselinecorrect functions but have not found a solution. > > Advice would be appreciated, > > Cheers, > > Christian > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From haiteng.jiang at gmail.com Wed Apr 23 07:13:13 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Wed, 23 Apr 2014 07:13:13 +0200 Subject: [FieldTrip] DecMeg2014 competition: decoding the human brain Message-ID: Biomag 2014 Decoding Challenge - Brain Decoding Across Subjects https://www.kaggle.com/c/decoding-the-human-brain Decoding mental states from functional neuroimaging data is a data analysis paradigm adopted both in neuroscience studies and in brain-computer interface applications. Decoding means determining, from the recorded brain activity, what stimulus was provided to a subject. In this competition, a large number of trials, from a face vs. scrambled face visual task, are available from multiple subjects. The brain activity was recorded by means of magnetoencephalography (MEG). MEG recordings from various subjects and the category of the associated visual stimuli are given to the participants of the competition in order to train their prediction algorithms. With their algorithms, the participants will have to predict the category of the stimulus of a different set of MEG recordings, from other subjects. Each submission to the competition will be scored according to the accuracy of prediction. Decoding across subjects is a difficult task because of the variability in head shape, cortical folding and functional organisation. For MEG data, the literature on decoding across subjects is still in early stages and competition aims at raising the awareness about this complex scientific problem. This competition is associated with the the 19th International Conference on Biomagnetism, Biomag 2014, Halifax (Canada), August 24-28, 2014. The competition begins: April 21st, 2014. The competition ends: July 27th, 2014. Prizes: 1st 3,000 USD, 2nd 1,500 USD, 3rd 500 USD. Organizers: Emanuele Olivetti, Seyed Mostafa Kia and Paolo Avesani (NeuroInformatics Lab, Bruno Kessler Foundation and University of Trento, IT), e-mail: decmeg2014 at list.fbk.eu. Scientific steering committee: Ole Jensen (Donders Institute, NL),> Nathan Weisz (University of Trento, IT), Richard Henson (MRC/CBU, UK) and Alexandre Gramfort (Telecom ParisTech, CNRS, CEA / Neurospin). We would also like to thank Daniel Wakeman (Martinos Center, MGH, USA). The awards for this competition are funded by Elekta Oy, MEG International Services Ltd (MISL), Fondazione Bruno Kessler and Besa Gmbh. Relevant links: - competition website: https://www.kaggle.com/c/decoding-the-human-brain - Biomag 2014: http://www.biomag2014.org - NeuroInformatics Lab: http://nilab.fbk.eu - Elekta Oy: http://www.elekta.com - MISL (CTF MEG): http://www.ctfmeg.com - Fondazione Bruno Kessler: http://www.fbk.eu - Besa GmbH: http://www.besa.de Please feel free to forward this message to your colleagues or contacts who might be interested in this competition. -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmontefusco at med.uchile.cl Wed Apr 23 16:46:54 2014 From: rmontefusco at med.uchile.cl (Rodrigo Montefusco) Date: Wed, 23 Apr 2014 10:46:54 -0400 Subject: [FieldTrip] Bug 2010 Message-ID: Hi Fieldtripers, I have an issue with Fieldtrip, calling ft_timelockanalysis in a Mac with matlab 32bit. I found this bug reported around a year ago and I don't know if someone has the compiled file they mention. http://bugzilla.fcdonders.nl/show_bug.cgi?id=2010 Thanks a lot! Best Rodrigo -- Y ================================ *Dr. Rodrigo A. Montefusco-Siegmund, Ph.D.* Postdoctoral Fellow, York University Centre for Vision Research Department of Psychology +1 647 975 3847+1 647 975 3847+1 647 975 3847+1 647 975 3847 yoguito at gmail.com Call Send SMS Add to Skype You'll need Skype CreditFree via Skype Call Send SMS Add to Skype You'll need Skype CreditFree via Skype -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Wed Apr 23 16:54:20 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 23 Apr 2014 16:54:20 +0200 Subject: [FieldTrip] Bug 2010 In-Reply-To: References: Message-ID: <5357D41C.5070407@donders.ru.nl> Hi Rodrigo, does it work for you when you compile the file locally? The source is in FieldTrip/external/fileexchange Just try to call >> mex CalcMD5.c If it works, Matlab creates a mexmaci file and from then one, you should never have such problems again. Btw, if it does work, it would be nice if you sent us the CalcMD5.mexmaci file, so that we can add it to FieldTrip :) If you have trouble doing so, or any other questions, feel free to ask. Best, Jörn On 4/23/2014 4:46 PM, Rodrigo Montefusco wrote: > Hi Fieldtripers, > > I have an issue with Fieldtrip, calling ft_timelockanalysis in a Mac > with matlab 32bit. I found this bug reported around a year ago and I > don't know if someone has the compiled file they mention. > http://bugzilla.fcdonders.nl/show_bug.cgi?id=2010 > > Thanks a lot! > > Best > > Rodrigo > > -- > > > Y > > > ================================ > *Dr. Rodrigo A. Montefusco-Siegmund, Ph.D.* > Postdoctoral Fellow, York University > Centre for Vision Research > Department of Psychology > +1 647 975 3847+1 647 975 3847+1 647 975 3847+1 647 975 3847 > yoguito at gmail.com > Call > Send SMS > Add to Skype > You'll need Skype CreditFree via Skype > Call > Send SMS > Add to Skype > You'll need Skype CreditFree via Skype > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From file.balint at ttk.mta.hu Thu Apr 24 16:23:52 2014 From: file.balint at ttk.mta.hu (Balint File) Date: Thu, 24 Apr 2014 16:23:52 +0200 Subject: [FieldTrip] cluster based permutation test - cfg.clusteralpha threshold Message-ID: <53591E78.5020208@ttk.mta.hu> Dear Fieldtrip experts, Recently I started to apply the spatial dimension (electrode neighborhood) of the cluster based permutation test. My question is: it's a valid way to choose a more permissive threshold (cfg.clusteralpha) at the level of the clusters identifying t-tests? According to the publication of Maris et al., 2007 ("this threshold does not affect the FA rate of the statistical test. However, this threshold does affect the sensitivity of the test. For example, weak but long-lasting effects are not detected when the threshold is large") it seems to me, that this threshold depends on the nature of the data.For lower cfg.clusteralpha threshold (<0.15) I get more extensive (and more explainable) results and the clusters still show high significance (<<0.025) at the permutation test. Thanks in advance for your help. Best regards, Bálint File -------------- next part -------------- An HTML attachment was scrubbed... URL: From guofashou at gmail.com Thu Apr 24 16:54:10 2014 From: guofashou at gmail.com (guofa shou) Date: Thu, 24 Apr 2014 09:54:10 -0500 Subject: [FieldTrip] between subject permutation test Message-ID: Hi, Fieldtripers, I have a question about the parameters setting about running cluster-based permutation test on group-level frequency data. Specifically, I have two groups, one is 12 subjects (i.e., 12 averaged powers), the other is 10 subjects (10 averaged powers), I want to do comparison on the sensor powers between these two groups. so how can I set cfg.statistic, cfg.design. Thanks! Guofa -- Guofa Shou PhD Research fellow, Computational Neuroimaging and Neuroengineering Laboratory, University of Oklahoma 3100 Monitor Ave. Suit 280 phone: 405-496-8661 -------------- next part -------------- An HTML attachment was scrubbed... URL: From aaron.schurger at gmail.com Thu Apr 24 18:24:44 2014 From: aaron.schurger at gmail.com (Aaron Schurger) Date: Thu, 24 Apr 2014 18:24:44 +0200 Subject: [FieldTrip] cluster based permutation test - cfg.clusteralpha threshold In-Reply-To: <53591E78.5020208@ttk.mta.hu> References: <53591E78.5020208@ttk.mta.hu> Message-ID: Dear Balint, It was difficult to parse your question: "it’s a valid way to choose a more permissive threshold (cfg.clusteralpha) at the level of the clusters identifying t-tests?" If you are asking whether or not it is valid to use a lower point-wise threshold, then it is technically valid, but if, for example, you try every possible point-wise threshold from 0.01 to 0.20 in steps of 0.01, and you manage to find one that gives you a significant result - well that should be avoided. Otherwise it is OK. You might also try this: http://www.biomedcentral.com/1471-2202/14/122 with code available here: https://bitbucket.org/emsf/emsf_matlab Instead of trying to find clusters of points that covary with an experimental effect, you try to find a temporo-spatial weighting that maximizes the experimental effect, and then look at the spatial patterns (clusters) that give you the effect. Best, Aaron On Thu, Apr 24, 2014 at 4:23 PM, Balint File wrote: > Dear Fieldtrip experts, > > Recently I started to apply the spatial dimension (electrode neighborhood) > of the cluster based permutation test. My question is: it’s a valid way to > choose a more permissive threshold (cfg.clusteralpha) at the level of the > clusters identifying t-tests? According to the publication of Maris et al., > 2007 („this threshold does not affect the FA rate of the statistical test. > However, this threshold does affect the sensitivity of the test. For > example, weak but long-lasting effects are not detected when the threshold > is large”) it seems to me, that this threshold depends on the nature of the > data. For lower cfg.clusteralpha threshold (<0.15) I get more extensive > (and more explainable) results and the clusters still show high > significance (<<0.025) at the permutation test. > > Thanks in advance for your help. > > Best regards, > > Bálint File > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Aaron Schurger, PhD Senior researcher Laboratory of Cognitive Neuroscience Brain-Mind Institute, Department of Life Sciences École Polytechnique Fédérale de Lausanne Station 19, AI 2101 1015 Lausanne, Switzerland +41 21 693 1771 aaron.schurger at epfl.ch http://lnco.epfl.ch/ From haiteng.jiang at gmail.com Fri Apr 25 13:35:40 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Fri, 25 Apr 2014 13:35:40 +0200 Subject: [FieldTrip] between subject permutation test (guofa shou) Message-ID: Hi Guofa, This is quite similar to between trial experiment ( http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq). In your case, you could specify something like this: cfg.statistic = 'indepsamplesT'; design = zeros(1,22); design(1,10) = 1; % group 1 design(1,11:22) = 2; % group 2 cfg.design = design; cfg.ivar = 1; Best, Haiteng > > Message: 2 > Date: Thu, 24 Apr 2014 09:54:10 -0500 > From: guofa shou > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] between subject permutation test > Message-ID: > < > CAC4CbVLP176SnaPyBDfwqOkdO-jqQnMNFHRTytaQjk5Hsiuaog at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi, Fieldtripers, > I have a question about the parameters setting about running > cluster-based permutation test on group-level frequency data. Specifically, > I have two groups, one is 12 subjects (i.e., 12 averaged powers), the other > is 10 subjects (10 averaged powers), I want to do comparison on the sensor > powers between these two groups. so how can I set cfg.statistic, > cfg.design. > Thanks! > Guofa > > -- > Guofa Shou PhD > Research fellow, > Computational Neuroimaging and Neuroengineering Laboratory, > University of Oklahoma > 3100 Monitor Ave. Suit 280 > phone: 405-496-8661 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140424/5199110d/attachment-0001.html > > > > ------------------------------ > > Message: 3 > Date: Thu, 24 Apr 2014 18:24:44 +0200 > From: Aaron Schurger > To: FieldTrip discussion list > Subject: Re: [FieldTrip] cluster based permutation test - > cfg.clusteralpha threshold > Message-ID: > 8HFQpK3HHf6-Ba0g at mail.gmail.com> > Content-Type: text/plain; charset=UTF-8 > > Dear Balint, > It was difficult to parse your question: "it?s a valid way to choose a > more permissive threshold (cfg.clusteralpha) at the level of the > clusters identifying t-tests?" If you are asking whether or not it is > valid to use a lower point-wise threshold, then it is technically > valid, but if, for example, you try every possible point-wise > threshold from 0.01 to 0.20 in steps of 0.01, and you manage to find > one that gives you a significant result - well that should be avoided. > Otherwise it is OK. You might also try this: > http://www.biomedcentral.com/1471-2202/14/122 with code available > here: https://bitbucket.org/emsf/emsf_matlab > > Instead of trying to find clusters of points that covary with an > experimental effect, you try to find a temporo-spatial weighting that > maximizes the experimental effect, and then look at the spatial > patterns (clusters) that give you the effect. > > Best, > Aaron > > On Thu, Apr 24, 2014 at 4:23 PM, Balint File > wrote: > > Dear Fieldtrip experts, > > > > Recently I started to apply the spatial dimension (electrode > neighborhood) > > of the cluster based permutation test. My question is: it?s a valid way > to > > choose a more permissive threshold (cfg.clusteralpha) at the level of the > > clusters identifying t-tests? According to the publication of Maris et > al., > > 2007 (?this threshold does not affect the FA rate of the statistical > test. > > However, this threshold does affect the sensitivity of the test. For > > example, weak but long-lasting effects are not detected when the > threshold > > is large?) it seems to me, that this threshold depends on the nature of > the > > data. For lower cfg.clusteralpha threshold (<0.15) I get more extensive > > (and more explainable) results and the clusters still show high > > significance (<<0.025) at the permutation test. > > > > Thanks in advance for your help. > > > > Best regards, > > > > B?lint File > > > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Aaron Schurger, PhD > Senior researcher > Laboratory of Cognitive Neuroscience > Brain-Mind Institute, Department of Life Sciences > ?cole Polytechnique F?d?rale de Lausanne > Station 19, AI 2101 > 1015 Lausanne, Switzerland > +41 21 693 1771 > aaron.schurger at epfl.ch > http://lnco.epfl.ch/ > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 33 > ***************************************** > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Mon Apr 28 13:12:03 2014 From: pgoodin at swin.edu.au (Peter Goodin) Date: Mon, 28 Apr 2014 11:12:03 +0000 Subject: [FieldTrip] Sizing problems using SPM'd cortex mesh Message-ID: Dear Fieldtrippers, I've been using SPM to make the tessellated cortex mesh and then trying to use the outputted cortex gifti file as the source model. I've been making the head model via the method outlined in the tutorial (segmented MRI image etc). Everything appears to go fine except the size of the source model is slightly smaller than the head model (see attached image). I'm not really sure how to get around this or how much it'll affect the accuracy of the localisation Any help would be greatly appreciated! Peter __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 http://www.swinburne.edu.au/swinburneresearchers/index.php?fuseaction=profile&pid=4149 Monash Alfred Psychiatry Research Centre (MAPrc) Level 4, 607 St Kilda Road, Melbourne 3004 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: small_brain.tif Type: image/tiff Size: 83960 bytes Desc: small_brain.tif URL: From elisa at csl.psychol.cam.ac.uk Mon Apr 28 16:52:56 2014 From: elisa at csl.psychol.cam.ac.uk (Elisa Carrus) Date: Mon, 28 Apr 2014 15:52:56 +0100 Subject: [FieldTrip] problem with ft_resampledata after ft_preprocessing (inc. Hilbert) Message-ID: <535E6B48.4050401@csl.psychol.cam.ac.uk> Hi FT users, I am having some problems with resampling (downsampling) the data. Here is what I'm doing: I preprocess the continuous data to obtain band-pass filtered signal in several frequencies (4-8,8-12,12-30, etc), also taking the abs value of the Hilbert transform. The absolute value of the Hilbert is ultimately what I need. I have used the following code: / //cfg = [];// //cfg.channel = 'MEG';// //cfg.demean = 'yes';// //cfg.detrend = 'yes';// //cfg.lpfilter = 'yes';// //cfg.hilbert = 'abs';// //cfg.hpfilter = 'yes';// //cfg.hilbert = 'abs';// //cfg.lpfreq = 30;// //cfg.hpfreq = 12;// //cfg.dataset = '0061_syntask_02_raw_ssst_td.fif';// //cfg.continuous = 'yes';// //beta = ft_preprocessing(cfg);// / After this, I epoch the data as follows /cfg = [];// //cfg.trl = trl2; % this is a trial definition previously created// //beta_ep = ft_redefinetrial(cfg,beta);/ and then I downsample as follows: /cfg = [];// //cfg.resamplefs = 500;// //beta_epdw = ft_resampledata(cfg, beta_ep)/ I don't encounter any errors, but the strange thing is that the data looks fine up to before I downsample (i.e.g. if I plot one trial, it's all positive values, as I would expect from the abs of the Hilbert), but if I plot the downsampled data, the signal has both negative and positive values. Is there something I'm missing? Thanks a lot if you can help, Elisa -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Mon Apr 28 17:32:07 2014 From: julian.keil at gmail.com (Julian Keil) Date: Mon, 28 Apr 2014 17:32:07 +0200 Subject: [FieldTrip] problem with ft_resampledata after ft_preprocessing (inc. Hilbert) In-Reply-To: <535E6B48.4050401@csl.psychol.cam.ac.uk> References: <535E6B48.4050401@csl.psychol.cam.ac.uk> Message-ID: Hi Elisa, did you check your .cfg of the output for demean and detrend? Depending on the FT-Version you use, the defaults may be to demean and detrend your data which might center the data around 0. See the help of your fr_resampledata-function for more info. Best, Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 28.04.2014 um 16:52 schrieb Elisa Carrus: > Hi FT users, > > I am having some problems with resampling (downsampling) the data. > > Here is what I'm doing: > > I preprocess the continuous data to obtain band-pass filtered signal in several frequencies (4-8,8-12,12-30, etc), also taking the abs value of the Hilbert transform. The absolute value of the Hilbert is ultimately what I need. > > I have used the following code: > > cfg = []; > cfg.channel = 'MEG'; > cfg.demean = 'yes'; > cfg.detrend = 'yes'; > cfg.lpfilter = 'yes'; > cfg.hilbert = 'abs'; > cfg.hpfilter = 'yes'; > cfg.hilbert = 'abs'; > cfg.lpfreq = 30; > cfg.hpfreq = 12; > cfg.dataset = '0061_syntask_02_raw_ssst_td.fif'; > cfg.continuous = 'yes'; > beta = ft_preprocessing(cfg); > > After this, I epoch the data as follows > > cfg = []; > cfg.trl = trl2; % this is a trial definition previously created > beta_ep = ft_redefinetrial(cfg,beta); > > and then I downsample as follows: > > cfg = []; > cfg.resamplefs = 500; > beta_epdw = ft_resampledata(cfg, beta_ep) > > I don't encounter any errors, but the strange thing is that the data looks fine up to before I downsample (i.e.g. if I plot one trial, it's all positive values, as I would expect from the abs of the Hilbert), but if I plot the downsampled data, the signal has both negative and positive values. > > Is there something I'm missing? > > Thanks a lot if you can help, > > Elisa > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From elisa at csl.psychol.cam.ac.uk Mon Apr 28 17:45:28 2014 From: elisa at csl.psychol.cam.ac.uk (Elisa Carrus) Date: Mon, 28 Apr 2014 16:45:28 +0100 Subject: [FieldTrip] problem with ft_resampledata after ft_preprocessing (inc. Hilbert) In-Reply-To: References: <535E6B48.4050401@csl.psychol.cam.ac.uk> Message-ID: <535E7798.8090201@csl.psychol.cam.ac.uk> Ah, that's it! I should have set demean to 'no'. Thanks! On 28/04/2014 16:32, Julian Keil wrote: > Hi Elisa, > > did you check your .cfg of the output for demean and detrend? > Depending on the FT-Version you use, the defaults may be to demean and > detrend your data which might center the data around 0. > > See the help of your fr_resampledata-function for more info. > > Best, > > Julian > > > ******************** > *Dr. Julian Keil* > * > * > AG Multisensorische Integration > Psychiatrische Universitätsklinik > der Charité im St. Hedwig-Krankenhaus > Große Hamburger Straße 5-11, Raum E 307 > 10115 Berlin > > Telefon: +49-30-2311-1879 > Fax: +49-30-2311-2209 > http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration > > Am 28.04.2014 um 16:52 schrieb Elisa Carrus: > >> Hi FT users, >> >> I am having some problems with resampling (downsampling) the data. >> >> Here is what I'm doing: >> >> I preprocess the continuous data to obtain band-pass filtered signal >> in several frequencies (4-8,8-12,12-30, etc), also taking the abs >> value of the Hilbert transform. The absolute value of the Hilbert is >> ultimately what I need. >> >> I have used the following code: >> / >> //cfg = [];// >> //cfg.channel = 'MEG';// >> //cfg.demean = 'yes';// >> //cfg.detrend = 'yes';// >> //cfg.lpfilter = 'yes';// >> //cfg.hilbert = 'abs';// >> //cfg.hpfilter = 'yes';// >> //cfg.hilbert = 'abs';// >> //cfg.lpfreq = 30;// >> //cfg.hpfreq = 12;// >> //cfg.dataset = '0061_syntask_02_raw_ssst_td.fif';// >> //cfg.continuous = 'yes';// >> //beta = ft_preprocessing(cfg);// >> / >> After this, I epoch the data as follows >> >> /cfg = [];// >> //cfg.trl = trl2; % this is a trial definition previously created// >> //beta_ep = ft_redefinetrial(cfg,beta);/ >> >> and then I downsample as follows: >> >> /cfg = [];// >> //cfg.resamplefs = 500;// >> //beta_epdw = ft_resampledata(cfg, beta_ep)/ >> >> I don't encounter any errors, but the strange thing is that the data >> looks fine up to before I downsample (i.e.g. if I plot one trial, >> it's all positive values, as I would expect from the abs of the >> Hilbert), but if I plot the downsampled data, the signal has both >> negative and positive values. >> >> Is there something I'm missing? >> >> Thanks a lot if you can help, >> >> Elisa >> >> >> >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From guofashou at gmail.com Tue Apr 29 04:15:15 2014 From: guofashou at gmail.com (guofa shou) Date: Mon, 28 Apr 2014 21:15:15 -0500 Subject: [FieldTrip] fieldtrip Digest, Vol 41, Issue 34 In-Reply-To: References: Message-ID: Thanks, Haiteng. And I have one more question about which coherence equation was used in Fieldtrip? I have checked the code, it seems it is different compared to the following equation (from Srinivasan, Ramesh, et al. "EEG and MEG coherence: measures of functional connectivity at distinct spatial scales of neocortical dynamics." *Journal of neuroscience methods* 166.1 (2007): 41-52.): [image: Inline image 2] [image: Inline image 1] Thanks, On Sat, Apr 26, 2014 at 5:00 AM, wrote: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: between subject permutation test (guofa shou) (Haiteng Jiang) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 25 Apr 2014 13:35:40 +0200 > From: Haiteng Jiang > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] between subject permutation test (guofa shou) > Message-ID: > ESHa93x8hXXP2LaqRGrA at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi Guofa, > This is quite similar to between trial experiment ( > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq). In your > case, you could specify something like this: > > cfg.statistic = 'indepsamplesT'; > design = zeros(1,22); > design(1,10) = 1; % group 1 > design(1,11:22) = 2; % group 2 > cfg.design = design; > cfg.ivar = 1; > > Best, > > Haiteng > > > > > > > Message: 2 > > Date: Thu, 24 Apr 2014 09:54:10 -0500 > > From: guofa shou > > To: fieldtrip at science.ru.nl > > Subject: [FieldTrip] between subject permutation test > > Message-ID: > > < > > CAC4CbVLP176SnaPyBDfwqOkdO-jqQnMNFHRTytaQjk5Hsiuaog at mail.gmail.com> > > Content-Type: text/plain; charset="utf-8" > > > > Hi, Fieldtripers, > > I have a question about the parameters setting about running > > cluster-based permutation test on group-level frequency data. > Specifically, > > I have two groups, one is 12 subjects (i.e., 12 averaged powers), the > other > > is 10 subjects (10 averaged powers), I want to do comparison on the > sensor > > powers between these two groups. so how can I set cfg.statistic, > > cfg.design. > > Thanks! > > Guofa > > > > -- > > Guofa Shou PhD > > Research fellow, > > Computational Neuroimaging and Neuroengineering Laboratory, > > University of Oklahoma > > 3100 Monitor Ave. Suit 280 > > phone: 405-496-8661 > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: < > > > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140424/5199110d/attachment-0001.html > > > > > > > ------------------------------ > > > > Message: 3 > > Date: Thu, 24 Apr 2014 18:24:44 +0200 > > From: Aaron Schurger > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] cluster based permutation test - > > cfg.clusteralpha threshold > > Message-ID: > > > 8HFQpK3HHf6-Ba0g at mail.gmail.com> > > Content-Type: text/plain; charset=UTF-8 > > > > Dear Balint, > > It was difficult to parse your question: "it?s a valid way to choose a > > more permissive threshold (cfg.clusteralpha) at the level of the > > clusters identifying t-tests?" If you are asking whether or not it is > > valid to use a lower point-wise threshold, then it is technically > > valid, but if, for example, you try every possible point-wise > > threshold from 0.01 to 0.20 in steps of 0.01, and you manage to find > > one that gives you a significant result - well that should be avoided. > > Otherwise it is OK. You might also try this: > > http://www.biomedcentral.com/1471-2202/14/122 with code available > > here: https://bitbucket.org/emsf/emsf_matlab > > > > Instead of trying to find clusters of points that covary with an > > experimental effect, you try to find a temporo-spatial weighting that > > maximizes the experimental effect, and then look at the spatial > > patterns (clusters) that give you the effect. > > > > Best, > > Aaron > > > > On Thu, Apr 24, 2014 at 4:23 PM, Balint File > > wrote: > > > Dear Fieldtrip experts, > > > > > > Recently I started to apply the spatial dimension (electrode > > neighborhood) > > > of the cluster based permutation test. My question is: it?s a valid way > > to > > > choose a more permissive threshold (cfg.clusteralpha) at the level of > the > > > clusters identifying t-tests? According to the publication of Maris et > > al., > > > 2007 (?this threshold does not affect the FA rate of the statistical > > test. > > > However, this threshold does affect the sensitivity of the test. For > > > example, weak but long-lasting effects are not detected when the > > threshold > > > is large?) it seems to me, that this threshold depends on the nature of > > the > > > data. For lower cfg.clusteralpha threshold (<0.15) I get more > extensive > > > (and more explainable) results and the clusters still show high > > > significance (<<0.025) at the permutation test. > > > > > > Thanks in advance for your help. > > > > > > Best regards, > > > > > > B?lint File > > > > > > > > > > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > > > -- > > Aaron Schurger, PhD > > Senior researcher > > Laboratory of Cognitive Neuroscience > > Brain-Mind Institute, Department of Life Sciences > > ?cole Polytechnique F?d?rale de Lausanne > > Station 19, AI 2101 > > 1015 Lausanne, Switzerland > > +41 21 693 1771 > > aaron.schurger at epfl.ch > > http://lnco.epfl.ch/ > > > > > > > > ------------------------------ > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > End of fieldtrip Digest, Vol 41, Issue 33 > > ***************************************** > > > > > > -- > Haiteng Jiang > PhD candidate > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Visiting address > Room 2.32 > Donders Centre for Cognitive Neuroimaging > Kapittelweg 29 > 6525 EN Nijmegen > the Netherlands > > Tel.: +31 (0)243668291 > Web: https://sites.google.com/site/haitengjiang/ > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140425/3a4d8ea8/attachment-0001.html > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 34 > ***************************************** > -- Guofa Shou PhD Research associate, Computational Neuroimaging and Neuroengineering Laboratory, University of Oklahoma 3100 Monitor Ave. Suit 280 phone: 405-443-0133 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 2394 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 3697 bytes Desc: not available URL: From mbj0310 at gmail.com Tue Apr 29 04:40:04 2014 From: mbj0310 at gmail.com (Beom Jun Min) Date: Tue, 29 Apr 2014 11:40:04 +0900 Subject: [FieldTrip] Clustering analysis with One way ANOVA design Message-ID: Dear trippers, I am not sure about my script for one-way ANOVA design. I have searched in the discussion list, but I cannot find. What I want to compare is F-statistics with different three groups, not interaction effect by now. cfg = []; cfg.channel = 'all'; cfg.neighbours = neighbours; cfg.latency = [0.2 0.3]; cfg.trials = 'all'; cfg.frequency = [32 32]; cfg.avgoverchan = 'no'; cfg.avgovertime = 'no'; cfg.avgoverfreq = 'no'; cfg.parameter = 'powspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'indepsamplesF'; cfg.alpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfg.tail = 1; cfg.clustertail = 1; cfg.correctm = 'cluster'; cfg.numrandomization = 1000; cfg.design = [ones(1,36), ones(1,34)*2, ones(1,28)*3] ; % N x num of observations cfg.ivar = 1; stat = ft_freqstatistics(cfg, A_zscore{1:36}, B_zscore{1:34}, C_zscore{1:28}); Is that script right? Especially, I am not sure that the design, and tail parameters (right-sided tail in the code) are correct. With regards -- BeomJun Min, M.D. Department of Medical System Engineering (DMSE) Gwangju Institute of Science and Technology (GIST) 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju 500-712, Republic of Korea (South) Phone: +82-62-715-3266 / Fax: +82-62-715-3244 E-mail: mbj0310 at gmail.com, http://bmssa.gist.ac.kr -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Apr 29 11:17:20 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 29 Apr 2014 11:17:20 +0200 Subject: [FieldTrip] problem with ft_resampledata after ft_preprocessing (inc. Hilbert) In-Reply-To: <535E7798.8090201@csl.psychol.cam.ac.uk> References: <535E6B48.4050401@csl.psychol.cam.ac.uk> <535E7798.8090201@csl.psychol.cam.ac.uk> Message-ID: <535F6E20.1070006@donders.ru.nl> Hi Elisa, please note the following things: 1) Using an up-to-date version is always good (in a more recent FT version, you are forced to specify cfg.detrend when applying ft_resampledata). 2) Find out whether the version you are using detrending is applied by default (it used to be, but we changed this default. If you want to know why, check the help of ft_resampledata in one of the newer versions). 3) In ft_resampledata, we now suggest to apply demeaning before resampling. You can always add back the mean after resampling (given that you saved it beforehands) Best, Jörn On 4/28/2014 5:45 PM, Elisa Carrus wrote: > Ah, that's it! I should have set demean to 'no'. > > Thanks! > > On 28/04/2014 16:32, Julian Keil wrote: >> Hi Elisa, >> >> did you check your .cfg of the output for demean and detrend? >> Depending on the FT-Version you use, the defaults may be to demean >> and detrend your data which might center the data around 0. >> >> See the help of your fr_resampledata-function for more info. >> >> Best, >> >> Julian >> >> >> ******************** >> *Dr. Julian Keil* >> * >> * >> AG Multisensorische Integration >> Psychiatrische Universitätsklinik >> der Charité im St. Hedwig-Krankenhaus >> Große Hamburger Straße 5-11, Raum E 307 >> 10115 Berlin >> >> Telefon: +49-30-2311-1879 >> Fax: +49-30-2311-2209 >> http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration >> >> Am 28.04.2014 um 16:52 schrieb Elisa Carrus: >> >>> Hi FT users, >>> >>> I am having some problems with resampling (downsampling) the data. >>> >>> Here is what I'm doing: >>> >>> I preprocess the continuous data to obtain band-pass filtered signal >>> in several frequencies (4-8,8-12,12-30, etc), also taking the abs >>> value of the Hilbert transform. The absolute value of the Hilbert is >>> ultimately what I need. >>> >>> I have used the following code: >>> / >>> //cfg = [];// >>> //cfg.channel = 'MEG';// >>> //cfg.demean = 'yes';// >>> //cfg.detrend = 'yes';// >>> //cfg.lpfilter = 'yes';// >>> //cfg.hilbert = 'abs';// >>> //cfg.hpfilter = 'yes';// >>> //cfg.hilbert = 'abs';// >>> //cfg.lpfreq = 30;// >>> //cfg.hpfreq = 12;// >>> //cfg.dataset = '0061_syntask_02_raw_ssst_td.fif';// >>> //cfg.continuous = 'yes';// >>> //beta = ft_preprocessing(cfg);// >>> / >>> After this, I epoch the data as follows >>> >>> /cfg = [];// >>> //cfg.trl = trl2; % this is a trial definition previously created// >>> //beta_ep = ft_redefinetrial(cfg,beta);/ >>> >>> and then I downsample as follows: >>> >>> /cfg = [];// >>> //cfg.resamplefs = 500;// >>> //beta_epdw = ft_resampledata(cfg, beta_ep)/ >>> >>> I don't encounter any errors, but the strange thing is that the data >>> looks fine up to before I downsample (i.e.g. if I plot one trial, >>> it's all positive values, as I would expect from the abs of the >>> Hilbert), but if I plot the downsampled data, the signal has both >>> negative and positive values. >>> >>> Is there something I'm missing? >>> >>> Thanks a lot if you can help, >>> >>> Elisa >>> >>> >>> >>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Tue Apr 29 11:32:35 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 29 Apr 2014 11:32:35 +0200 Subject: [FieldTrip] fieldtrip Digest, Vol 41, Issue 34 In-Reply-To: References: Message-ID: <535F71B3.6020703@donders.ru.nl> Hi Guofa, What you copied looks to me like squared coherence, whereas FieldTrip computes absolute coherence. In essence, there is not much difference (as you can probably infer from the name). In my opinion, it depends mostly on what statistics you are using and what other methods to find out what makes most sense. Most papers that I know report coherence, so I personally prefer coherence because I know what values do make sense. But that's a matter of choice. You can check Maris, Schoffelen & Oostenveld, 2007 in JNM for formula that Fieldtrip uses (see also http://fieldtrip.fcdonders.nl/references_to_implemented_methods) Best, Jörn On 4/29/2014 4:15 AM, guofa shou wrote: > Thanks, Haiteng. > And I have one more question about which coherence equation was used > in Fieldtrip? I have checked the code, it seems it is different > compared to the following equation (from Srinivasan, Ramesh, et al. > "EEG and MEG coherence: measures of functional connectivity at > distinct spatial scales of neocortical dynamics." /Journal of > neuroscience methods/ 166.1 (2007): 41-52.): > Inline image 2 > Inline image 1 > Thanks, > > > > On Sat, Apr 26, 2014 at 5:00 AM, > wrote: > > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: between subject permutation test (guofa shou) (Haiteng > Jiang) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 25 Apr 2014 13:35:40 +0200 > From: Haiteng Jiang > > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] between subject permutation test (guofa shou) > Message-ID: > > > > Content-Type: text/plain; charset="utf-8" > > Hi Guofa, > This is quite similar to between trial experiment ( > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq). > In your > case, you could specify something like this: > > cfg.statistic = 'indepsamplesT'; > design = zeros(1,22); > design(1,10) = 1; % group 1 > design(1,11:22) = 2; % group 2 > cfg.design = design; > cfg.ivar = 1; > > Best, > > Haiteng > > > > > > > Message: 2 > > Date: Thu, 24 Apr 2014 09:54:10 -0500 > > From: guofa shou > > > To: fieldtrip at science.ru.nl > > Subject: [FieldTrip] between subject permutation test > > Message-ID: > > < > > > CAC4CbVLP176SnaPyBDfwqOkdO-jqQnMNFHRTytaQjk5Hsiuaog at mail.gmail.com > > > > Content-Type: text/plain; charset="utf-8" > > > > Hi, Fieldtripers, > > I have a question about the parameters setting about running > > cluster-based permutation test on group-level frequency data. > Specifically, > > I have two groups, one is 12 subjects (i.e., 12 averaged > powers), the other > > is 10 subjects (10 averaged powers), I want to do comparison on > the sensor > > powers between these two groups. so how can I set cfg.statistic, > > cfg.design. > > Thanks! > > Guofa > > > > -- > > Guofa Shou PhD > > Research fellow, > > Computational Neuroimaging and Neuroengineering Laboratory, > > University of Oklahoma > > 3100 Monitor Ave. Suit 280 > > phone: 405-496-8661 > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: < > > > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140424/5199110d/attachment-0001.html > > > > > > > ------------------------------ > > > > Message: 3 > > Date: Thu, 24 Apr 2014 18:24:44 +0200 > > From: Aaron Schurger > > > To: FieldTrip discussion list > > > Subject: Re: [FieldTrip] cluster based permutation test - > > cfg.clusteralpha threshold > > Message-ID: > > > 8HFQpK3HHf6-Ba0g at mail.gmail.com > > > > Content-Type: text/plain; charset=UTF-8 > > > > Dear Balint, > > It was difficult to parse your question: "it?s a valid way to > choose a > > more permissive threshold (cfg.clusteralpha) at the level of the > > clusters identifying t-tests?" If you are asking whether or not > it is > > valid to use a lower point-wise threshold, then it is technically > > valid, but if, for example, you try every possible point-wise > > threshold from 0.01 to 0.20 in steps of 0.01, and you manage to find > > one that gives you a significant result - well that should be > avoided. > > Otherwise it is OK. You might also try this: > > http://www.biomedcentral.com/1471-2202/14/122 with code available > > here: https://bitbucket.org/emsf/emsf_matlab > > > > Instead of trying to find clusters of points that covary with an > > experimental effect, you try to find a temporo-spatial weighting > that > > maximizes the experimental effect, and then look at the spatial > > patterns (clusters) that give you the effect. > > > > Best, > > Aaron > > > > On Thu, Apr 24, 2014 at 4:23 PM, Balint File > > > > wrote: > > > Dear Fieldtrip experts, > > > > > > Recently I started to apply the spatial dimension (electrode > > neighborhood) > > > of the cluster based permutation test. My question is: it?s a > valid way > > to > > > choose a more permissive threshold (cfg.clusteralpha) at the > level of the > > > clusters identifying t-tests? According to the publication of > Maris et > > al., > > > 2007 (?this threshold does not affect the FA rate of the > statistical > > test. > > > However, this threshold does affect the sensitivity of the > test. For > > > example, weak but long-lasting effects are not detected when the > > threshold > > > is large?) it seems to me, that this threshold depends on the > nature of > > the > > > data. For lower cfg.clusteralpha threshold (<0.15) I get more > extensive > > > (and more explainable) results and the clusters still show high > > > significance (<<0.025) at the permutation test. > > > > > > Thanks in advance for your help. > > > > > > Best regards, > > > > > > B?lint File > > > > > > > > > > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > > > -- > > Aaron Schurger, PhD > > Senior researcher > > Laboratory of Cognitive Neuroscience > > Brain-Mind Institute, Department of Life Sciences > > ?cole Polytechnique F?d?rale de Lausanne > > Station 19, AI 2101 > > 1015 Lausanne, Switzerland > > +41 21 693 1771 > > aaron.schurger at epfl.ch > > http://lnco.epfl.ch/ > > > > > > > > ------------------------------ > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > End of fieldtrip Digest, Vol 41, Issue 33 > > ***************************************** > > > > > > -- > Haiteng Jiang > PhD candidate > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Visiting address > Room 2.32 > Donders Centre for Cognitive Neuroimaging > Kapittelweg 29 > 6525 EN Nijmegen > the Netherlands > > Tel.: +31 (0)243668291 > Web: https://sites.google.com/site/haitengjiang/ > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 34 > ***************************************** > > > > > -- > Guofa Shou PhD > Research associate, > Computational Neuroimaging and Neuroengineering Laboratory, > University of Oklahoma > 3100 Monitor Ave. Suit 280 > phone: 405-443-0133 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Tue Apr 29 15:28:04 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 29 Apr 2014 15:28:04 +0200 Subject: [FieldTrip] fieldtrip Digest, Vol 41, Issue 34 In-Reply-To: <535F71B3.6020703@donders.ru.nl> References: <535F71B3.6020703@donders.ru.nl> Message-ID: <535FA8E4.8010800@donders.ru.nl> whops, an important correction, I meant Maris, Schoffelen & Fries 2007, my bad On 4/29/2014 11:32 AM, "Jörn M. Horschig" wrote: > Hi Guofa, > > What you copied looks to me like squared coherence, whereas FieldTrip > computes absolute coherence. In essence, there is not much difference > (as you can probably infer from the name). In my opinion, it depends > mostly on what statistics you are using and what other methods to find > out what makes most sense. Most papers that I know report coherence, > so I personally prefer coherence because I know what values do make > sense. But that's a matter of choice. > > You can check Maris, Schoffelen & Oostenveld, 2007 in JNM for formula > that Fieldtrip uses (see also > http://fieldtrip.fcdonders.nl/references_to_implemented_methods) > > Best, > Jörn > > > On 4/29/2014 4:15 AM, guofa shou wrote: >> Thanks, Haiteng. >> And I have one more question about which coherence equation was used >> in Fieldtrip? I have checked the code, it seems it is different >> compared to the following equation (from Srinivasan, Ramesh, et al. >> "EEG and MEG coherence: measures of functional connectivity at >> distinct spatial scales of neocortical dynamics." /Journal of >> neuroscience methods/ 166.1 (2007): 41-52.): >> Inline image 2 >> Inline image 1 >> Thanks, >> >> >> >> On Sat, Apr 26, 2014 at 5:00 AM, > > wrote: >> >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. Re: between subject permutation test (guofa shou) (Haiteng >> Jiang) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Fri, 25 Apr 2014 13:35:40 +0200 >> From: Haiteng Jiang > > >> To: fieldtrip at science.ru.nl >> Subject: Re: [FieldTrip] between subject permutation test (guofa >> shou) >> Message-ID: >> > > >> Content-Type: text/plain; charset="utf-8" >> >> Hi Guofa, >> This is quite similar to between trial experiment ( >> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq). >> In your >> case, you could specify something like this: >> >> cfg.statistic = 'indepsamplesT'; >> design = zeros(1,22); >> design(1,10) = 1; % group 1 >> design(1,11:22) = 2; % group 2 >> cfg.design = design; >> cfg.ivar = 1; >> >> Best, >> >> Haiteng >> >> >> >> > >> > Message: 2 >> > Date: Thu, 24 Apr 2014 09:54:10 -0500 >> > From: guofa shou > > >> > To: fieldtrip at science.ru.nl >> > Subject: [FieldTrip] between subject permutation test >> > Message-ID: >> > < >> > >> CAC4CbVLP176SnaPyBDfwqOkdO-jqQnMNFHRTytaQjk5Hsiuaog at mail.gmail.com >> > >> > Content-Type: text/plain; charset="utf-8" >> > >> > Hi, Fieldtripers, >> > I have a question about the parameters setting about running >> > cluster-based permutation test on group-level frequency data. >> Specifically, >> > I have two groups, one is 12 subjects (i.e., 12 averaged >> powers), the other >> > is 10 subjects (10 averaged powers), I want to do comparison on >> the sensor >> > powers between these two groups. so how can I set cfg.statistic, >> > cfg.design. >> > Thanks! >> > Guofa >> > >> > -- >> > Guofa Shou PhD >> > Research fellow, >> > Computational Neuroimaging and Neuroengineering Laboratory, >> > University of Oklahoma >> > 3100 Monitor Ave. Suit 280 >> > phone: 405-496-8661 >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: < >> > >> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140424/5199110d/attachment-0001.html >> > > >> > >> > ------------------------------ >> > >> > Message: 3 >> > Date: Thu, 24 Apr 2014 18:24:44 +0200 >> > From: Aaron Schurger > > >> > To: FieldTrip discussion list > > >> > Subject: Re: [FieldTrip] cluster based permutation test - >> > cfg.clusteralpha threshold >> > Message-ID: >> > > > 8HFQpK3HHf6-Ba0g at mail.gmail.com >> > >> > Content-Type: text/plain; charset=UTF-8 >> > >> > Dear Balint, >> > It was difficult to parse your question: "it?s a valid way to >> choose a >> > more permissive threshold (cfg.clusteralpha) at the level of the >> > clusters identifying t-tests?" If you are asking whether or not >> it is >> > valid to use a lower point-wise threshold, then it is technically >> > valid, but if, for example, you try every possible point-wise >> > threshold from 0.01 to 0.20 in steps of 0.01, and you manage to >> find >> > one that gives you a significant result - well that should be >> avoided. >> > Otherwise it is OK. You might also try this: >> > http://www.biomedcentral.com/1471-2202/14/122 with code available >> > here: https://bitbucket.org/emsf/emsf_matlab >> > >> > Instead of trying to find clusters of points that covary with an >> > experimental effect, you try to find a temporo-spatial weighting >> that >> > maximizes the experimental effect, and then look at the spatial >> > patterns (clusters) that give you the effect. >> > >> > Best, >> > Aaron >> > >> > On Thu, Apr 24, 2014 at 4:23 PM, Balint File >> > >> > wrote: >> > > Dear Fieldtrip experts, >> > > >> > > Recently I started to apply the spatial dimension (electrode >> > neighborhood) >> > > of the cluster based permutation test. My question is: it?s a >> valid way >> > to >> > > choose a more permissive threshold (cfg.clusteralpha) at the >> level of the >> > > clusters identifying t-tests? According to the publication of >> Maris et >> > al., >> > > 2007 (?this threshold does not affect the FA rate of the >> statistical >> > test. >> > > However, this threshold does affect the sensitivity of the >> test. For >> > > example, weak but long-lasting effects are not detected when the >> > threshold >> > > is large?) it seems to me, that this threshold depends on the >> nature of >> > the >> > > data. For lower cfg.clusteralpha threshold (<0.15) I get more >> extensive >> > > (and more explainable) results and the clusters still show high >> > > significance (<<0.025) at the permutation test. >> > > >> > > Thanks in advance for your help. >> > > >> > > Best regards, >> > > >> > > B?lint File >> > > >> > > >> > > >> > > _______________________________________________ >> > > fieldtrip mailing list >> > > fieldtrip at donders.ru.nl >> > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > >> > >> > -- >> > Aaron Schurger, PhD >> > Senior researcher >> > Laboratory of Cognitive Neuroscience >> > Brain-Mind Institute, Department of Life Sciences >> > ?cole Polytechnique F?d?rale de Lausanne >> > Station 19, AI 2101 >> > 1015 Lausanne, Switzerland >> > +41 21 693 1771 >> > aaron.schurger at epfl.ch >> > http://lnco.epfl.ch/ >> > >> > >> > >> > ------------------------------ >> > >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > End of fieldtrip Digest, Vol 41, Issue 33 >> > ***************************************** >> > >> >> >> >> -- >> Haiteng Jiang >> PhD candidate >> Neuronal Oscillations Group >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> >> Visiting address >> Room 2.32 >> Donders Centre for Cognitive Neuroimaging >> Kapittelweg 29 >> 6525 EN Nijmegen >> the Netherlands >> >> Tel.: +31 (0)243668291 >> Web: https://sites.google.com/site/haitengjiang/ >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> >> ------------------------------ >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> End of fieldtrip Digest, Vol 41, Issue 34 >> ***************************************** >> >> >> >> >> -- >> Guofa Shou PhD >> Research associate, >> Computational Neuroimaging and Neuroengineering Laboratory, >> University of Oklahoma >> 3100 Monitor Ave. Suit 280 >> phone: 405-443-0133 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From marial.stavrinou at gmail.com Tue Apr 29 15:52:49 2014 From: marial.stavrinou at gmail.com (Maria L. Stavrinou) Date: Tue, 29 Apr 2014 15:52:49 +0200 Subject: [FieldTrip] simple sinusoidal signal as input to wavelet analysis Message-ID: Dear fieldtrip community, I am trying to import my own sinusoidal signal in order to make a wavelet analysis, get the result and find the total power. I cannot make the sinusoidal signal proper for the field trip. I get this message: Error using fixdimord (line 84) the data does not contain a dimord, but it also does not resemble raw or component data Error in ft_datatype_timelock (line 78) timelock = fixdimord(timelock); Error in ft_checkdata (line 207) data = ft_datatype_timelock(data); Error in ft_redefinetrial (line 104) data = ft_checkdata(data, 'datatype', 'raw', 'feedback', cfg.feedback); How should i do that? Best regards, Maria -- -- Maria L. Stavrinou MSc. PhD. Postdoc, Computational Neuroscience Norwegian University of Life Sciences, Ås, Norway http://compneuro.umb.no/ personal web-site: https://sites.google.com/site/marialstavrinou/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Tue Apr 29 17:36:55 2014 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Tue, 29 Apr 2014 11:36:55 -0400 Subject: [FieldTrip] simple sinusoidal signal as input to wavelet analysis In-Reply-To: References: Message-ID: Hello Maria, I have an MEG data set measured from a current dipole energized by a generator with a sinusoidal signal at 7Hz. All waveforms look pretty sinusoidal on all channels. I was able to import the data into Matlab too. I can share the data if it helps. Thanks, Inna Inna McGowin On Tue, Apr 29, 2014 at 9:52 AM, Maria L. Stavrinou < marial.stavrinou at gmail.com> wrote: > Dear fieldtrip community, > I am trying to import my own sinusoidal signal in order to make a wavelet > analysis, get the result and find the total power. > I cannot make the sinusoidal signal proper for the field trip. I get this > message: > > Error using fixdimord (line 84) > the data does not contain a dimord, but it also does not resemble raw or > component data > > Error in ft_datatype_timelock (line 78) > timelock = fixdimord(timelock); > > Error in ft_checkdata (line 207) > data = ft_datatype_timelock(data); > > Error in ft_redefinetrial (line 104) > data = ft_checkdata(data, 'datatype', 'raw', 'feedback', cfg.feedback); > > How should i do that? > > > Best regards, > Maria > > -- > -- > Maria L. Stavrinou > MSc. PhD. > Postdoc, Computational Neuroscience > Norwegian University of Life Sciences, Ås, Norway > http://compneuro.umb.no/ > > personal web-site: https://sites.google.com/site/marialstavrinou/ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at fcdonders.ru.nl Wed Apr 30 09:06:24 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Wed, 30 Apr 2014 09:06:24 +0200 (CEST) Subject: [FieldTrip] simple sinusoidal signal as input to wavelet analysis In-Reply-To: References: Message-ID: <013e01cf6442$b373e5d0$1a5bb170$@herring@fcdonders.ru.nl> Hi Maria, To be able to use your data in Fieldtrip you need to structure it in a certain way. Please have a look at http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat for an example. In short you will need to create a structure with a couple of fields that contain your raw data, sampling rate, etc. Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Maria L. Stavrinou Sent: dinsdag 29 april 2014 15:53 To: fieldtrip at science.ru.nl Subject: [FieldTrip] simple sinusoidal signal as input to wavelet analysis Dear fieldtrip community, I am trying to import my own sinusoidal signal in order to make a wavelet analysis, get the result and find the total power. I cannot make the sinusoidal signal proper for the field trip. I get this message: Error using fixdimord (line 84) the data does not contain a dimord, but it also does not resemble raw or component data Error in ft_datatype_timelock (line 78) timelock = fixdimord(timelock); Error in ft_checkdata (line 207) data = ft_datatype_timelock(data); Error in ft_redefinetrial (line 104) data = ft_checkdata(data, 'datatype', 'raw', 'feedback', cfg.feedback); How should i do that? Best regards, Maria -- -- Maria L. Stavrinou MSc. PhD. Postdoc, Computational Neuroscience Norwegian University of Life Sciences, Ås, Norway http://compneuro.umb.no/ personal web-site: https://sites.google.com/site/marialstavrinou/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From pierpaolo12croce at gmail.com Wed Apr 30 10:18:51 2014 From: pierpaolo12croce at gmail.com (Pierpaolo Croce) Date: Wed, 30 Apr 2014 10:18:51 +0200 Subject: [FieldTrip] txt file Message-ID: Dear Experts, i m a new ft user, i m writing to ask how open simple txt files with ft. this file is without any header. best -- PC -------------- next part -------------- An HTML attachment was scrubbed... URL: From elisa at csl.psychol.cam.ac.uk Wed Apr 30 12:38:01 2014 From: elisa at csl.psychol.cam.ac.uk (Elisa Carrus) Date: Wed, 30 Apr 2014 11:38:01 +0100 Subject: [FieldTrip] problem with ft_resampledata after ft_preprocessing (inc. Hilbert) In-Reply-To: <535F6E20.1070006@donders.ru.nl> References: <535E6B48.4050401@csl.psychol.cam.ac.uk> <535E7798.8090201@csl.psychol.cam.ac.uk> <535F6E20.1070006@donders.ru.nl> Message-ID: <5360D289.60907@csl.psychol.cam.ac.uk> Thanks Jörn, Yes, I have the latest version and I am forced to specify the detrend option. However, as for cfg.demean, I had done it when reading the continuous data with ft_preprocessing. Would you suggest doing it again then, when resampling the epoched data? It's because when I resample with 'cfg.demean = yes', my Hilbert values are centred around zero, i.e. I have both positive and negative values. Thanks, Elisa On 29/04/2014 10:17, "Jörn M. Horschig" wrote: > Hi Elisa, > > please note the following things: > 1) Using an up-to-date version is always good (in a more recent FT > version, you are forced to specify cfg.detrend when applying > ft_resampledata). > 2) Find out whether the version you are using detrending is applied by > default (it used to be, but we changed this default. If you want to > know why, check the help of ft_resampledata in one of the newer > versions). > 3) In ft_resampledata, we now suggest to apply demeaning before > resampling. You can always add back the mean after resampling (given > that you saved it beforehands) > > Best, > Jörn > > > > On 4/28/2014 5:45 PM, Elisa Carrus wrote: >> Ah, that's it! I should have set demean to 'no'. >> >> Thanks! >> >> On 28/04/2014 16:32, Julian Keil wrote: >>> Hi Elisa, >>> >>> did you check your .cfg of the output for demean and detrend? >>> Depending on the FT-Version you use, the defaults may be to demean >>> and detrend your data which might center the data around 0. >>> >>> See the help of your fr_resampledata-function for more info. >>> >>> Best, >>> >>> Julian >>> >>> >>> ******************** >>> *Dr. Julian Keil* >>> * >>> * >>> AG Multisensorische Integration >>> Psychiatrische Universitätsklinik >>> der Charité im St. Hedwig-Krankenhaus >>> Große Hamburger Straße 5-11, Raum E 307 >>> 10115 Berlin >>> >>> Telefon: +49-30-2311-1879 >>> Fax: +49-30-2311-2209 >>> http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration >>> >>> >>> Am 28.04.2014 um 16:52 schrieb Elisa Carrus: >>> >>>> Hi FT users, >>>> >>>> I am having some problems with resampling (downsampling) the data. >>>> >>>> Here is what I'm doing: >>>> >>>> I preprocess the continuous data to obtain band-pass filtered >>>> signal in several frequencies (4-8,8-12,12-30, etc), also taking >>>> the abs value of the Hilbert transform. The absolute value of the >>>> Hilbert is ultimately what I need. >>>> >>>> I have used the following code: >>>> / >>>> //cfg = [];// >>>> //cfg.channel = 'MEG';// >>>> //cfg.demean = 'yes';// >>>> //cfg.detrend = 'yes';// >>>> //cfg.lpfilter = 'yes';// >>>> //cfg.hilbert = 'abs';// >>>> //cfg.hpfilter = 'yes';// >>>> //cfg.hilbert = 'abs';// >>>> //cfg.lpfreq = 30;// >>>> //cfg.hpfreq = 12;// >>>> //cfg.dataset = '0061_syntask_02_raw_ssst_td.fif';// >>>> //cfg.continuous = 'yes';// >>>> //beta = ft_preprocessing(cfg);// >>>> / >>>> After this, I epoch the data as follows >>>> >>>> /cfg = [];// >>>> //cfg.trl = trl2; % this is a trial definition previously created// >>>> //beta_ep = ft_redefinetrial(cfg,beta);/ >>>> >>>> and then I downsample as follows: >>>> >>>> /cfg = [];// >>>> //cfg.resamplefs = 500;// >>>> //beta_epdw = ft_resampledata(cfg, beta_ep)/ >>>> >>>> I don't encounter any errors, but the strange thing is that the >>>> data looks fine up to before I downsample (i.e.g. if I plot one >>>> trial, it's all positive values, as I would expect from the abs of >>>> the Hilbert), but if I plot the downsampled data, the signal has >>>> both negative and positive values. >>>> >>>> Is there something I'm missing? >>>> >>>> Thanks a lot if you can help, >>>> >>>> Elisa >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > From spa268 at nyu.edu Wed Apr 30 13:33:30 2014 From: spa268 at nyu.edu (Stephen Politzer-Ahles) Date: Wed, 30 Apr 2014 15:33:30 +0400 Subject: [FieldTrip] txt file Message-ID: Hello Pierpaolo, Have you tried this? http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat Best, Steve Stephen Politzer-Ahles New York University, Abu Dhabi Neuroscience of Language Lab http://www.nyu.edu/projects/politzer-ahles/ Message: 5 Date: Wed, 30 Apr 2014 10:18:51 +0200 From: Pierpaolo Croce To: fieldtrip at science.ru.nl Subject: [FieldTrip] txt file Message-ID: Content-Type: text/plain; charset="utf-8" Dear Experts, i m a new ft user, i m writing to ask how open simple txt files with ft. this file is without any header. best -- PC -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Tue Apr 1 01:58:45 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 31 Mar 2014 23:58:45 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <533985D8.4080504@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>,<533985D8.4080504@donders.ru.nl> Message-ID: <2573399203ce4b8481d629d08994337a@SIXPR03MB368.apcprd03.prod.outlook.com> Hey Jorn, I am still getting an error when running ft_sourceanalysis. Ill try and give you the full picture of what I am doing. 1. coming from eeglab to fieldtrip: % convert to fieldtrip process = 'componentanalysis'; data = eeglab2fieldtrip( EEG, process, 'none'); data = label: {1x121 cell} fsample: 500 elec: [1x1 struct] trial: {[121x19767 single]} time: {[1x19767 double]} topolabel: {1x121 cell} topo: [121x121 double] cfg: [1x1 struct] 2. Calculate timelock analysis % calculating the timelock analysis cfg = []; % cfg.channel = 'EEG'; % for some reason it crashes the % beamformer cfg.vartrllength = 2; % accept variable length trials cfg.covariance = 'yes'; cfg.covariancewindow = 'all'; % cfg.channel = data.label; timelock = ft_timelockanalysis(cfg, data); timelock = avg: [121x19767 double] var: [121x19767 double] time: [1x19767 double] dof: [121x19767 double] label: {1x121 cell} dimord: 'chan_time' cov: [121x121 double] elec: [1x1 struct] cfg: [1x1 struct] 3. Calculate head model % the forward model and lead field matrix mri = ft_read_mri( 'Subject01.mri'); cfg = []; cfg.write = 'no'; cfg.coordsys = 'ctf'; segmentedmri = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'concentricspheres'; vol = ft_prepare_headmodel(cfg, segmentedmri); vol = unit: 'mm' r: 69.8077 o: [19.2853 1.2231 54.6031] cond: 1 type: 'concentricspheres' cfg: [1x1 struct] 4. Compute lead field % compute lead field ( apparently source analysis computes % lead field anyway cfg = []; cfg.elec = timelock.elec; cfg.vol = vol; cfg.reducerank = 3; cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution cfg.grid.unit = 'cm'; cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window grid = ft_prepare_leadfield( cfg); grid = xgrid: [-5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8] ygrid: [-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7] zgrid: [-1 0 1 2 3 4 5 6 7 8 9 10 11 12] dim: [14 14 14] pos: [2744x3 double] unit: 'cm' inside: [1x1430 double] outside: [1x1314 double] cfg: [1x1 struct] leadfield: {1x2744 cell} 5. Compute ft_source analysis % Source Analysis: without contrasting condition cfg = []; cfg.method = 'lcmv'; cfg.grid = grid; cfg.vol = vol; % cfg.grid.pos = 'maxpos'; cfg.keepfilter = 'yes'; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = 0; source = ft_sourceanalysis( cfg, timelock); It crashes with the following error: Error using * Inner matrix dimensions must agree. Error in beamformer_lcmv (line 268) filt = pinv(lf' * invCy * lf) * lf' * invCy; % van Veen eqn. 23, use PINV/SVD to cover rank deficient leadfield Error in ft_sourceanalysis (line 794) dip(i) = beamformer_lcmv(grid, sens, vol, squeeze_avg, squeeze(Cy(i,:,:)), optarg{:}); Please note that fieldtrip is up to date. Can you see an error? I will trying looking in the tutorials again. Also, did you want a segment of my data to see if you can get it working? ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" Sent: Tuesday, 1 April 2014 1:42 AM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot just to clarify and be precise > The pos-matrix has to be a regular 3D grid, i.e. be representable as a > 3x3x3 matrix. it actually does not have to be as you can also beam individual grid points, but if you have a .dim field, then is has to be like above. But that does not affect the rest of the mail I wrote ;) > I am not quite sure how the sourceinterpolate function is handeling > the fact that you do not have that .dim field. Apparently, it is also > confused ;) > > Do you want to reconstruct only some voxels? From your code it seems > that you want to cover the whole brain with a 1cm resolution. If the > latter is the case, maybe restart with creating your forward model by > following the tutorial that I posted in my previous mail. There are > some sanity checks that can help you figuring out if you are doing the > correct thing. If the former one is the case, please explain again > what exactly you want to achieve and how you are building your forward > model. > > Best, > Jörn > > btw, there's nothing wrong with being a PhD student, it's just a > matter of experience in practice and theory as in all domains in life ;) > > > On 3/31/2014 3:15 PM, Tyler Grummett wrote: >> Hey Jorn, >> >> Yes I am definitely confused haha, this stuff is way out of my league >> as a PhD student. >> Anyway, I feel we are getting somewhere. >> >> timelock = >> >> avg: [121x19767 double] >> var: [121x19767 double] >> time: [1x19767 double] >> dof: [121x19767 double] >> label: {1x121 cell} >> dimord: 'chan_time' >> cov: [121x121 double] >> elec: [1x1 struct] >> cfg: [1x1 struct] >> >> source = >> >> time: [1x19767 double] >> pos: [642x3 double] >> inside: [642x1 double] >> outside: [] >> method: 'average' >> avg: [1x1 struct] >> cfg: [1x1 struct] >> >> sourceInt = >> >> time: [1x19767 double] >> avg: [1x1 struct] >> pos: [16777216x3 double] >> dim: [256 256 256] >> inside: [1x16777216 double] >> outside: [1x0 double] >> coordsys: 'ctf' >> unit: 'mm' >> cfg: [1x1 struct] >> >> Given what I said last time, I might not comment on the differences. >> I hope you can see something wrong. >> >> One thing I should mention is that the data is continuous, around 30 >> seconds. Therefore there is only one trial, >> is that an issue? >> >> Tyler >> >> ************************* >> >> Tyler Grummett ( BBSc, BSc(Hons I)) >> PhD Candidate >> Brain Signals Laboratory >> Flinders University >> Rm 5A301 >> Ext 66124 >> >> ________________________________________ >> From: fieldtrip-bounces at science.ru.nl >> on behalf of "Jörn M. Horschig" >> >> Sent: Monday, 31 March 2014 10:24 PM >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] plotting interpolated sources with >> ft_sourceplot >> >> Hi Tyler, >> >> there is not much inherently different between time- and >> freuqency-domain beamformer, at least in terms of computing the forward >> and the inverse solution. But I see that you are obviously confused, so >> let me try to help you out and shed some light on what you are actually >> doing ;) >> >> >>> I had a look at my variables. >>> >>> source.avg = >>> >>> pow: [642x1 double] >>> filter: {642x1 cell} >>> >>> sourceInt.avg = >>> >>> pow: [16777216x1 double] >>> >>> So clearly, as both variables are completely different. Something >>> has gone wrong. >> No, that is actually how it should be. From below you can see that your >> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >> 16777216 elements. In line with source.avg.pow, you should see that your >> 'grid' consists of 642 elements, so you were computing your source >> activity on a grid of in total 642 elements. Then you used the original >> MRI to interpolate from 642 to these 16 million grid points. Actually, >> since you specific cfg.downsample = 2, it should have been only 8 >> million points, so that's where things already get a bit weird. >> >> So let's go into some sanity checks: >> 1. are you using the latest version (or a recent, i.e. from this year) >> of FielTrip? >> 2. sourceInt should look something like this, does it? >> >> source_diff_int = >> inside: [46x55x46 logical] >> avg: [1x1 struct] >> dim: [46 55 46] >> transform: [4x4 double] >> anatomy: [46x55x46 double] >> unit: 'mm' >> cfg: [1x1 struct] >> >> >> >> 3. source should look something like this: >> >> source = >> dim: [20 25 22] >> freq: 54.8287 >> cumtapcnt: [338x1 double] >> pos: [11000x3 double] >> inside: [1x5798 double] >> outside: [1x5202 double] >> method: 'average' >> avg: [1x1 struct] >> trialinfo: [338x1 double] >> cfg: [1x1 struct] >> >> 4. also check your grid, should be something like this: >> >> sourcemodel = >> >> pos: [11000x3 double] >> dim: [20 25 22] >> unit: 'cm' >> inside: [1x5798 double] >> outside: [1x5202 double] >> params: [1x1 struct] >> initial: [4x4 double] >> cfg: [1x1 struct] >> >> >> Of course, it should all look a bit different, because you are using >> LCMV, but essentially it should be the same. Lastly, you can check other >> source plotting methods, like 'ortho' or try to plot the source >> structure rather than the sourceInt structure. In the end, the error >> must be somewhere in your grid, be it in .pos or .inside, because >> FieldTrip thinks that there is only one voxel to be plotted. There are >> other things that may be the issue, but I am not sure about these. So, I >> would suggest that you play a bit around and see where the error might >> come from (e.g. follow this tutorial: >> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >> steps that you need for LCMV, maybe also check out: >> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >> >> there, LCMV is used, but on one voxel only) >> >> Best, >> Jörn >> >>> The next part of my code is the following: >>> >>> % interpolate sources >>> mri = ft_read_mri('Subject01.mri'); >>> mri = ft_volumereslice([], mri); >>> >>> cfg = []; >>> cfg.downsample = 2; >>> cfg.parameter = 'avg.pow'; >>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>> parameter >>> % does not vary over time, therefore the time >>> dimension is not needed. >>> >>> mri = >>> >>> anatomy: [256x256x256 double] >>> dim: [256 256 256] >>> transform: [4x4 double] >>> coordsys: 'ctf' >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> I cant really see if the data works in the tutorial because it >>> doesnt appear as though fieldtrip has a tutorial on lcmv >>> beamformers, they seem to stick to frequency domain beamformers. >>> >>> Ive been wrong before though, >>> >>> thanks for your help. >>> >>> Tyler >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl >>> on behalf of "Jörn M. Horschig" >>> >>> Sent: Monday, 31 March 2014 7:13 PM >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting interpolated sources with >>> ft_sourceplot >>> >>> Hi Tyler, >>> >>> hm, okay, it could be that the issue with the leadfield and with the >>> plot are related, but it could also be that they are separate issues. I >>> just saw that you posted the same 'problem' on bugzilla and included a >>> picture. Maybe for next time, include a picture on the mailinglist and >>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>> and not if you are not sure. That saves us a lot of time in separating >>> code issues from user problems ;) >>> >>> So, back to you problem. It seems that your reconstruction results in >>> one voxel only. Are you sure that your grid consistents of more than >>> just one position? So, for example check the size of the matrices in >>> source.avg, source- and headmodel, etc. >>> >>> Also, you can check in Matlab the respective fields of source and >>> sourceInt and see whether that makes sense. >>> >>> Lastly, a neat way to check is always to use your code on data from the >>> tutorial, and vice versa, use code from the tutorial on your data and >>> see whether that works. Both should give sensible results, and if one >>> does not, you know where to start looking for a solution ;) >>> >>> Best, >>> Jörn >>> >>> >>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>> Hey Jorn, >>>> >>>> Previously I have let ft_sourceanalysis do a lead field because if >>>> I use the following code: >>>> >>>> % compute lead field ( apparently source analysis computes >>>> % lead field anyway >>>> cfg = []; >>>> cfg.elec = timelock.elec; >>>> cfg.vol = vol; >>>> cfg.reducerank = 3; >>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>> cm resolution >>>> cfg.grid.unit = 'cm'; >>>> cfg.normalize = 'yes'; % if you are not >>>> contrasting the activity of interest again another condition or >>>> baseline time-window >>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>> I AM UP TO >>>> >>>> and then calculate the source analysis: >>>> >>>> % Source Analysis: without contrasting condition >>>> cfg = []; >>>> cfg.method = 'lcmv'; >>>> cfg.grid = grid; >>>> cfg.vol = vol; >>>> % cfg.grid.pos = maxpos; >>>> cfg.keepfilter = 'yes'; >>>> cfg.dics.projectnoise = 'yes'; >>>> % cfg.dics.lambda = 0; >>>> source = ft_sourceanalysis( cfg, timelock); >>>> >>>> then I get an error than says: >>>> >>>> Error using * >>>> Inner matrix dimensions must agree. >>>> >>>> Error in beamformer_lcmv (line 268) >>>> filt = pinv(lf' * invCy * lf) * lf' * >>>> invCy; % van Veen eqn. 23, use >>>> PINV/SVD to cover rank deficient leadfield >>>> >>>> Error in ft_sourceanalysis (line 794) >>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>> optarg{:}); >>>> >>>> I just removed the leadfield code and it successfully ran. I could >>>> also interpolate it later. >>>> Is this the correct approach. >>>> >>>> Thankyou in advance! >>>> >>>> Tyler >>>> >>>> ************************* >>>> >>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>> PhD Candidate >>>> Brain Signals Laboratory >>>> Flinders University >>>> Rm 5A301 >>>> Ext 66124 >>>> >>>> ________________________________________ >>>> From: fieldtrip-bounces at science.ru.nl >>>> on behalf of "Jörn M. Horschig" >>>> >>>> Sent: Monday, 31 March 2014 5:30 PM >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>> ft_sourceplot >>>> >>>> Hi Tyler, >>>> >>>> what you are describing sounds to me like the center bias of the >>>> beamformer. Did you contrast the activity with anything, or did you >>>> normalize your leadfield? >>>> Check this out: >>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>> >>>> >>>> Best, >>>> Jörn >>>> >>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>> I have been trying to plot my interpolated source data using the >>>>> code: >>>>> >>>>> % interpolate sources >>>>> mri = ft_read_mri('Subject01.mri'); >>>>> mri = ft_volumereslice([], mri); >>>>> cfg = []; >>>>> cfg.downsample = 2; >>>>> cfg.parameter = 'avg.pow'; >>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>> parameter >>>>> % does not vary over time, therefore the time >>>>> dimension >>>>> is not needed. >>>>> >>>>> % Plot interpolated data >>>>> cfg = []; %#ok >>>>> cfg.method = 'ortho'; % spline >>>>> cfg.funparameter = 'avg.pow'; >>>>> ft_sourceplot( cfg, sourceInt); >>>>> >>>>> However the figure that comes up just had orange squares in the >>>>> subplots. >>>>> >>>>> I dont know where Ive gone wrong. >>>>> >>>>> >>>>> Tyler >>>>> >>>>> >>>>> ************************* >>>>> >>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>> /PhD Candidate/ >>>>> /Brain Signals Laboratory/ >>>>> /Flinders University/ >>>>> /Rm 5A301/ >>>>> /Ext 66124/ >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> -- >>>> Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tyler.grummett at flinders.edu.au Tue Apr 1 08:15:11 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 1 Apr 2014 06:15:11 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <533985D8.4080504@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>,<533985D8.4080504@donders.ru.nl> Message-ID: Hey Jorn, In addition to my previous emails, Ive been trying to debug the functions. In ft_sourceanalysis, line 661 to 677: % HACK: use the default code % select the channels of interest [dum, datchanindx] = match_str(cfg.channel, data.label); if strcmp(data.dimord, 'chan_time') % It is in principle possible to have timelockanalysis with % keeptrial=yes and only a single trial in the raw data. % In that case the covariance should be represented as Nchan*Nchan data.avg = data.avg(datchanindx,:); %data.cov = reshape(data.cov, length(datchanindx), length(datchanindx)); data.cov = data.cov(datchanindx,datchanindx); else data.avg = data.avg(datchanindx,:); data.cov = data.cov(:,datchanindx,datchanindx); data.trial = data.trial(:,datchanindx,:); end data.label = data.label(datchanindx); Nchans = length(data.label); I found that my cfg.channel is []; and the data.label is all my ICA components labelled ica_001 etc. So it is returned as a []; which means data.cov = []; I think then it will crash later parts of the code. Does this function work on ICA components? I ran the ICA in eeglab. Tyler. ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" Sent: Tuesday, 1 April 2014 1:42 AM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot just to clarify and be precise > The pos-matrix has to be a regular 3D grid, i.e. be representable as a > 3x3x3 matrix. it actually does not have to be as you can also beam individual grid points, but if you have a .dim field, then is has to be like above. But that does not affect the rest of the mail I wrote ;) > I am not quite sure how the sourceinterpolate function is handeling > the fact that you do not have that .dim field. Apparently, it is also > confused ;) > > Do you want to reconstruct only some voxels? From your code it seems > that you want to cover the whole brain with a 1cm resolution. If the > latter is the case, maybe restart with creating your forward model by > following the tutorial that I posted in my previous mail. There are > some sanity checks that can help you figuring out if you are doing the > correct thing. If the former one is the case, please explain again > what exactly you want to achieve and how you are building your forward > model. > > Best, > Jörn > > btw, there's nothing wrong with being a PhD student, it's just a > matter of experience in practice and theory as in all domains in life ;) > > > On 3/31/2014 3:15 PM, Tyler Grummett wrote: >> Hey Jorn, >> >> Yes I am definitely confused haha, this stuff is way out of my league >> as a PhD student. >> Anyway, I feel we are getting somewhere. >> >> timelock = >> >> avg: [121x19767 double] >> var: [121x19767 double] >> time: [1x19767 double] >> dof: [121x19767 double] >> label: {1x121 cell} >> dimord: 'chan_time' >> cov: [121x121 double] >> elec: [1x1 struct] >> cfg: [1x1 struct] >> >> source = >> >> time: [1x19767 double] >> pos: [642x3 double] >> inside: [642x1 double] >> outside: [] >> method: 'average' >> avg: [1x1 struct] >> cfg: [1x1 struct] >> >> sourceInt = >> >> time: [1x19767 double] >> avg: [1x1 struct] >> pos: [16777216x3 double] >> dim: [256 256 256] >> inside: [1x16777216 double] >> outside: [1x0 double] >> coordsys: 'ctf' >> unit: 'mm' >> cfg: [1x1 struct] >> >> Given what I said last time, I might not comment on the differences. >> I hope you can see something wrong. >> >> One thing I should mention is that the data is continuous, around 30 >> seconds. Therefore there is only one trial, >> is that an issue? >> >> Tyler >> >> ************************* >> >> Tyler Grummett ( BBSc, BSc(Hons I)) >> PhD Candidate >> Brain Signals Laboratory >> Flinders University >> Rm 5A301 >> Ext 66124 >> >> ________________________________________ >> From: fieldtrip-bounces at science.ru.nl >> on behalf of "Jörn M. Horschig" >> >> Sent: Monday, 31 March 2014 10:24 PM >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] plotting interpolated sources with >> ft_sourceplot >> >> Hi Tyler, >> >> there is not much inherently different between time- and >> freuqency-domain beamformer, at least in terms of computing the forward >> and the inverse solution. But I see that you are obviously confused, so >> let me try to help you out and shed some light on what you are actually >> doing ;) >> >> >>> I had a look at my variables. >>> >>> source.avg = >>> >>> pow: [642x1 double] >>> filter: {642x1 cell} >>> >>> sourceInt.avg = >>> >>> pow: [16777216x1 double] >>> >>> So clearly, as both variables are completely different. Something >>> has gone wrong. >> No, that is actually how it should be. From below you can see that your >> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >> 16777216 elements. In line with source.avg.pow, you should see that your >> 'grid' consists of 642 elements, so you were computing your source >> activity on a grid of in total 642 elements. Then you used the original >> MRI to interpolate from 642 to these 16 million grid points. Actually, >> since you specific cfg.downsample = 2, it should have been only 8 >> million points, so that's where things already get a bit weird. >> >> So let's go into some sanity checks: >> 1. are you using the latest version (or a recent, i.e. from this year) >> of FielTrip? >> 2. sourceInt should look something like this, does it? >> >> source_diff_int = >> inside: [46x55x46 logical] >> avg: [1x1 struct] >> dim: [46 55 46] >> transform: [4x4 double] >> anatomy: [46x55x46 double] >> unit: 'mm' >> cfg: [1x1 struct] >> >> >> >> 3. source should look something like this: >> >> source = >> dim: [20 25 22] >> freq: 54.8287 >> cumtapcnt: [338x1 double] >> pos: [11000x3 double] >> inside: [1x5798 double] >> outside: [1x5202 double] >> method: 'average' >> avg: [1x1 struct] >> trialinfo: [338x1 double] >> cfg: [1x1 struct] >> >> 4. also check your grid, should be something like this: >> >> sourcemodel = >> >> pos: [11000x3 double] >> dim: [20 25 22] >> unit: 'cm' >> inside: [1x5798 double] >> outside: [1x5202 double] >> params: [1x1 struct] >> initial: [4x4 double] >> cfg: [1x1 struct] >> >> >> Of course, it should all look a bit different, because you are using >> LCMV, but essentially it should be the same. Lastly, you can check other >> source plotting methods, like 'ortho' or try to plot the source >> structure rather than the sourceInt structure. In the end, the error >> must be somewhere in your grid, be it in .pos or .inside, because >> FieldTrip thinks that there is only one voxel to be plotted. There are >> other things that may be the issue, but I am not sure about these. So, I >> would suggest that you play a bit around and see where the error might >> come from (e.g. follow this tutorial: >> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >> steps that you need for LCMV, maybe also check out: >> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >> >> there, LCMV is used, but on one voxel only) >> >> Best, >> Jörn >> >>> The next part of my code is the following: >>> >>> % interpolate sources >>> mri = ft_read_mri('Subject01.mri'); >>> mri = ft_volumereslice([], mri); >>> >>> cfg = []; >>> cfg.downsample = 2; >>> cfg.parameter = 'avg.pow'; >>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>> parameter >>> % does not vary over time, therefore the time >>> dimension is not needed. >>> >>> mri = >>> >>> anatomy: [256x256x256 double] >>> dim: [256 256 256] >>> transform: [4x4 double] >>> coordsys: 'ctf' >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> I cant really see if the data works in the tutorial because it >>> doesnt appear as though fieldtrip has a tutorial on lcmv >>> beamformers, they seem to stick to frequency domain beamformers. >>> >>> Ive been wrong before though, >>> >>> thanks for your help. >>> >>> Tyler >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl >>> on behalf of "Jörn M. Horschig" >>> >>> Sent: Monday, 31 March 2014 7:13 PM >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting interpolated sources with >>> ft_sourceplot >>> >>> Hi Tyler, >>> >>> hm, okay, it could be that the issue with the leadfield and with the >>> plot are related, but it could also be that they are separate issues. I >>> just saw that you posted the same 'problem' on bugzilla and included a >>> picture. Maybe for next time, include a picture on the mailinglist and >>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>> and not if you are not sure. That saves us a lot of time in separating >>> code issues from user problems ;) >>> >>> So, back to you problem. It seems that your reconstruction results in >>> one voxel only. Are you sure that your grid consistents of more than >>> just one position? So, for example check the size of the matrices in >>> source.avg, source- and headmodel, etc. >>> >>> Also, you can check in Matlab the respective fields of source and >>> sourceInt and see whether that makes sense. >>> >>> Lastly, a neat way to check is always to use your code on data from the >>> tutorial, and vice versa, use code from the tutorial on your data and >>> see whether that works. Both should give sensible results, and if one >>> does not, you know where to start looking for a solution ;) >>> >>> Best, >>> Jörn >>> >>> >>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>> Hey Jorn, >>>> >>>> Previously I have let ft_sourceanalysis do a lead field because if >>>> I use the following code: >>>> >>>> % compute lead field ( apparently source analysis computes >>>> % lead field anyway >>>> cfg = []; >>>> cfg.elec = timelock.elec; >>>> cfg.vol = vol; >>>> cfg.reducerank = 3; >>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>> cm resolution >>>> cfg.grid.unit = 'cm'; >>>> cfg.normalize = 'yes'; % if you are not >>>> contrasting the activity of interest again another condition or >>>> baseline time-window >>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>> I AM UP TO >>>> >>>> and then calculate the source analysis: >>>> >>>> % Source Analysis: without contrasting condition >>>> cfg = []; >>>> cfg.method = 'lcmv'; >>>> cfg.grid = grid; >>>> cfg.vol = vol; >>>> % cfg.grid.pos = maxpos; >>>> cfg.keepfilter = 'yes'; >>>> cfg.dics.projectnoise = 'yes'; >>>> % cfg.dics.lambda = 0; >>>> source = ft_sourceanalysis( cfg, timelock); >>>> >>>> then I get an error than says: >>>> >>>> Error using * >>>> Inner matrix dimensions must agree. >>>> >>>> Error in beamformer_lcmv (line 268) >>>> filt = pinv(lf' * invCy * lf) * lf' * >>>> invCy; % van Veen eqn. 23, use >>>> PINV/SVD to cover rank deficient leadfield >>>> >>>> Error in ft_sourceanalysis (line 794) >>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>> optarg{:}); >>>> >>>> I just removed the leadfield code and it successfully ran. I could >>>> also interpolate it later. >>>> Is this the correct approach. >>>> >>>> Thankyou in advance! >>>> >>>> Tyler >>>> >>>> ************************* >>>> >>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>> PhD Candidate >>>> Brain Signals Laboratory >>>> Flinders University >>>> Rm 5A301 >>>> Ext 66124 >>>> >>>> ________________________________________ >>>> From: fieldtrip-bounces at science.ru.nl >>>> on behalf of "Jörn M. Horschig" >>>> >>>> Sent: Monday, 31 March 2014 5:30 PM >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>> ft_sourceplot >>>> >>>> Hi Tyler, >>>> >>>> what you are describing sounds to me like the center bias of the >>>> beamformer. Did you contrast the activity with anything, or did you >>>> normalize your leadfield? >>>> Check this out: >>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>> >>>> >>>> Best, >>>> Jörn >>>> >>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>> I have been trying to plot my interpolated source data using the >>>>> code: >>>>> >>>>> % interpolate sources >>>>> mri = ft_read_mri('Subject01.mri'); >>>>> mri = ft_volumereslice([], mri); >>>>> cfg = []; >>>>> cfg.downsample = 2; >>>>> cfg.parameter = 'avg.pow'; >>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>> parameter >>>>> % does not vary over time, therefore the time >>>>> dimension >>>>> is not needed. >>>>> >>>>> % Plot interpolated data >>>>> cfg = []; %#ok >>>>> cfg.method = 'ortho'; % spline >>>>> cfg.funparameter = 'avg.pow'; >>>>> ft_sourceplot( cfg, sourceInt); >>>>> >>>>> However the figure that comes up just had orange squares in the >>>>> subplots. >>>>> >>>>> I dont know where Ive gone wrong. >>>>> >>>>> >>>>> Tyler >>>>> >>>>> >>>>> ************************* >>>>> >>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>> /PhD Candidate/ >>>>> /Brain Signals Laboratory/ >>>>> /Flinders University/ >>>>> /Rm 5A301/ >>>>> /Ext 66124/ >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> -- >>>> Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jm.horschig at donders.ru.nl Tue Apr 1 08:17:56 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 01 Apr 2014 08:17:56 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <2573399203ce4b8481d629d08994337a@SIXPR03MB368.apcprd03.prod.outlook.com> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>, <533985D8.4080504@donders.ru.nl> <2573399203ce4b8481d629d08994337a@SIXPR03MB368.apcprd03.prod.outlook.com> Message-ID: <533A5A14.4060700@donders.ru.nl> Hi Tyler, the leadfield matrix contains by design no channel labels, and I think that FieldTrip assumes that the elements of the leadfield coincides with the elements of the channel. I guess you can avoid the error you get by setting cfg.channel = data.label; when computing the leadfield. You could try that, otherwise your code looks fine. Best, Jörn On 4/1/2014 1:58 AM, Tyler Grummett wrote: > Hey Jorn, > > I am still getting an error when running ft_sourceanalysis. Ill try and give you the full picture of what I am doing. > > 1. coming from eeglab to fieldtrip: > > % convert to fieldtrip > process = 'componentanalysis'; > data = eeglab2fieldtrip( EEG, process, 'none'); > > data = > > label: {1x121 cell} > fsample: 500 > elec: [1x1 struct] > trial: {[121x19767 single]} > time: {[1x19767 double]} > topolabel: {1x121 cell} > topo: [121x121 double] > cfg: [1x1 struct] > > 2. Calculate timelock analysis > > % calculating the timelock analysis > cfg = []; > % cfg.channel = 'EEG'; % for some reason it crashes the > % beamformer > cfg.vartrllength = 2; % accept variable length trials > cfg.covariance = 'yes'; > cfg.covariancewindow = 'all'; > % cfg.channel = data.label; > timelock = ft_timelockanalysis(cfg, data); > > timelock = > > avg: [121x19767 double] > var: [121x19767 double] > time: [1x19767 double] > dof: [121x19767 double] > label: {1x121 cell} > dimord: 'chan_time' > cov: [121x121 double] > elec: [1x1 struct] > cfg: [1x1 struct] > > 3. Calculate head model > > % the forward model and lead field matrix > mri = ft_read_mri( 'Subject01.mri'); > cfg = []; > cfg.write = 'no'; > cfg.coordsys = 'ctf'; > segmentedmri = ft_volumesegment(cfg, mri); > > cfg = []; > cfg.method = 'concentricspheres'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > vol = > > unit: 'mm' > r: 69.8077 > o: [19.2853 1.2231 54.6031] > cond: 1 > type: 'concentricspheres' > cfg: [1x1 struct] > > 4. Compute lead field > > % compute lead field ( apparently source analysis computes > % lead field anyway > cfg = []; > cfg.elec = timelock.elec; > cfg.vol = vol; > cfg.reducerank = 3; > cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution > cfg.grid.unit = 'cm'; > cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window > grid = ft_prepare_leadfield( cfg); > > grid = > > xgrid: [-5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8] > ygrid: [-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7] > zgrid: [-1 0 1 2 3 4 5 6 7 8 9 10 11 12] > dim: [14 14 14] > pos: [2744x3 double] > unit: 'cm' > inside: [1x1430 double] > outside: [1x1314 double] > cfg: [1x1 struct] > leadfield: {1x2744 cell} > > 5. Compute ft_source analysis > > % Source Analysis: without contrasting condition > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = grid; > cfg.vol = vol; > % cfg.grid.pos = 'maxpos'; > cfg.keepfilter = 'yes'; > cfg.dics.projectnoise = 'yes'; > cfg.dics.lambda = 0; > source = ft_sourceanalysis( cfg, timelock); > > It crashes with the following error: > > Error using * > Inner matrix dimensions must agree. > > Error in beamformer_lcmv (line 268) > filt = pinv(lf' * invCy * lf) * lf' * invCy; > % van Veen eqn. 23, use PINV/SVD to cover rank > deficient leadfield > > Error in ft_sourceanalysis (line 794) > dip(i) = beamformer_lcmv(grid, sens, vol, > squeeze_avg, squeeze(Cy(i,:,:)), optarg{:}); > > > Please note that fieldtrip is up to date. > Can you see an error? I will trying looking in the tutorials again. > Also, did you want a segment of my data to see if you can get it working? > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" > Sent: Tuesday, 1 April 2014 1:42 AM > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot > > just to clarify and be precise >> The pos-matrix has to be a regular 3D grid, i.e. be representable as a >> 3x3x3 matrix. > it actually does not have to be as you can also beam individual grid > points, but if you have a .dim field, then is has to be like above. But > that does not affect the rest of the mail I wrote ;) > > >> I am not quite sure how the sourceinterpolate function is handeling >> the fact that you do not have that .dim field. Apparently, it is also >> confused ;) >> >> Do you want to reconstruct only some voxels? From your code it seems >> that you want to cover the whole brain with a 1cm resolution. If the >> latter is the case, maybe restart with creating your forward model by >> following the tutorial that I posted in my previous mail. There are >> some sanity checks that can help you figuring out if you are doing the >> correct thing. If the former one is the case, please explain again >> what exactly you want to achieve and how you are building your forward >> model. >> >> Best, >> Jörn >> >> btw, there's nothing wrong with being a PhD student, it's just a >> matter of experience in practice and theory as in all domains in life ;) >> >> >> On 3/31/2014 3:15 PM, Tyler Grummett wrote: >>> Hey Jorn, >>> >>> Yes I am definitely confused haha, this stuff is way out of my league >>> as a PhD student. >>> Anyway, I feel we are getting somewhere. >>> >>> timelock = >>> >>> avg: [121x19767 double] >>> var: [121x19767 double] >>> time: [1x19767 double] >>> dof: [121x19767 double] >>> label: {1x121 cell} >>> dimord: 'chan_time' >>> cov: [121x121 double] >>> elec: [1x1 struct] >>> cfg: [1x1 struct] >>> >>> source = >>> >>> time: [1x19767 double] >>> pos: [642x3 double] >>> inside: [642x1 double] >>> outside: [] >>> method: 'average' >>> avg: [1x1 struct] >>> cfg: [1x1 struct] >>> >>> sourceInt = >>> >>> time: [1x19767 double] >>> avg: [1x1 struct] >>> pos: [16777216x3 double] >>> dim: [256 256 256] >>> inside: [1x16777216 double] >>> outside: [1x0 double] >>> coordsys: 'ctf' >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> Given what I said last time, I might not comment on the differences. >>> I hope you can see something wrong. >>> >>> One thing I should mention is that the data is continuous, around 30 >>> seconds. Therefore there is only one trial, >>> is that an issue? >>> >>> Tyler >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl >>> on behalf of "Jörn M. Horschig" >>> >>> Sent: Monday, 31 March 2014 10:24 PM >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting interpolated sources with >>> ft_sourceplot >>> >>> Hi Tyler, >>> >>> there is not much inherently different between time- and >>> freuqency-domain beamformer, at least in terms of computing the forward >>> and the inverse solution. But I see that you are obviously confused, so >>> let me try to help you out and shed some light on what you are actually >>> doing ;) >>> >>> >>>> I had a look at my variables. >>>> >>>> source.avg = >>>> >>>> pow: [642x1 double] >>>> filter: {642x1 cell} >>>> >>>> sourceInt.avg = >>>> >>>> pow: [16777216x1 double] >>>> >>>> So clearly, as both variables are completely different. Something >>>> has gone wrong. >>> No, that is actually how it should be. From below you can see that your >>> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >>> 16777216 elements. In line with source.avg.pow, you should see that your >>> 'grid' consists of 642 elements, so you were computing your source >>> activity on a grid of in total 642 elements. Then you used the original >>> MRI to interpolate from 642 to these 16 million grid points. Actually, >>> since you specific cfg.downsample = 2, it should have been only 8 >>> million points, so that's where things already get a bit weird. >>> >>> So let's go into some sanity checks: >>> 1. are you using the latest version (or a recent, i.e. from this year) >>> of FielTrip? >>> 2. sourceInt should look something like this, does it? >>> >>> source_diff_int = >>> inside: [46x55x46 logical] >>> avg: [1x1 struct] >>> dim: [46 55 46] >>> transform: [4x4 double] >>> anatomy: [46x55x46 double] >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> >>> >>> 3. source should look something like this: >>> >>> source = >>> dim: [20 25 22] >>> freq: 54.8287 >>> cumtapcnt: [338x1 double] >>> pos: [11000x3 double] >>> inside: [1x5798 double] >>> outside: [1x5202 double] >>> method: 'average' >>> avg: [1x1 struct] >>> trialinfo: [338x1 double] >>> cfg: [1x1 struct] >>> >>> 4. also check your grid, should be something like this: >>> >>> sourcemodel = >>> >>> pos: [11000x3 double] >>> dim: [20 25 22] >>> unit: 'cm' >>> inside: [1x5798 double] >>> outside: [1x5202 double] >>> params: [1x1 struct] >>> initial: [4x4 double] >>> cfg: [1x1 struct] >>> >>> >>> Of course, it should all look a bit different, because you are using >>> LCMV, but essentially it should be the same. Lastly, you can check other >>> source plotting methods, like 'ortho' or try to plot the source >>> structure rather than the sourceInt structure. In the end, the error >>> must be somewhere in your grid, be it in .pos or .inside, because >>> FieldTrip thinks that there is only one voxel to be plotted. There are >>> other things that may be the issue, but I am not sure about these. So, I >>> would suggest that you play a bit around and see where the error might >>> come from (e.g. follow this tutorial: >>> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >>> steps that you need for LCMV, maybe also check out: >>> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >>> >>> there, LCMV is used, but on one voxel only) >>> >>> Best, >>> Jörn >>> >>>> The next part of my code is the following: >>>> >>>> % interpolate sources >>>> mri = ft_read_mri('Subject01.mri'); >>>> mri = ft_volumereslice([], mri); >>>> >>>> cfg = []; >>>> cfg.downsample = 2; >>>> cfg.parameter = 'avg.pow'; >>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>> parameter >>>> % does not vary over time, therefore the time >>>> dimension is not needed. >>>> >>>> mri = >>>> >>>> anatomy: [256x256x256 double] >>>> dim: [256 256 256] >>>> transform: [4x4 double] >>>> coordsys: 'ctf' >>>> unit: 'mm' >>>> cfg: [1x1 struct] >>>> >>>> I cant really see if the data works in the tutorial because it >>>> doesnt appear as though fieldtrip has a tutorial on lcmv >>>> beamformers, they seem to stick to frequency domain beamformers. >>>> >>>> Ive been wrong before though, >>>> >>>> thanks for your help. >>>> >>>> Tyler >>>> >>>> ************************* >>>> >>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>> PhD Candidate >>>> Brain Signals Laboratory >>>> Flinders University >>>> Rm 5A301 >>>> Ext 66124 >>>> >>>> ________________________________________ >>>> From: fieldtrip-bounces at science.ru.nl >>>> on behalf of "Jörn M. Horschig" >>>> >>>> Sent: Monday, 31 March 2014 7:13 PM >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>> ft_sourceplot >>>> >>>> Hi Tyler, >>>> >>>> hm, okay, it could be that the issue with the leadfield and with the >>>> plot are related, but it could also be that they are separate issues. I >>>> just saw that you posted the same 'problem' on bugzilla and included a >>>> picture. Maybe for next time, include a picture on the mailinglist and >>>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>>> and not if you are not sure. That saves us a lot of time in separating >>>> code issues from user problems ;) >>>> >>>> So, back to you problem. It seems that your reconstruction results in >>>> one voxel only. Are you sure that your grid consistents of more than >>>> just one position? So, for example check the size of the matrices in >>>> source.avg, source- and headmodel, etc. >>>> >>>> Also, you can check in Matlab the respective fields of source and >>>> sourceInt and see whether that makes sense. >>>> >>>> Lastly, a neat way to check is always to use your code on data from the >>>> tutorial, and vice versa, use code from the tutorial on your data and >>>> see whether that works. Both should give sensible results, and if one >>>> does not, you know where to start looking for a solution ;) >>>> >>>> Best, >>>> Jörn >>>> >>>> >>>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>>> Hey Jorn, >>>>> >>>>> Previously I have let ft_sourceanalysis do a lead field because if >>>>> I use the following code: >>>>> >>>>> % compute lead field ( apparently source analysis computes >>>>> % lead field anyway >>>>> cfg = []; >>>>> cfg.elec = timelock.elec; >>>>> cfg.vol = vol; >>>>> cfg.reducerank = 3; >>>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>>> cm resolution >>>>> cfg.grid.unit = 'cm'; >>>>> cfg.normalize = 'yes'; % if you are not >>>>> contrasting the activity of interest again another condition or >>>>> baseline time-window >>>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>>> I AM UP TO >>>>> >>>>> and then calculate the source analysis: >>>>> >>>>> % Source Analysis: without contrasting condition >>>>> cfg = []; >>>>> cfg.method = 'lcmv'; >>>>> cfg.grid = grid; >>>>> cfg.vol = vol; >>>>> % cfg.grid.pos = maxpos; >>>>> cfg.keepfilter = 'yes'; >>>>> cfg.dics.projectnoise = 'yes'; >>>>> % cfg.dics.lambda = 0; >>>>> source = ft_sourceanalysis( cfg, timelock); >>>>> >>>>> then I get an error than says: >>>>> >>>>> Error using * >>>>> Inner matrix dimensions must agree. >>>>> >>>>> Error in beamformer_lcmv (line 268) >>>>> filt = pinv(lf' * invCy * lf) * lf' * >>>>> invCy; % van Veen eqn. 23, use >>>>> PINV/SVD to cover rank deficient leadfield >>>>> >>>>> Error in ft_sourceanalysis (line 794) >>>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>>> optarg{:}); >>>>> >>>>> I just removed the leadfield code and it successfully ran. I could >>>>> also interpolate it later. >>>>> Is this the correct approach. >>>>> >>>>> Thankyou in advance! >>>>> >>>>> Tyler >>>>> >>>>> ************************* >>>>> >>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>> PhD Candidate >>>>> Brain Signals Laboratory >>>>> Flinders University >>>>> Rm 5A301 >>>>> Ext 66124 >>>>> >>>>> ________________________________________ >>>>> From: fieldtrip-bounces at science.ru.nl >>>>> on behalf of "Jörn M. Horschig" >>>>> >>>>> Sent: Monday, 31 March 2014 5:30 PM >>>>> To: FieldTrip discussion list >>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>> ft_sourceplot >>>>> >>>>> Hi Tyler, >>>>> >>>>> what you are describing sounds to me like the center bias of the >>>>> beamformer. Did you contrast the activity with anything, or did you >>>>> normalize your leadfield? >>>>> Check this out: >>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>>> >>>>> >>>>> Best, >>>>> Jörn >>>>> >>>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>>> I have been trying to plot my interpolated source data using the >>>>>> code: >>>>>> >>>>>> % interpolate sources >>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>> mri = ft_volumereslice([], mri); >>>>>> cfg = []; >>>>>> cfg.downsample = 2; >>>>>> cfg.parameter = 'avg.pow'; >>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>> parameter >>>>>> % does not vary over time, therefore the time >>>>>> dimension >>>>>> is not needed. >>>>>> >>>>>> % Plot interpolated data >>>>>> cfg = []; %#ok >>>>>> cfg.method = 'ortho'; % spline >>>>>> cfg.funparameter = 'avg.pow'; >>>>>> ft_sourceplot( cfg, sourceInt); >>>>>> >>>>>> However the figure that comes up just had orange squares in the >>>>>> subplots. >>>>>> >>>>>> I dont know where Ive gone wrong. >>>>>> >>>>>> >>>>>> Tyler >>>>>> >>>>>> >>>>>> ************************* >>>>>> >>>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>>> /PhD Candidate/ >>>>>> /Brain Signals Laboratory/ >>>>>> /Flinders University/ >>>>>> /Rm 5A301/ >>>>>> /Ext 66124/ >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> -- >>>>> Jörn M. Horschig >>>>> PhD Student >>>>> Donders Institute for Brain, Cognition and Behaviour >>>>> Centre for Cognitive Neuroimaging >>>>> Radboud University Nijmegen >>>>> Neuronal Oscillations Group >>>>> FieldTrip Development Team >>>>> >>>>> P.O. Box 9101 >>>>> NL-6500 HB Nijmegen >>>>> The Netherlands >>>>> >>>>> Contact: >>>>> E-Mail: jm.horschig at donders.ru.nl >>>>> Tel: +31-(0)24-36-68493 >>>>> Web: http://www.ru.nl/donders >>>>> >>>>> Visiting address: >>>>> Trigon, room 2.30 >>>>> Kapittelweg 29 >>>>> NL-6525 EN Nijmegen >>>>> The Netherlands >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> -- >>>> Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Tue Apr 1 08:24:11 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 01 Apr 2014 08:24:11 +0200 Subject: [FieldTrip] ICA: eeglab and fieldtrip In-Reply-To: References: Message-ID: <533A5B8B.5010207@donders.ru.nl> HI Aaron, in addition to what Stephen and especially Stephen said (fun quiz: who is who? ;)), pay attention that the colourscale might be different (also for different subplots) and therefore the plots from different toolboxes could suggest different activity in components, although in fact they are similar. Best, Jörn On 3/31/2014 10:10 PM, Stephen Whitmarsh wrote: > Hi Aaron (i see Stephen just wrote a similar response) > > Those component topoplots look pretty good to me. In the FT one, I > would say the first and third have a good change of being related to > eyeblinks, and the fifth and twenty-fifth to eye-movements. > However, you should really look at the timecourses to identify them as > related to saccades and blinks, and by comparing them with your EOG > recording. > > Although each ICA will *always* give you different results (if you > don't specifiy the random seed), to make them more comparable you > could add the EOG channel to the layout. > > Cheer, > Stephen > > > On 31 March 2014 22:08, Stephen Politzer-Ahles > wrote: > > Hello Aaron, > > This doesn't, answer the rest of your questions, but... In your > attached Fieldtrip image, component 1 does look like a likely > blink component to me? > > > > Stephen Politzer-Ahles > New York University, Abu Dhabi > Neuroscience of Language Lab > http://www.nyu.edu/projects/politzer-ahles/ > > > On Mon, Mar 31, 2014 at 11:52 PM, > wrote: > > > Message: 2 > Date: Mon, 31 Mar 2014 14:51:51 -0500 > From: Aaron Hanford > > To: "fieldtrip at science.ru.nl " > > > Subject: [FieldTrip] ICA: eeglab and fieldtrip > Message-ID: > Content-Type: text/plain; charset="iso-8859-1" > > Hi,I'm resending this with the figures turned into jpgs so > it's not oversize...anyway, so I'm somewhat new to both > fieldtrip and eeglab (although much more so to fieldtrip). > I'm trying to figure out the following: > > On the exact same dataset, I did the following two things: > 1) in eeglab, I just chose Tools -> Run ICA with default settings. > Then, starting over with the original raw data: > 2) In fieldtrip I ran the following: data = > eeglab2fieldtrip(EEG,'preprocessing','none');cfg = > [];cfg.method = > 'runica';[comp]=ft_componentanalysis(cfg,data);layout = > 'C:\Users\aharown\Desktop\fieldtrip-20140126\template\layout\easycapM17.mat';cfg.component > = [1:31];cfg.layout = layout;ft_topoplotIC(cfg,comp); > In both cases I then plotted the 2-D component maps, attached. > So my question is, why are these results so completely > different? The fieldtrip results don't look right at all, in > that for instance they don't obviously identify a blink > component (note that in this dataset, there is only one > electrode placed near the right eye, not the left). I did > this a handful of times and got the same sort of big > differences. Am I doing something wrong or what? > > I actually think the cap file seems incorrect, but I've been > assured by my PI that it's correct, so .... is there another > likely answer? > Thanks, > Aaron > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: fieldtrip.JPG > Type: image/jpeg > Size: 110477 bytes > Desc: not available > URL: > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: eeglab.JPG > Type: image/jpeg > Size: 99185 bytes > Desc: not available > URL: > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 40, Issue 48 > ***************************************** > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From tyler.grummett at flinders.edu.au Tue Apr 1 08:45:50 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 1 Apr 2014 06:45:50 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <533A5A14.4060700@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>, <533985D8.4080504@donders.ru.nl> <2573399203ce4b8481d629d08994337a@SIXPR03MB368.apcprd03.prod.outlook.com>, <533A5A14.4060700@donders.ru.nl> Message-ID: Hey Jorn, It looks like the function prepare_headmodel is altering cfg.channel at line 54: sens = ft_fetch_sens(cfg, data); line 94: [vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, 'order', cfg.order); and line 97: cfg.channel = sens.label; sens = elecpos: [0x3 double] label: {1x0 cell} type: 'eeg1005' unit: 'cm' chanpos: [0x3 double] this function is called in ft_sourceanalysis. After that I dont have the labels anymore. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" Sent: Tuesday, 1 April 2014 4:47 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot Hi Tyler, the leadfield matrix contains by design no channel labels, and I think that FieldTrip assumes that the elements of the leadfield coincides with the elements of the channel. I guess you can avoid the error you get by setting cfg.channel = data.label; when computing the leadfield. You could try that, otherwise your code looks fine. Best, Jörn On 4/1/2014 1:58 AM, Tyler Grummett wrote: > Hey Jorn, > > I am still getting an error when running ft_sourceanalysis. Ill try and give you the full picture of what I am doing. > > 1. coming from eeglab to fieldtrip: > > % convert to fieldtrip > process = 'componentanalysis'; > data = eeglab2fieldtrip( EEG, process, 'none'); > > data = > > label: {1x121 cell} > fsample: 500 > elec: [1x1 struct] > trial: {[121x19767 single]} > time: {[1x19767 double]} > topolabel: {1x121 cell} > topo: [121x121 double] > cfg: [1x1 struct] > > 2. Calculate timelock analysis > > % calculating the timelock analysis > cfg = []; > % cfg.channel = 'EEG'; % for some reason it crashes the > % beamformer > cfg.vartrllength = 2; % accept variable length trials > cfg.covariance = 'yes'; > cfg.covariancewindow = 'all'; > % cfg.channel = data.label; > timelock = ft_timelockanalysis(cfg, data); > > timelock = > > avg: [121x19767 double] > var: [121x19767 double] > time: [1x19767 double] > dof: [121x19767 double] > label: {1x121 cell} > dimord: 'chan_time' > cov: [121x121 double] > elec: [1x1 struct] > cfg: [1x1 struct] > > 3. Calculate head model > > % the forward model and lead field matrix > mri = ft_read_mri( 'Subject01.mri'); > cfg = []; > cfg.write = 'no'; > cfg.coordsys = 'ctf'; > segmentedmri = ft_volumesegment(cfg, mri); > > cfg = []; > cfg.method = 'concentricspheres'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > vol = > > unit: 'mm' > r: 69.8077 > o: [19.2853 1.2231 54.6031] > cond: 1 > type: 'concentricspheres' > cfg: [1x1 struct] > > 4. Compute lead field > > % compute lead field ( apparently source analysis computes > % lead field anyway > cfg = []; > cfg.elec = timelock.elec; > cfg.vol = vol; > cfg.reducerank = 3; > cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution > cfg.grid.unit = 'cm'; > cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window > grid = ft_prepare_leadfield( cfg); > > grid = > > xgrid: [-5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8] > ygrid: [-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7] > zgrid: [-1 0 1 2 3 4 5 6 7 8 9 10 11 12] > dim: [14 14 14] > pos: [2744x3 double] > unit: 'cm' > inside: [1x1430 double] > outside: [1x1314 double] > cfg: [1x1 struct] > leadfield: {1x2744 cell} > > 5. Compute ft_source analysis > > % Source Analysis: without contrasting condition > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = grid; > cfg.vol = vol; > % cfg.grid.pos = 'maxpos'; > cfg.keepfilter = 'yes'; > cfg.dics.projectnoise = 'yes'; > cfg.dics.lambda = 0; > source = ft_sourceanalysis( cfg, timelock); > > It crashes with the following error: > > Error using * > Inner matrix dimensions must agree. > > Error in beamformer_lcmv (line 268) > filt = pinv(lf' * invCy * lf) * lf' * invCy; > % van Veen eqn. 23, use PINV/SVD to cover rank > deficient leadfield > > Error in ft_sourceanalysis (line 794) > dip(i) = beamformer_lcmv(grid, sens, vol, > squeeze_avg, squeeze(Cy(i,:,:)), optarg{:}); > > > Please note that fieldtrip is up to date. > Can you see an error? I will trying looking in the tutorials again. > Also, did you want a segment of my data to see if you can get it working? > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" > Sent: Tuesday, 1 April 2014 1:42 AM > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot > > just to clarify and be precise >> The pos-matrix has to be a regular 3D grid, i.e. be representable as a >> 3x3x3 matrix. > it actually does not have to be as you can also beam individual grid > points, but if you have a .dim field, then is has to be like above. But > that does not affect the rest of the mail I wrote ;) > > >> I am not quite sure how the sourceinterpolate function is handeling >> the fact that you do not have that .dim field. Apparently, it is also >> confused ;) >> >> Do you want to reconstruct only some voxels? From your code it seems >> that you want to cover the whole brain with a 1cm resolution. If the >> latter is the case, maybe restart with creating your forward model by >> following the tutorial that I posted in my previous mail. There are >> some sanity checks that can help you figuring out if you are doing the >> correct thing. If the former one is the case, please explain again >> what exactly you want to achieve and how you are building your forward >> model. >> >> Best, >> Jörn >> >> btw, there's nothing wrong with being a PhD student, it's just a >> matter of experience in practice and theory as in all domains in life ;) >> >> >> On 3/31/2014 3:15 PM, Tyler Grummett wrote: >>> Hey Jorn, >>> >>> Yes I am definitely confused haha, this stuff is way out of my league >>> as a PhD student. >>> Anyway, I feel we are getting somewhere. >>> >>> timelock = >>> >>> avg: [121x19767 double] >>> var: [121x19767 double] >>> time: [1x19767 double] >>> dof: [121x19767 double] >>> label: {1x121 cell} >>> dimord: 'chan_time' >>> cov: [121x121 double] >>> elec: [1x1 struct] >>> cfg: [1x1 struct] >>> >>> source = >>> >>> time: [1x19767 double] >>> pos: [642x3 double] >>> inside: [642x1 double] >>> outside: [] >>> method: 'average' >>> avg: [1x1 struct] >>> cfg: [1x1 struct] >>> >>> sourceInt = >>> >>> time: [1x19767 double] >>> avg: [1x1 struct] >>> pos: [16777216x3 double] >>> dim: [256 256 256] >>> inside: [1x16777216 double] >>> outside: [1x0 double] >>> coordsys: 'ctf' >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> Given what I said last time, I might not comment on the differences. >>> I hope you can see something wrong. >>> >>> One thing I should mention is that the data is continuous, around 30 >>> seconds. Therefore there is only one trial, >>> is that an issue? >>> >>> Tyler >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl >>> on behalf of "Jörn M. Horschig" >>> >>> Sent: Monday, 31 March 2014 10:24 PM >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting interpolated sources with >>> ft_sourceplot >>> >>> Hi Tyler, >>> >>> there is not much inherently different between time- and >>> freuqency-domain beamformer, at least in terms of computing the forward >>> and the inverse solution. But I see that you are obviously confused, so >>> let me try to help you out and shed some light on what you are actually >>> doing ;) >>> >>> >>>> I had a look at my variables. >>>> >>>> source.avg = >>>> >>>> pow: [642x1 double] >>>> filter: {642x1 cell} >>>> >>>> sourceInt.avg = >>>> >>>> pow: [16777216x1 double] >>>> >>>> So clearly, as both variables are completely different. Something >>>> has gone wrong. >>> No, that is actually how it should be. From below you can see that your >>> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >>> 16777216 elements. In line with source.avg.pow, you should see that your >>> 'grid' consists of 642 elements, so you were computing your source >>> activity on a grid of in total 642 elements. Then you used the original >>> MRI to interpolate from 642 to these 16 million grid points. Actually, >>> since you specific cfg.downsample = 2, it should have been only 8 >>> million points, so that's where things already get a bit weird. >>> >>> So let's go into some sanity checks: >>> 1. are you using the latest version (or a recent, i.e. from this year) >>> of FielTrip? >>> 2. sourceInt should look something like this, does it? >>> >>> source_diff_int = >>> inside: [46x55x46 logical] >>> avg: [1x1 struct] >>> dim: [46 55 46] >>> transform: [4x4 double] >>> anatomy: [46x55x46 double] >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> >>> >>> 3. source should look something like this: >>> >>> source = >>> dim: [20 25 22] >>> freq: 54.8287 >>> cumtapcnt: [338x1 double] >>> pos: [11000x3 double] >>> inside: [1x5798 double] >>> outside: [1x5202 double] >>> method: 'average' >>> avg: [1x1 struct] >>> trialinfo: [338x1 double] >>> cfg: [1x1 struct] >>> >>> 4. also check your grid, should be something like this: >>> >>> sourcemodel = >>> >>> pos: [11000x3 double] >>> dim: [20 25 22] >>> unit: 'cm' >>> inside: [1x5798 double] >>> outside: [1x5202 double] >>> params: [1x1 struct] >>> initial: [4x4 double] >>> cfg: [1x1 struct] >>> >>> >>> Of course, it should all look a bit different, because you are using >>> LCMV, but essentially it should be the same. Lastly, you can check other >>> source plotting methods, like 'ortho' or try to plot the source >>> structure rather than the sourceInt structure. In the end, the error >>> must be somewhere in your grid, be it in .pos or .inside, because >>> FieldTrip thinks that there is only one voxel to be plotted. There are >>> other things that may be the issue, but I am not sure about these. So, I >>> would suggest that you play a bit around and see where the error might >>> come from (e.g. follow this tutorial: >>> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >>> steps that you need for LCMV, maybe also check out: >>> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >>> >>> there, LCMV is used, but on one voxel only) >>> >>> Best, >>> Jörn >>> >>>> The next part of my code is the following: >>>> >>>> % interpolate sources >>>> mri = ft_read_mri('Subject01.mri'); >>>> mri = ft_volumereslice([], mri); >>>> >>>> cfg = []; >>>> cfg.downsample = 2; >>>> cfg.parameter = 'avg.pow'; >>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>> parameter >>>> % does not vary over time, therefore the time >>>> dimension is not needed. >>>> >>>> mri = >>>> >>>> anatomy: [256x256x256 double] >>>> dim: [256 256 256] >>>> transform: [4x4 double] >>>> coordsys: 'ctf' >>>> unit: 'mm' >>>> cfg: [1x1 struct] >>>> >>>> I cant really see if the data works in the tutorial because it >>>> doesnt appear as though fieldtrip has a tutorial on lcmv >>>> beamformers, they seem to stick to frequency domain beamformers. >>>> >>>> Ive been wrong before though, >>>> >>>> thanks for your help. >>>> >>>> Tyler >>>> >>>> ************************* >>>> >>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>> PhD Candidate >>>> Brain Signals Laboratory >>>> Flinders University >>>> Rm 5A301 >>>> Ext 66124 >>>> >>>> ________________________________________ >>>> From: fieldtrip-bounces at science.ru.nl >>>> on behalf of "Jörn M. Horschig" >>>> >>>> Sent: Monday, 31 March 2014 7:13 PM >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>> ft_sourceplot >>>> >>>> Hi Tyler, >>>> >>>> hm, okay, it could be that the issue with the leadfield and with the >>>> plot are related, but it could also be that they are separate issues. I >>>> just saw that you posted the same 'problem' on bugzilla and included a >>>> picture. Maybe for next time, include a picture on the mailinglist and >>>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>>> and not if you are not sure. That saves us a lot of time in separating >>>> code issues from user problems ;) >>>> >>>> So, back to you problem. It seems that your reconstruction results in >>>> one voxel only. Are you sure that your grid consistents of more than >>>> just one position? So, for example check the size of the matrices in >>>> source.avg, source- and headmodel, etc. >>>> >>>> Also, you can check in Matlab the respective fields of source and >>>> sourceInt and see whether that makes sense. >>>> >>>> Lastly, a neat way to check is always to use your code on data from the >>>> tutorial, and vice versa, use code from the tutorial on your data and >>>> see whether that works. Both should give sensible results, and if one >>>> does not, you know where to start looking for a solution ;) >>>> >>>> Best, >>>> Jörn >>>> >>>> >>>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>>> Hey Jorn, >>>>> >>>>> Previously I have let ft_sourceanalysis do a lead field because if >>>>> I use the following code: >>>>> >>>>> % compute lead field ( apparently source analysis computes >>>>> % lead field anyway >>>>> cfg = []; >>>>> cfg.elec = timelock.elec; >>>>> cfg.vol = vol; >>>>> cfg.reducerank = 3; >>>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>>> cm resolution >>>>> cfg.grid.unit = 'cm'; >>>>> cfg.normalize = 'yes'; % if you are not >>>>> contrasting the activity of interest again another condition or >>>>> baseline time-window >>>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>>> I AM UP TO >>>>> >>>>> and then calculate the source analysis: >>>>> >>>>> % Source Analysis: without contrasting condition >>>>> cfg = []; >>>>> cfg.method = 'lcmv'; >>>>> cfg.grid = grid; >>>>> cfg.vol = vol; >>>>> % cfg.grid.pos = maxpos; >>>>> cfg.keepfilter = 'yes'; >>>>> cfg.dics.projectnoise = 'yes'; >>>>> % cfg.dics.lambda = 0; >>>>> source = ft_sourceanalysis( cfg, timelock); >>>>> >>>>> then I get an error than says: >>>>> >>>>> Error using * >>>>> Inner matrix dimensions must agree. >>>>> >>>>> Error in beamformer_lcmv (line 268) >>>>> filt = pinv(lf' * invCy * lf) * lf' * >>>>> invCy; % van Veen eqn. 23, use >>>>> PINV/SVD to cover rank deficient leadfield >>>>> >>>>> Error in ft_sourceanalysis (line 794) >>>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>>> optarg{:}); >>>>> >>>>> I just removed the leadfield code and it successfully ran. I could >>>>> also interpolate it later. >>>>> Is this the correct approach. >>>>> >>>>> Thankyou in advance! >>>>> >>>>> Tyler >>>>> >>>>> ************************* >>>>> >>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>> PhD Candidate >>>>> Brain Signals Laboratory >>>>> Flinders University >>>>> Rm 5A301 >>>>> Ext 66124 >>>>> >>>>> ________________________________________ >>>>> From: fieldtrip-bounces at science.ru.nl >>>>> on behalf of "Jörn M. Horschig" >>>>> >>>>> Sent: Monday, 31 March 2014 5:30 PM >>>>> To: FieldTrip discussion list >>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>> ft_sourceplot >>>>> >>>>> Hi Tyler, >>>>> >>>>> what you are describing sounds to me like the center bias of the >>>>> beamformer. Did you contrast the activity with anything, or did you >>>>> normalize your leadfield? >>>>> Check this out: >>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>>> >>>>> >>>>> Best, >>>>> Jörn >>>>> >>>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>>> I have been trying to plot my interpolated source data using the >>>>>> code: >>>>>> >>>>>> % interpolate sources >>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>> mri = ft_volumereslice([], mri); >>>>>> cfg = []; >>>>>> cfg.downsample = 2; >>>>>> cfg.parameter = 'avg.pow'; >>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>> parameter >>>>>> % does not vary over time, therefore the time >>>>>> dimension >>>>>> is not needed. >>>>>> >>>>>> % Plot interpolated data >>>>>> cfg = []; %#ok >>>>>> cfg.method = 'ortho'; % spline >>>>>> cfg.funparameter = 'avg.pow'; >>>>>> ft_sourceplot( cfg, sourceInt); >>>>>> >>>>>> However the figure that comes up just had orange squares in the >>>>>> subplots. >>>>>> >>>>>> I dont know where Ive gone wrong. >>>>>> >>>>>> >>>>>> Tyler >>>>>> >>>>>> >>>>>> ************************* >>>>>> >>>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>>> /PhD Candidate/ >>>>>> /Brain Signals Laboratory/ >>>>>> /Flinders University/ >>>>>> /Rm 5A301/ >>>>>> /Ext 66124/ >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> -- >>>>> Jörn M. Horschig >>>>> PhD Student >>>>> Donders Institute for Brain, Cognition and Behaviour >>>>> Centre for Cognitive Neuroimaging >>>>> Radboud University Nijmegen >>>>> Neuronal Oscillations Group >>>>> FieldTrip Development Team >>>>> >>>>> P.O. Box 9101 >>>>> NL-6500 HB Nijmegen >>>>> The Netherlands >>>>> >>>>> Contact: >>>>> E-Mail: jm.horschig at donders.ru.nl >>>>> Tel: +31-(0)24-36-68493 >>>>> Web: http://www.ru.nl/donders >>>>> >>>>> Visiting address: >>>>> Trigon, room 2.30 >>>>> Kapittelweg 29 >>>>> NL-6525 EN Nijmegen >>>>> The Netherlands >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> -- >>>> Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From natalia.zaretskaya at cin.uni-tuebingen.de Tue Apr 1 09:19:39 2014 From: natalia.zaretskaya at cin.uni-tuebingen.de (Natalia Zaretskaya) Date: Tue, 1 Apr 2014 09:19:39 +0200 Subject: [FieldTrip] PLV with DICS beamformer Message-ID: <003FC94A-3967-44F3-A0E2-BC813E99C4D8@cin.uni-tuebingen.de> Dear FieldTrip experts, I would like to be able to compute the phase-locking value (Lachaux, 1999) using source data derived from disc beamformer. Right now I perform ft_sourceanalysis with cfg.method = ‘dics’; cfg.refdip = [x y z]; cfg.rawtrial = ‘yes’; cfg.keepcsd = ‘yes’; cfg.grid.filter = source.avg.filter; % precomputed common filter for two conditions and then use the imaginary part of the single-trial cross-spectral densities to compute PLV “by hand”. Cross-spectra at each position have a 3x3 format, so I compute the PLV for each dipole orientation pair and then average. I was wondering whether 1) the above procedure is technically correct and 2) whether there is a better, more efficient way to do it (I assume plv can be derived at the same step where source.avg.coh is computed?). Many thanks in advance! Best regards, Natalia Zaretskaya --- Dr. Natalia Zaretskaya Centre for Integrative Neuroscience Vision and Cognition Lab (AG Bartels) 72076 Tübingen, Germany natalia.zaretskaya at cin.uni-tuebingen.de phone: +49 7071 2989032 -------------- next part -------------- An HTML attachment was scrubbed... URL: From meschwe at gmail.com Tue Apr 1 14:12:20 2014 From: meschwe at gmail.com (Meike Schweisfurth) Date: Tue, 1 Apr 2014 14:12:20 +0200 Subject: [FieldTrip] source analysis on the group level Message-ID: Dear Fieldtrippers! I am very new to MEG and have a question concerning source analysis on the group level. Specifically, I have two consecutive problems: 1) After mne source analysis (roughly as described in http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate) for individual subjects and for two different conditions, I would like to combine the data between subjects for each condition (using the same grid for all of them). However, I keep getting the following error: *"Subscripted assignment dimension mismatch.* *Error in ft_sourcegrandaverage (line 157)* * dat(:,i) = tmp(:);*" Does anybody know know to handle that or why it occurs? 2) I then went on without averaging and wanted to calculated statistics, very much as described in http://fieldtrip.fcdonders.nl/example/source_statistics in the group level section. As I could not use ft_sourcegrandaverage before, I fed in the output from ft_sourceanalysis for all subjects behind each other, cfg=[]; %cfg.dim = sc1{1}.dim; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.parameter = 'pow'; cfg.correctm = 'cluster'; cfg.numrandomization = 500; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.alpha = 0.025; cfg.tail = 0; cfg.latency =[0, 0.6]; nsubj=numel(sc1); cfg.design(1,:) = [1:nsubj 1:nsubj]; cfg.design(2,:) = [ones(1,nsubj) ones(1,nsubj)*2]; cfg.uvar = 1; % row of design matrix that contains unit variable (in this case: subjects) cfg.ivar = 2; % row of design matrix that contains independent variable (the conditions) stat = ft_sourcestatistics(cfg, sc1{1}, sc1{2}, sc1{3}, sc2{1}, sc2{2} ,sc2{3} ); , where e.g. sc1{1}=time: [1x1465 double] pos: [3000x3 double] inside: [3000x1 double] outside: [1x0 double] method: 'average' avg: [1x1 struct] cfg: [1x1 struct] First, I got an error saying that I do not have a field 'pow', which I had entered as cfg.parameter = 'pow', although that field was only hidden in sc1{}.avg.pow. To circumvent that error, I then copied the avg.pow data to an extra field pow and the error was gone pow: [3000x1465 double] However, giving now I get the error: *"Error using false* *Out of memory. Type HELP MEMORY for your options.* *Error in ft_statistics_montecarlo (line 177)* * cfg.connectivity = false(size(dat,1));* *Error in statistics_wrapper (line 308)* * [stat, cfg] = statmethod(cfg, dat, design);* *Error in ft_sourcestatistics (line 107)* * [stat, cfg] = statistics_wrapper(cfg, varargin{:});**"* Does anybody know a solution for that? What should I set cfg.dim to, as I do not have output from ft_sourcegrandaverage? I would be really happy for any help! Best, Meike -------------- next part -------------- An HTML attachment was scrubbed... URL: From meschwe at gmail.com Tue Apr 1 14:12:45 2014 From: meschwe at gmail.com (Meike Schweisfurth) Date: Tue, 1 Apr 2014 14:12:45 +0200 Subject: [FieldTrip] warping from MNI to individual subjects Message-ID: Dear Fieldtrippers! As newbie I have another question, now concerning the warping from MNI to individual subjects. Using the below code (the first part almost entirely from http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space), I get first the template and then apply the grid to the individual subjects. However, in later on analysis step it turned out that while the subjects where nicely similar positioned, the template position is entirely different, as it is was even axes were exchanged... Does anybody know what could be the reason and how to change it? Thanks for any suggestions! Best, Meike % NOTE: the path to the template file is user-specific template = ft_read_mri('fieldtrip/fieldtrip-20140316/external/spm8/templates/T1.nii'); template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the coordinate system % segment the template brain and construct a volume conduction model (i.e. head model): this is needed % for the inside/outside detection of voxels. cfg = []; template_seg = ft_volumesegment(cfg, template); cfg = []; cfg.method = 'singleshell'; template_vol = ft_prepare_headmodel(cfg, template_seg); template_vol = ft_convert_units(template_vol, 'cm'); % Convert the vol to cm, since the grid will also be expressed in cm % construct the dipole grid in the template brain coordinates % the source units are in cm % the negative inwardshift means an outward shift of the brain surface for inside/outside detection cfg = []; cfg.grid.xgrid = -20:1:20; cfg.grid.ygrid = -20:1:20; cfg.grid.zgrid = -20:1:20; cfg.grid.unit = 'cm'; cfg.grid.tight = 'yes'; cfg.inwardshift = -1.5; cfg.vol = template_vol; template_grid = ft_prepare_sourcemodel(cfg); save('../analysis/MEG/source_analysis/MNI','template_grid','template_vol','template_seg','template') % make a figure with the template head model and dipole grid figure hold on ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', 'none');alpha 0.5; camlight; ft_plot_mesh(template_grid.pos(template_grid.inside,:)); else load('../analysis/MEG/source_analysis/MNI','template_grid','template_vol','template_seg','template') %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SUBJECTS={ 'VP02' 'VP03' 'VP04' 'VP05' 'VP06' 'VP07' 'VP08' 'VP09' 'VP11' 'VP12' 'VP13' 'VP14' 'VP15' 'VP16' 'VP17' 'VP18'} for SUBJI=SUBJECTS SUBJ=SUBJI{1}; % read the single subject anatomical MRI load(['..*/analysis/MEG/source_analysis/*',SUBJ,'/mri']); %Has been processed to CFT coordinates before load(['..*/analysis/MEG/source_analysis/*',SUBJ,'/segmentedmri']); cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, segmentedmri); % create the subject specific grid, using the template grid that has just been created cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = template_grid; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri_ra; grid = ft_prepare_sourcemodel(cfg); % make a figure of the single subject headmodel, and grid positions figure; ft_plot_vol(vol, 'edgecolor', 'none'); alpha 0.4; %camlight ft_plot_mesh(grid.pos(grid.inside,:)); save(['..*/analysis/MEG/source_analysis/*',SUBJ,'/MNIgrid'],'grid','vol') end -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Tue Apr 1 15:12:48 2014 From: julian.keil at gmail.com (Julian Keil) Date: Tue, 1 Apr 2014 15:12:48 +0200 Subject: [FieldTrip] warping from MNI to individual subjects In-Reply-To: References: Message-ID: <57CBCEA0-7232-44A9-A8B0-05588E4C2310@gmail.com> Dear Meike, I'm not sure if this relates to your problem, but I had - possibly similar - issues with the warped grid and the template being 90° rotated. My problem was due to an error during the realignment of the MRI. Did you check whether the realignment works and whether your different coordinate systems make sense? Could you also maybe attach a picture of your exchanged axes? At least for me it's hard to image how this looks. Best, Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 01.04.2014 um 14:12 schrieb Meike Schweisfurth: > Dear Fieldtrippers! > As newbie I have another question, now concerning the warping from MNI to individual subjects. > Using the below code (the first part almost entirely from http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space), I get first the template and then apply the grid to the individual subjects. > However, in later on analysis step it turned out that while the subjects where nicely similar positioned, the template position is entirely different, as it is was even axes were exchanged... > Does anybody know what could be the reason and how to change it? > Thanks for any suggestions! > Best, Meike > > > % NOTE: the path to the template file is user-specific > template = ft_read_mri('fieldtrip/fieldtrip-20140316/external/spm8/templates/T1.nii'); > template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the coordinate system > > % segment the template brain and construct a volume conduction model (i.e. head model): this is needed > % for the inside/outside detection of voxels. > cfg = []; > template_seg = ft_volumesegment(cfg, template); > > cfg = []; > cfg.method = 'singleshell'; > template_vol = ft_prepare_headmodel(cfg, template_seg); > template_vol = ft_convert_units(template_vol, 'cm'); % Convert the vol to cm, since the grid will also be expressed in cm > > % construct the dipole grid in the template brain coordinates > % the source units are in cm > % the negative inwardshift means an outward shift of the brain surface for inside/outside detection > cfg = []; > cfg.grid.xgrid = -20:1:20; > cfg.grid.ygrid = -20:1:20; > cfg.grid.zgrid = -20:1:20; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > cfg.inwardshift = -1.5; > cfg.vol = template_vol; > template_grid = ft_prepare_sourcemodel(cfg); > save('../analysis/MEG/source_analysis/MNI','template_grid','template_vol','template_seg','template') > % make a figure with the template head model and dipole grid > figure > hold on > ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', 'none');alpha 0.5; camlight; > ft_plot_mesh(template_grid.pos(template_grid.inside,:)); > else load('../analysis/MEG/source_analysis/MNI','template_grid','template_vol','template_seg','template') > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > SUBJECTS={ 'VP02' 'VP03' 'VP04' 'VP05' 'VP06' 'VP07' 'VP08' 'VP09' 'VP11' 'VP12' 'VP13' 'VP14' 'VP15' 'VP16' 'VP17' 'VP18'} > > for SUBJI=SUBJECTS > SUBJ=SUBJI{1}; > % read the single subject anatomical MRI > load(['../analysis/MEG/source_analysis/',SUBJ,'/mri']); %Has been processed to CFT coordinates before > load(['../analysis/MEG/source_analysis/',SUBJ,'/segmentedmri']); > > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > % create the subject specific grid, using the template grid that has just been created > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template_grid; > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > cfg.mri = mri_ra; > grid = ft_prepare_sourcemodel(cfg); > > % make a figure of the single subject headmodel, and grid positions > figure; > ft_plot_vol(vol, 'edgecolor', 'none'); alpha 0.4; %camlight > ft_plot_mesh(grid.pos(grid.inside,:)); > > save(['../analysis/MEG/source_analysis/',SUBJ,'/MNIgrid'],'grid','vol') > end > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Apr 1 17:16:27 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 01 Apr 2014 17:16:27 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>, <533985D8.4080504@donders.ru.nl> Message-ID: <533AD84B.6060600@donders.ru.nl> Hi Tyler, any reason why you don't want to go back to sensor-space but stay in component-space with your data? I would assume that the error will be gone if you use the back-projected data (ft_rejectcomponent, with cfg.component = []). Best, Jörn On 4/1/2014 8:15 AM, Tyler Grummett wrote: > Hey Jorn, > > In addition to my previous emails, Ive been trying to debug the functions. > > In ft_sourceanalysis, line 661 to 677: > > % HACK: use the default code > % select the channels of interest > [dum, datchanindx] = match_str(cfg.channel, data.label); > if strcmp(data.dimord, 'chan_time') > % It is in principle possible to have timelockanalysis with > % keeptrial=yes and only a single trial in the raw data. > % In that case the covariance should be represented as Nchan*Nchan > data.avg = data.avg(datchanindx,:); > %data.cov = reshape(data.cov, length(datchanindx), length(datchanindx)); > data.cov = data.cov(datchanindx,datchanindx); > else > data.avg = data.avg(datchanindx,:); > data.cov = data.cov(:,datchanindx,datchanindx); > data.trial = data.trial(:,datchanindx,:); > end > data.label = data.label(datchanindx); > Nchans = length(data.label); > > I found that my cfg.channel is []; and the data.label is all my ICA components labelled ica_001 etc. > > So it is returned as a []; > which means data.cov = []; > > I think then it will crash later parts of the code. Does this function work on ICA components? > > I ran the ICA in eeglab. > > Tyler. > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" > Sent: Tuesday, 1 April 2014 1:42 AM > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot > > just to clarify and be precise >> The pos-matrix has to be a regular 3D grid, i.e. be representable as a >> 3x3x3 matrix. > it actually does not have to be as you can also beam individual grid > points, but if you have a .dim field, then is has to be like above. But > that does not affect the rest of the mail I wrote ;) > > >> I am not quite sure how the sourceinterpolate function is handeling >> the fact that you do not have that .dim field. Apparently, it is also >> confused ;) >> >> Do you want to reconstruct only some voxels? From your code it seems >> that you want to cover the whole brain with a 1cm resolution. If the >> latter is the case, maybe restart with creating your forward model by >> following the tutorial that I posted in my previous mail. There are >> some sanity checks that can help you figuring out if you are doing the >> correct thing. If the former one is the case, please explain again >> what exactly you want to achieve and how you are building your forward >> model. >> >> Best, >> Jörn >> >> btw, there's nothing wrong with being a PhD student, it's just a >> matter of experience in practice and theory as in all domains in life ;) >> >> >> On 3/31/2014 3:15 PM, Tyler Grummett wrote: >>> Hey Jorn, >>> >>> Yes I am definitely confused haha, this stuff is way out of my league >>> as a PhD student. >>> Anyway, I feel we are getting somewhere. >>> >>> timelock = >>> >>> avg: [121x19767 double] >>> var: [121x19767 double] >>> time: [1x19767 double] >>> dof: [121x19767 double] >>> label: {1x121 cell} >>> dimord: 'chan_time' >>> cov: [121x121 double] >>> elec: [1x1 struct] >>> cfg: [1x1 struct] >>> >>> source = >>> >>> time: [1x19767 double] >>> pos: [642x3 double] >>> inside: [642x1 double] >>> outside: [] >>> method: 'average' >>> avg: [1x1 struct] >>> cfg: [1x1 struct] >>> >>> sourceInt = >>> >>> time: [1x19767 double] >>> avg: [1x1 struct] >>> pos: [16777216x3 double] >>> dim: [256 256 256] >>> inside: [1x16777216 double] >>> outside: [1x0 double] >>> coordsys: 'ctf' >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> Given what I said last time, I might not comment on the differences. >>> I hope you can see something wrong. >>> >>> One thing I should mention is that the data is continuous, around 30 >>> seconds. Therefore there is only one trial, >>> is that an issue? >>> >>> Tyler >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl >>> on behalf of "Jörn M. Horschig" >>> >>> Sent: Monday, 31 March 2014 10:24 PM >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting interpolated sources with >>> ft_sourceplot >>> >>> Hi Tyler, >>> >>> there is not much inherently different between time- and >>> freuqency-domain beamformer, at least in terms of computing the forward >>> and the inverse solution. But I see that you are obviously confused, so >>> let me try to help you out and shed some light on what you are actually >>> doing ;) >>> >>> >>>> I had a look at my variables. >>>> >>>> source.avg = >>>> >>>> pow: [642x1 double] >>>> filter: {642x1 cell} >>>> >>>> sourceInt.avg = >>>> >>>> pow: [16777216x1 double] >>>> >>>> So clearly, as both variables are completely different. Something >>>> has gone wrong. >>> No, that is actually how it should be. From below you can see that your >>> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >>> 16777216 elements. In line with source.avg.pow, you should see that your >>> 'grid' consists of 642 elements, so you were computing your source >>> activity on a grid of in total 642 elements. Then you used the original >>> MRI to interpolate from 642 to these 16 million grid points. Actually, >>> since you specific cfg.downsample = 2, it should have been only 8 >>> million points, so that's where things already get a bit weird. >>> >>> So let's go into some sanity checks: >>> 1. are you using the latest version (or a recent, i.e. from this year) >>> of FielTrip? >>> 2. sourceInt should look something like this, does it? >>> >>> source_diff_int = >>> inside: [46x55x46 logical] >>> avg: [1x1 struct] >>> dim: [46 55 46] >>> transform: [4x4 double] >>> anatomy: [46x55x46 double] >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> >>> >>> 3. source should look something like this: >>> >>> source = >>> dim: [20 25 22] >>> freq: 54.8287 >>> cumtapcnt: [338x1 double] >>> pos: [11000x3 double] >>> inside: [1x5798 double] >>> outside: [1x5202 double] >>> method: 'average' >>> avg: [1x1 struct] >>> trialinfo: [338x1 double] >>> cfg: [1x1 struct] >>> >>> 4. also check your grid, should be something like this: >>> >>> sourcemodel = >>> >>> pos: [11000x3 double] >>> dim: [20 25 22] >>> unit: 'cm' >>> inside: [1x5798 double] >>> outside: [1x5202 double] >>> params: [1x1 struct] >>> initial: [4x4 double] >>> cfg: [1x1 struct] >>> >>> >>> Of course, it should all look a bit different, because you are using >>> LCMV, but essentially it should be the same. Lastly, you can check other >>> source plotting methods, like 'ortho' or try to plot the source >>> structure rather than the sourceInt structure. In the end, the error >>> must be somewhere in your grid, be it in .pos or .inside, because >>> FieldTrip thinks that there is only one voxel to be plotted. There are >>> other things that may be the issue, but I am not sure about these. So, I >>> would suggest that you play a bit around and see where the error might >>> come from (e.g. follow this tutorial: >>> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >>> steps that you need for LCMV, maybe also check out: >>> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >>> >>> there, LCMV is used, but on one voxel only) >>> >>> Best, >>> Jörn >>> >>>> The next part of my code is the following: >>>> >>>> % interpolate sources >>>> mri = ft_read_mri('Subject01.mri'); >>>> mri = ft_volumereslice([], mri); >>>> >>>> cfg = []; >>>> cfg.downsample = 2; >>>> cfg.parameter = 'avg.pow'; >>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>> parameter >>>> % does not vary over time, therefore the time >>>> dimension is not needed. >>>> >>>> mri = >>>> >>>> anatomy: [256x256x256 double] >>>> dim: [256 256 256] >>>> transform: [4x4 double] >>>> coordsys: 'ctf' >>>> unit: 'mm' >>>> cfg: [1x1 struct] >>>> >>>> I cant really see if the data works in the tutorial because it >>>> doesnt appear as though fieldtrip has a tutorial on lcmv >>>> beamformers, they seem to stick to frequency domain beamformers. >>>> >>>> Ive been wrong before though, >>>> >>>> thanks for your help. >>>> >>>> Tyler >>>> >>>> ************************* >>>> >>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>> PhD Candidate >>>> Brain Signals Laboratory >>>> Flinders University >>>> Rm 5A301 >>>> Ext 66124 >>>> >>>> ________________________________________ >>>> From: fieldtrip-bounces at science.ru.nl >>>> on behalf of "Jörn M. Horschig" >>>> >>>> Sent: Monday, 31 March 2014 7:13 PM >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>> ft_sourceplot >>>> >>>> Hi Tyler, >>>> >>>> hm, okay, it could be that the issue with the leadfield and with the >>>> plot are related, but it could also be that they are separate issues. I >>>> just saw that you posted the same 'problem' on bugzilla and included a >>>> picture. Maybe for next time, include a picture on the mailinglist and >>>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>>> and not if you are not sure. That saves us a lot of time in separating >>>> code issues from user problems ;) >>>> >>>> So, back to you problem. It seems that your reconstruction results in >>>> one voxel only. Are you sure that your grid consistents of more than >>>> just one position? So, for example check the size of the matrices in >>>> source.avg, source- and headmodel, etc. >>>> >>>> Also, you can check in Matlab the respective fields of source and >>>> sourceInt and see whether that makes sense. >>>> >>>> Lastly, a neat way to check is always to use your code on data from the >>>> tutorial, and vice versa, use code from the tutorial on your data and >>>> see whether that works. Both should give sensible results, and if one >>>> does not, you know where to start looking for a solution ;) >>>> >>>> Best, >>>> Jörn >>>> >>>> >>>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>>> Hey Jorn, >>>>> >>>>> Previously I have let ft_sourceanalysis do a lead field because if >>>>> I use the following code: >>>>> >>>>> % compute lead field ( apparently source analysis computes >>>>> % lead field anyway >>>>> cfg = []; >>>>> cfg.elec = timelock.elec; >>>>> cfg.vol = vol; >>>>> cfg.reducerank = 3; >>>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>>> cm resolution >>>>> cfg.grid.unit = 'cm'; >>>>> cfg.normalize = 'yes'; % if you are not >>>>> contrasting the activity of interest again another condition or >>>>> baseline time-window >>>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>>> I AM UP TO >>>>> >>>>> and then calculate the source analysis: >>>>> >>>>> % Source Analysis: without contrasting condition >>>>> cfg = []; >>>>> cfg.method = 'lcmv'; >>>>> cfg.grid = grid; >>>>> cfg.vol = vol; >>>>> % cfg.grid.pos = maxpos; >>>>> cfg.keepfilter = 'yes'; >>>>> cfg.dics.projectnoise = 'yes'; >>>>> % cfg.dics.lambda = 0; >>>>> source = ft_sourceanalysis( cfg, timelock); >>>>> >>>>> then I get an error than says: >>>>> >>>>> Error using * >>>>> Inner matrix dimensions must agree. >>>>> >>>>> Error in beamformer_lcmv (line 268) >>>>> filt = pinv(lf' * invCy * lf) * lf' * >>>>> invCy; % van Veen eqn. 23, use >>>>> PINV/SVD to cover rank deficient leadfield >>>>> >>>>> Error in ft_sourceanalysis (line 794) >>>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>>> optarg{:}); >>>>> >>>>> I just removed the leadfield code and it successfully ran. I could >>>>> also interpolate it later. >>>>> Is this the correct approach. >>>>> >>>>> Thankyou in advance! >>>>> >>>>> Tyler >>>>> >>>>> ************************* >>>>> >>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>> PhD Candidate >>>>> Brain Signals Laboratory >>>>> Flinders University >>>>> Rm 5A301 >>>>> Ext 66124 >>>>> >>>>> ________________________________________ >>>>> From: fieldtrip-bounces at science.ru.nl >>>>> on behalf of "Jörn M. Horschig" >>>>> >>>>> Sent: Monday, 31 March 2014 5:30 PM >>>>> To: FieldTrip discussion list >>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>> ft_sourceplot >>>>> >>>>> Hi Tyler, >>>>> >>>>> what you are describing sounds to me like the center bias of the >>>>> beamformer. Did you contrast the activity with anything, or did you >>>>> normalize your leadfield? >>>>> Check this out: >>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>>> >>>>> >>>>> Best, >>>>> Jörn >>>>> >>>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>>> I have been trying to plot my interpolated source data using the >>>>>> code: >>>>>> >>>>>> % interpolate sources >>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>> mri = ft_volumereslice([], mri); >>>>>> cfg = []; >>>>>> cfg.downsample = 2; >>>>>> cfg.parameter = 'avg.pow'; >>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>> parameter >>>>>> % does not vary over time, therefore the time >>>>>> dimension >>>>>> is not needed. >>>>>> >>>>>> % Plot interpolated data >>>>>> cfg = []; %#ok >>>>>> cfg.method = 'ortho'; % spline >>>>>> cfg.funparameter = 'avg.pow'; >>>>>> ft_sourceplot( cfg, sourceInt); >>>>>> >>>>>> However the figure that comes up just had orange squares in the >>>>>> subplots. >>>>>> >>>>>> I dont know where Ive gone wrong. >>>>>> >>>>>> >>>>>> Tyler >>>>>> >>>>>> >>>>>> ************************* >>>>>> >>>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>>> /PhD Candidate/ >>>>>> /Brain Signals Laboratory/ >>>>>> /Flinders University/ >>>>>> /Rm 5A301/ >>>>>> /Ext 66124/ >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> -- >>>>> Jörn M. Horschig >>>>> PhD Student >>>>> Donders Institute for Brain, Cognition and Behaviour >>>>> Centre for Cognitive Neuroimaging >>>>> Radboud University Nijmegen >>>>> Neuronal Oscillations Group >>>>> FieldTrip Development Team >>>>> >>>>> P.O. Box 9101 >>>>> NL-6500 HB Nijmegen >>>>> The Netherlands >>>>> >>>>> Contact: >>>>> E-Mail: jm.horschig at donders.ru.nl >>>>> Tel: +31-(0)24-36-68493 >>>>> Web: http://www.ru.nl/donders >>>>> >>>>> Visiting address: >>>>> Trigon, room 2.30 >>>>> Kapittelweg 29 >>>>> NL-6525 EN Nijmegen >>>>> The Netherlands >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> -- >>>> Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From r.oostenveld at donders.ru.nl Tue Apr 1 19:19:57 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 1 Apr 2014 19:19:57 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <533AD84B.6060600@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>, <533985D8.4080504@donders.ru.nl> <533AD84B.6060600@donders.ru.nl> Message-ID: Hi Jorn I was browsing the FT list and see that you got involved with this question from Tyler. I can imagine there being problems with a pipeline like this preprocessing -> componentanalysis -> timelockanalysis -> dipolefitting although it should (i.e. "is meant to") work by fitting dipoles to component topographies. But the code is not frequently used like this and it might be possible that there has been regression of the code (i.e bugs in the latest version that were not there before). With sourceanalysis it depends on the method. Covariance estimates between components does not make much sense in the further inversion, and thereby beamforming won’t work. MNE should in principle work, but not with an estimated data covariance but rather a scaled identity covariance. Given the uncertain level of support , but clear expectations on what should (and should not) work, I suggest to file it as “bug” (i.e. the issue is that it should be tested) and to write a test script that goes (with e.g. some simulated data) over the various options. best regards, Robert On 01 Apr 2014, at 17:16, Jörn M. Horschig wrote: > Hi Tyler, > > any reason why you don't want to go back to sensor-space but stay in component-space with your data? I would assume that the error will be gone if you use the back-projected data (ft_rejectcomponent, with cfg.component = []). > > Best, > Jörn > > On 4/1/2014 8:15 AM, Tyler Grummett wrote: >> Hey Jorn, >> >> In addition to my previous emails, Ive been trying to debug the functions. >> >> In ft_sourceanalysis, line 661 to 677: >> >> % HACK: use the default code >> % select the channels of interest >> [dum, datchanindx] = match_str(cfg.channel, data.label); >> if strcmp(data.dimord, 'chan_time') >> % It is in principle possible to have timelockanalysis with >> % keeptrial=yes and only a single trial in the raw data. >> % In that case the covariance should be represented as Nchan*Nchan >> data.avg = data.avg(datchanindx,:); >> %data.cov = reshape(data.cov, length(datchanindx), length(datchanindx)); >> data.cov = data.cov(datchanindx,datchanindx); >> else >> data.avg = data.avg(datchanindx,:); >> data.cov = data.cov(:,datchanindx,datchanindx); >> data.trial = data.trial(:,datchanindx,:); >> end >> data.label = data.label(datchanindx); >> Nchans = length(data.label); >> >> I found that my cfg.channel is []; and the data.label is all my ICA components labelled ica_001 etc. >> >> So it is returned as a []; >> which means data.cov = []; >> >> I think then it will crash later parts of the code. Does this function work on ICA components? >> >> I ran the ICA in eeglab. >> >> Tyler. >> >> ************************* >> >> Tyler Grummett ( BBSc, BSc(Hons I)) >> PhD Candidate >> Brain Signals Laboratory >> Flinders University >> Rm 5A301 >> Ext 66124 >> >> ________________________________________ >> From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" >> Sent: Tuesday, 1 April 2014 1:42 AM >> To: fieldtrip at science.ru.nl >> Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot >> >> just to clarify and be precise >>> The pos-matrix has to be a regular 3D grid, i.e. be representable as a >>> 3x3x3 matrix. >> it actually does not have to be as you can also beam individual grid >> points, but if you have a .dim field, then is has to be like above. But >> that does not affect the rest of the mail I wrote ;) >> >> >>> I am not quite sure how the sourceinterpolate function is handeling >>> the fact that you do not have that .dim field. Apparently, it is also >>> confused ;) >>> >>> Do you want to reconstruct only some voxels? From your code it seems >>> that you want to cover the whole brain with a 1cm resolution. If the >>> latter is the case, maybe restart with creating your forward model by >>> following the tutorial that I posted in my previous mail. There are >>> some sanity checks that can help you figuring out if you are doing the >>> correct thing. If the former one is the case, please explain again >>> what exactly you want to achieve and how you are building your forward >>> model. >>> >>> Best, >>> Jörn >>> >>> btw, there's nothing wrong with being a PhD student, it's just a >>> matter of experience in practice and theory as in all domains in life ;) >>> >>> >>> On 3/31/2014 3:15 PM, Tyler Grummett wrote: >>>> Hey Jorn, >>>> >>>> Yes I am definitely confused haha, this stuff is way out of my league >>>> as a PhD student. >>>> Anyway, I feel we are getting somewhere. >>>> >>>> timelock = >>>> >>>> avg: [121x19767 double] >>>> var: [121x19767 double] >>>> time: [1x19767 double] >>>> dof: [121x19767 double] >>>> label: {1x121 cell} >>>> dimord: 'chan_time' >>>> cov: [121x121 double] >>>> elec: [1x1 struct] >>>> cfg: [1x1 struct] >>>> >>>> source = >>>> >>>> time: [1x19767 double] >>>> pos: [642x3 double] >>>> inside: [642x1 double] >>>> outside: [] >>>> method: 'average' >>>> avg: [1x1 struct] >>>> cfg: [1x1 struct] >>>> >>>> sourceInt = >>>> >>>> time: [1x19767 double] >>>> avg: [1x1 struct] >>>> pos: [16777216x3 double] >>>> dim: [256 256 256] >>>> inside: [1x16777216 double] >>>> outside: [1x0 double] >>>> coordsys: 'ctf' >>>> unit: 'mm' >>>> cfg: [1x1 struct] >>>> >>>> Given what I said last time, I might not comment on the differences. >>>> I hope you can see something wrong. >>>> >>>> One thing I should mention is that the data is continuous, around 30 >>>> seconds. Therefore there is only one trial, >>>> is that an issue? >>>> >>>> Tyler >>>> >>>> ************************* >>>> >>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>> PhD Candidate >>>> Brain Signals Laboratory >>>> Flinders University >>>> Rm 5A301 >>>> Ext 66124 >>>> >>>> ________________________________________ >>>> From: fieldtrip-bounces at science.ru.nl >>>> on behalf of "Jörn M. Horschig" >>>> >>>> Sent: Monday, 31 March 2014 10:24 PM >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>> ft_sourceplot >>>> >>>> Hi Tyler, >>>> >>>> there is not much inherently different between time- and >>>> freuqency-domain beamformer, at least in terms of computing the forward >>>> and the inverse solution. But I see that you are obviously confused, so >>>> let me try to help you out and shed some light on what you are actually >>>> doing ;) >>>> >>>> >>>>> I had a look at my variables. >>>>> >>>>> source.avg = >>>>> >>>>> pow: [642x1 double] >>>>> filter: {642x1 cell} >>>>> >>>>> sourceInt.avg = >>>>> >>>>> pow: [16777216x1 double] >>>>> >>>>> So clearly, as both variables are completely different. Something >>>>> has gone wrong. >>>> No, that is actually how it should be. From below you can see that your >>>> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >>>> 16777216 elements. In line with source.avg.pow, you should see that your >>>> 'grid' consists of 642 elements, so you were computing your source >>>> activity on a grid of in total 642 elements. Then you used the original >>>> MRI to interpolate from 642 to these 16 million grid points. Actually, >>>> since you specific cfg.downsample = 2, it should have been only 8 >>>> million points, so that's where things already get a bit weird. >>>> >>>> So let's go into some sanity checks: >>>> 1. are you using the latest version (or a recent, i.e. from this year) >>>> of FielTrip? >>>> 2. sourceInt should look something like this, does it? >>>> >>>> source_diff_int = >>>> inside: [46x55x46 logical] >>>> avg: [1x1 struct] >>>> dim: [46 55 46] >>>> transform: [4x4 double] >>>> anatomy: [46x55x46 double] >>>> unit: 'mm' >>>> cfg: [1x1 struct] >>>> >>>> >>>> >>>> 3. source should look something like this: >>>> >>>> source = >>>> dim: [20 25 22] >>>> freq: 54.8287 >>>> cumtapcnt: [338x1 double] >>>> pos: [11000x3 double] >>>> inside: [1x5798 double] >>>> outside: [1x5202 double] >>>> method: 'average' >>>> avg: [1x1 struct] >>>> trialinfo: [338x1 double] >>>> cfg: [1x1 struct] >>>> >>>> 4. also check your grid, should be something like this: >>>> >>>> sourcemodel = >>>> >>>> pos: [11000x3 double] >>>> dim: [20 25 22] >>>> unit: 'cm' >>>> inside: [1x5798 double] >>>> outside: [1x5202 double] >>>> params: [1x1 struct] >>>> initial: [4x4 double] >>>> cfg: [1x1 struct] >>>> >>>> >>>> Of course, it should all look a bit different, because you are using >>>> LCMV, but essentially it should be the same. Lastly, you can check other >>>> source plotting methods, like 'ortho' or try to plot the source >>>> structure rather than the sourceInt structure. In the end, the error >>>> must be somewhere in your grid, be it in .pos or .inside, because >>>> FieldTrip thinks that there is only one voxel to be plotted. There are >>>> other things that may be the issue, but I am not sure about these. So, I >>>> would suggest that you play a bit around and see where the error might >>>> come from (e.g. follow this tutorial: >>>> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >>>> steps that you need for LCMV, maybe also check out: >>>> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >>>> >>>> there, LCMV is used, but on one voxel only) >>>> >>>> Best, >>>> Jörn >>>> >>>>> The next part of my code is the following: >>>>> >>>>> % interpolate sources >>>>> mri = ft_read_mri('Subject01.mri'); >>>>> mri = ft_volumereslice([], mri); >>>>> >>>>> cfg = []; >>>>> cfg.downsample = 2; >>>>> cfg.parameter = 'avg.pow'; >>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>> parameter >>>>> % does not vary over time, therefore the time >>>>> dimension is not needed. >>>>> >>>>> mri = >>>>> >>>>> anatomy: [256x256x256 double] >>>>> dim: [256 256 256] >>>>> transform: [4x4 double] >>>>> coordsys: 'ctf' >>>>> unit: 'mm' >>>>> cfg: [1x1 struct] >>>>> >>>>> I cant really see if the data works in the tutorial because it >>>>> doesnt appear as though fieldtrip has a tutorial on lcmv >>>>> beamformers, they seem to stick to frequency domain beamformers. >>>>> >>>>> Ive been wrong before though, >>>>> >>>>> thanks for your help. >>>>> >>>>> Tyler >>>>> >>>>> ************************* >>>>> >>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>> PhD Candidate >>>>> Brain Signals Laboratory >>>>> Flinders University >>>>> Rm 5A301 >>>>> Ext 66124 >>>>> >>>>> ________________________________________ >>>>> From: fieldtrip-bounces at science.ru.nl >>>>> on behalf of "Jörn M. Horschig" >>>>> >>>>> Sent: Monday, 31 March 2014 7:13 PM >>>>> To: FieldTrip discussion list >>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>> ft_sourceplot >>>>> >>>>> Hi Tyler, >>>>> >>>>> hm, okay, it could be that the issue with the leadfield and with the >>>>> plot are related, but it could also be that they are separate issues. I >>>>> just saw that you posted the same 'problem' on bugzilla and included a >>>>> picture. Maybe for next time, include a picture on the mailinglist and >>>>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>>>> and not if you are not sure. That saves us a lot of time in separating >>>>> code issues from user problems ;) >>>>> >>>>> So, back to you problem. It seems that your reconstruction results in >>>>> one voxel only. Are you sure that your grid consistents of more than >>>>> just one position? So, for example check the size of the matrices in >>>>> source.avg, source- and headmodel, etc. >>>>> >>>>> Also, you can check in Matlab the respective fields of source and >>>>> sourceInt and see whether that makes sense. >>>>> >>>>> Lastly, a neat way to check is always to use your code on data from the >>>>> tutorial, and vice versa, use code from the tutorial on your data and >>>>> see whether that works. Both should give sensible results, and if one >>>>> does not, you know where to start looking for a solution ;) >>>>> >>>>> Best, >>>>> Jörn >>>>> >>>>> >>>>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>>>> Hey Jorn, >>>>>> >>>>>> Previously I have let ft_sourceanalysis do a lead field because if >>>>>> I use the following code: >>>>>> >>>>>> % compute lead field ( apparently source analysis computes >>>>>> % lead field anyway >>>>>> cfg = []; >>>>>> cfg.elec = timelock.elec; >>>>>> cfg.vol = vol; >>>>>> cfg.reducerank = 3; >>>>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>>>> cm resolution >>>>>> cfg.grid.unit = 'cm'; >>>>>> cfg.normalize = 'yes'; % if you are not >>>>>> contrasting the activity of interest again another condition or >>>>>> baseline time-window >>>>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>>>> I AM UP TO >>>>>> >>>>>> and then calculate the source analysis: >>>>>> >>>>>> % Source Analysis: without contrasting condition >>>>>> cfg = []; >>>>>> cfg.method = 'lcmv'; >>>>>> cfg.grid = grid; >>>>>> cfg.vol = vol; >>>>>> % cfg.grid.pos = maxpos; >>>>>> cfg.keepfilter = 'yes'; >>>>>> cfg.dics.projectnoise = 'yes'; >>>>>> % cfg.dics.lambda = 0; >>>>>> source = ft_sourceanalysis( cfg, timelock); >>>>>> >>>>>> then I get an error than says: >>>>>> >>>>>> Error using * >>>>>> Inner matrix dimensions must agree. >>>>>> >>>>>> Error in beamformer_lcmv (line 268) >>>>>> filt = pinv(lf' * invCy * lf) * lf' * >>>>>> invCy; % van Veen eqn. 23, use >>>>>> PINV/SVD to cover rank deficient leadfield >>>>>> >>>>>> Error in ft_sourceanalysis (line 794) >>>>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>>>> optarg{:}); >>>>>> >>>>>> I just removed the leadfield code and it successfully ran. I could >>>>>> also interpolate it later. >>>>>> Is this the correct approach. >>>>>> >>>>>> Thankyou in advance! >>>>>> >>>>>> Tyler >>>>>> >>>>>> ************************* >>>>>> >>>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>>> PhD Candidate >>>>>> Brain Signals Laboratory >>>>>> Flinders University >>>>>> Rm 5A301 >>>>>> Ext 66124 >>>>>> >>>>>> ________________________________________ >>>>>> From: fieldtrip-bounces at science.ru.nl >>>>>> on behalf of "Jörn M. Horschig" >>>>>> >>>>>> Sent: Monday, 31 March 2014 5:30 PM >>>>>> To: FieldTrip discussion list >>>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>>> ft_sourceplot >>>>>> >>>>>> Hi Tyler, >>>>>> >>>>>> what you are describing sounds to me like the center bias of the >>>>>> beamformer. Did you contrast the activity with anything, or did you >>>>>> normalize your leadfield? >>>>>> Check this out: >>>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>>>> >>>>>> >>>>>> Best, >>>>>> Jörn >>>>>> >>>>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>>>> I have been trying to plot my interpolated source data using the >>>>>>> code: >>>>>>> >>>>>>> % interpolate sources >>>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>>> mri = ft_volumereslice([], mri); >>>>>>> cfg = []; >>>>>>> cfg.downsample = 2; >>>>>>> cfg.parameter = 'avg.pow'; >>>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>>> parameter >>>>>>> % does not vary over time, therefore the time >>>>>>> dimension >>>>>>> is not needed. >>>>>>> >>>>>>> % Plot interpolated data >>>>>>> cfg = []; %#ok >>>>>>> cfg.method = 'ortho'; % spline >>>>>>> cfg.funparameter = 'avg.pow'; >>>>>>> ft_sourceplot( cfg, sourceInt); >>>>>>> >>>>>>> However the figure that comes up just had orange squares in the >>>>>>> subplots. >>>>>>> >>>>>>> I dont know where Ive gone wrong. >>>>>>> >>>>>>> >>>>>>> Tyler >>>>>>> >>>>>>> >>>>>>> ************************* >>>>>>> >>>>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>>>> /PhD Candidate/ >>>>>>> /Brain Signals Laboratory/ >>>>>>> /Flinders University/ >>>>>>> /Rm 5A301/ >>>>>>> /Ext 66124/ >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> -- >>>>>> Jörn M. Horschig >>>>>> PhD Student >>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>> Centre for Cognitive Neuroimaging >>>>>> Radboud University Nijmegen >>>>>> Neuronal Oscillations Group >>>>>> FieldTrip Development Team >>>>>> >>>>>> P.O. Box 9101 >>>>>> NL-6500 HB Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> Contact: >>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>> Tel: +31-(0)24-36-68493 >>>>>> Web: http://www.ru.nl/donders >>>>>> >>>>>> Visiting address: >>>>>> Trigon, room 2.30 >>>>>> Kapittelweg 29 >>>>>> NL-6525 EN Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> -- >>>>> Jörn M. Horschig >>>>> PhD Student >>>>> Donders Institute for Brain, Cognition and Behaviour >>>>> Centre for Cognitive Neuroimaging >>>>> Radboud University Nijmegen >>>>> Neuronal Oscillations Group >>>>> FieldTrip Development Team >>>>> >>>>> P.O. Box 9101 >>>>> NL-6500 HB Nijmegen >>>>> The Netherlands >>>>> >>>>> Contact: >>>>> E-Mail: jm.horschig at donders.ru.nl >>>>> Tel: +31-(0)24-36-68493 >>>>> Web: http://www.ru.nl/donders >>>>> >>>>> Visiting address: >>>>> Trigon, room 2.30 >>>>> Kapittelweg 29 >>>>> NL-6525 EN Nijmegen >>>>> The Netherlands >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> -- >>>> Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From gopalar.ccf at gmail.com Tue Apr 1 21:31:35 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Tue, 1 Apr 2014 15:31:35 -0400 Subject: [FieldTrip] Source statistics on spatio-temporal source reconstruction data (MNE) Message-ID: Dear all, I saw a lot of discussion about source grand average and source statistics on Spatio-temporal MNE source data in the forum, however the last major discussion was in june 2013 http://mailman.science.ru.nl/pipermail/fieldtrip/2013-June/006684.html I was wondering if any major updates have been done to fieldtrip to tackle this issue since then. I also see a bug report on this issue. http://bugzilla.fcdonders.nl/show_bug.cgi?id=2185 It would be great if someone can revive this discussion with some new information. Thanks vey much Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Apr 1 22:34:18 2014 From: jm.horschig at donders.ru.nl (=?windows-1252?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 01 Apr 2014 22:34:18 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>, <533985D8.4080504@donders.ru.nl> <533AD84B.6060600@donders.ru.nl> Message-ID: <533B22CA.8040305@donders.ru.nl> Hi Robert, yes, I thought so, that's why I put it on the agenda for tomorrow's meeting to discuss in more detail to figure out what needs to be done :) Best, Jörn On 4/1/2014 7:19 PM, Robert Oostenveld wrote: > Hi Jorn > > I was browsing the FT list and see that you got involved with this question from Tyler. I can imagine there being problems with a pipeline like this > > preprocessing -> componentanalysis -> timelockanalysis -> dipolefitting > > although it should (i.e. "is meant to") work by fitting dipoles to component topographies. But the code is not frequently used like this and it might be possible that there has been regression of the code (i.e bugs in the latest version that were not there before). > > With sourceanalysis it depends on the method. Covariance estimates between components does not make much sense in the further inversion, and thereby beamforming won’t work. MNE should in principle work, but not with an estimated data covariance but rather a scaled identity covariance. > > Given the uncertain level of support , but clear expectations on what should (and should not) work, I suggest to file it as “bug” (i.e. the issue is that it should be tested) and to write a test script that goes (with e.g. some simulated data) over the various options. > > best regards, > Robert > > > On 01 Apr 2014, at 17:16, Jörn M. Horschig wrote: > >> Hi Tyler, >> >> any reason why you don't want to go back to sensor-space but stay in component-space with your data? I would assume that the error will be gone if you use the back-projected data (ft_rejectcomponent, with cfg.component = []). >> >> Best, >> Jörn >> >> On 4/1/2014 8:15 AM, Tyler Grummett wrote: >>> Hey Jorn, >>> >>> In addition to my previous emails, Ive been trying to debug the functions. >>> >>> In ft_sourceanalysis, line 661 to 677: >>> >>> % HACK: use the default code >>> % select the channels of interest >>> [dum, datchanindx] = match_str(cfg.channel, data.label); >>> if strcmp(data.dimord, 'chan_time') >>> % It is in principle possible to have timelockanalysis with >>> % keeptrial=yes and only a single trial in the raw data. >>> % In that case the covariance should be represented as Nchan*Nchan >>> data.avg = data.avg(datchanindx,:); >>> %data.cov = reshape(data.cov, length(datchanindx), length(datchanindx)); >>> data.cov = data.cov(datchanindx,datchanindx); >>> else >>> data.avg = data.avg(datchanindx,:); >>> data.cov = data.cov(:,datchanindx,datchanindx); >>> data.trial = data.trial(:,datchanindx,:); >>> end >>> data.label = data.label(datchanindx); >>> Nchans = length(data.label); >>> >>> I found that my cfg.channel is []; and the data.label is all my ICA components labelled ica_001 etc. >>> >>> So it is returned as a []; >>> which means data.cov = []; >>> >>> I think then it will crash later parts of the code. Does this function work on ICA components? >>> >>> I ran the ICA in eeglab. >>> >>> Tyler. >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" >>> Sent: Tuesday, 1 April 2014 1:42 AM >>> To: fieldtrip at science.ru.nl >>> Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot >>> >>> just to clarify and be precise >>>> The pos-matrix has to be a regular 3D grid, i.e. be representable as a >>>> 3x3x3 matrix. >>> it actually does not have to be as you can also beam individual grid >>> points, but if you have a .dim field, then is has to be like above. But >>> that does not affect the rest of the mail I wrote ;) >>> >>> >>>> I am not quite sure how the sourceinterpolate function is handeling >>>> the fact that you do not have that .dim field. Apparently, it is also >>>> confused ;) >>>> >>>> Do you want to reconstruct only some voxels? From your code it seems >>>> that you want to cover the whole brain with a 1cm resolution. If the >>>> latter is the case, maybe restart with creating your forward model by >>>> following the tutorial that I posted in my previous mail. There are >>>> some sanity checks that can help you figuring out if you are doing the >>>> correct thing. If the former one is the case, please explain again >>>> what exactly you want to achieve and how you are building your forward >>>> model. >>>> >>>> Best, >>>> Jörn >>>> >>>> btw, there's nothing wrong with being a PhD student, it's just a >>>> matter of experience in practice and theory as in all domains in life ;) >>>> >>>> >>>> On 3/31/2014 3:15 PM, Tyler Grummett wrote: >>>>> Hey Jorn, >>>>> >>>>> Yes I am definitely confused haha, this stuff is way out of my league >>>>> as a PhD student. >>>>> Anyway, I feel we are getting somewhere. >>>>> >>>>> timelock = >>>>> >>>>> avg: [121x19767 double] >>>>> var: [121x19767 double] >>>>> time: [1x19767 double] >>>>> dof: [121x19767 double] >>>>> label: {1x121 cell} >>>>> dimord: 'chan_time' >>>>> cov: [121x121 double] >>>>> elec: [1x1 struct] >>>>> cfg: [1x1 struct] >>>>> >>>>> source = >>>>> >>>>> time: [1x19767 double] >>>>> pos: [642x3 double] >>>>> inside: [642x1 double] >>>>> outside: [] >>>>> method: 'average' >>>>> avg: [1x1 struct] >>>>> cfg: [1x1 struct] >>>>> >>>>> sourceInt = >>>>> >>>>> time: [1x19767 double] >>>>> avg: [1x1 struct] >>>>> pos: [16777216x3 double] >>>>> dim: [256 256 256] >>>>> inside: [1x16777216 double] >>>>> outside: [1x0 double] >>>>> coordsys: 'ctf' >>>>> unit: 'mm' >>>>> cfg: [1x1 struct] >>>>> >>>>> Given what I said last time, I might not comment on the differences. >>>>> I hope you can see something wrong. >>>>> >>>>> One thing I should mention is that the data is continuous, around 30 >>>>> seconds. Therefore there is only one trial, >>>>> is that an issue? >>>>> >>>>> Tyler >>>>> >>>>> ************************* >>>>> >>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>> PhD Candidate >>>>> Brain Signals Laboratory >>>>> Flinders University >>>>> Rm 5A301 >>>>> Ext 66124 >>>>> >>>>> ________________________________________ >>>>> From: fieldtrip-bounces at science.ru.nl >>>>> on behalf of "Jörn M. Horschig" >>>>> >>>>> Sent: Monday, 31 March 2014 10:24 PM >>>>> To: FieldTrip discussion list >>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>> ft_sourceplot >>>>> >>>>> Hi Tyler, >>>>> >>>>> there is not much inherently different between time- and >>>>> freuqency-domain beamformer, at least in terms of computing the forward >>>>> and the inverse solution. But I see that you are obviously confused, so >>>>> let me try to help you out and shed some light on what you are actually >>>>> doing ;) >>>>> >>>>> >>>>>> I had a look at my variables. >>>>>> >>>>>> source.avg = >>>>>> >>>>>> pow: [642x1 double] >>>>>> filter: {642x1 cell} >>>>>> >>>>>> sourceInt.avg = >>>>>> >>>>>> pow: [16777216x1 double] >>>>>> >>>>>> So clearly, as both variables are completely different. Something >>>>>> has gone wrong. >>>>> No, that is actually how it should be. From below you can see that your >>>>> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >>>>> 16777216 elements. In line with source.avg.pow, you should see that your >>>>> 'grid' consists of 642 elements, so you were computing your source >>>>> activity on a grid of in total 642 elements. Then you used the original >>>>> MRI to interpolate from 642 to these 16 million grid points. Actually, >>>>> since you specific cfg.downsample = 2, it should have been only 8 >>>>> million points, so that's where things already get a bit weird. >>>>> >>>>> So let's go into some sanity checks: >>>>> 1. are you using the latest version (or a recent, i.e. from this year) >>>>> of FielTrip? >>>>> 2. sourceInt should look something like this, does it? >>>>> >>>>> source_diff_int = >>>>> inside: [46x55x46 logical] >>>>> avg: [1x1 struct] >>>>> dim: [46 55 46] >>>>> transform: [4x4 double] >>>>> anatomy: [46x55x46 double] >>>>> unit: 'mm' >>>>> cfg: [1x1 struct] >>>>> >>>>> >>>>> >>>>> 3. source should look something like this: >>>>> >>>>> source = >>>>> dim: [20 25 22] >>>>> freq: 54.8287 >>>>> cumtapcnt: [338x1 double] >>>>> pos: [11000x3 double] >>>>> inside: [1x5798 double] >>>>> outside: [1x5202 double] >>>>> method: 'average' >>>>> avg: [1x1 struct] >>>>> trialinfo: [338x1 double] >>>>> cfg: [1x1 struct] >>>>> >>>>> 4. also check your grid, should be something like this: >>>>> >>>>> sourcemodel = >>>>> >>>>> pos: [11000x3 double] >>>>> dim: [20 25 22] >>>>> unit: 'cm' >>>>> inside: [1x5798 double] >>>>> outside: [1x5202 double] >>>>> params: [1x1 struct] >>>>> initial: [4x4 double] >>>>> cfg: [1x1 struct] >>>>> >>>>> >>>>> Of course, it should all look a bit different, because you are using >>>>> LCMV, but essentially it should be the same. Lastly, you can check other >>>>> source plotting methods, like 'ortho' or try to plot the source >>>>> structure rather than the sourceInt structure. In the end, the error >>>>> must be somewhere in your grid, be it in .pos or .inside, because >>>>> FieldTrip thinks that there is only one voxel to be plotted. There are >>>>> other things that may be the issue, but I am not sure about these. So, I >>>>> would suggest that you play a bit around and see where the error might >>>>> come from (e.g. follow this tutorial: >>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >>>>> steps that you need for LCMV, maybe also check out: >>>>> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >>>>> >>>>> there, LCMV is used, but on one voxel only) >>>>> >>>>> Best, >>>>> Jörn >>>>> >>>>>> The next part of my code is the following: >>>>>> >>>>>> % interpolate sources >>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>> mri = ft_volumereslice([], mri); >>>>>> >>>>>> cfg = []; >>>>>> cfg.downsample = 2; >>>>>> cfg.parameter = 'avg.pow'; >>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>> parameter >>>>>> % does not vary over time, therefore the time >>>>>> dimension is not needed. >>>>>> >>>>>> mri = >>>>>> >>>>>> anatomy: [256x256x256 double] >>>>>> dim: [256 256 256] >>>>>> transform: [4x4 double] >>>>>> coordsys: 'ctf' >>>>>> unit: 'mm' >>>>>> cfg: [1x1 struct] >>>>>> >>>>>> I cant really see if the data works in the tutorial because it >>>>>> doesnt appear as though fieldtrip has a tutorial on lcmv >>>>>> beamformers, they seem to stick to frequency domain beamformers. >>>>>> >>>>>> Ive been wrong before though, >>>>>> >>>>>> thanks for your help. >>>>>> >>>>>> Tyler >>>>>> >>>>>> ************************* >>>>>> >>>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>>> PhD Candidate >>>>>> Brain Signals Laboratory >>>>>> Flinders University >>>>>> Rm 5A301 >>>>>> Ext 66124 >>>>>> >>>>>> ________________________________________ >>>>>> From: fieldtrip-bounces at science.ru.nl >>>>>> on behalf of "Jörn M. Horschig" >>>>>> >>>>>> Sent: Monday, 31 March 2014 7:13 PM >>>>>> To: FieldTrip discussion list >>>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>>> ft_sourceplot >>>>>> >>>>>> Hi Tyler, >>>>>> >>>>>> hm, okay, it could be that the issue with the leadfield and with the >>>>>> plot are related, but it could also be that they are separate issues. I >>>>>> just saw that you posted the same 'problem' on bugzilla and included a >>>>>> picture. Maybe for next time, include a picture on the mailinglist and >>>>>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>>>>> and not if you are not sure. That saves us a lot of time in separating >>>>>> code issues from user problems ;) >>>>>> >>>>>> So, back to you problem. It seems that your reconstruction results in >>>>>> one voxel only. Are you sure that your grid consistents of more than >>>>>> just one position? So, for example check the size of the matrices in >>>>>> source.avg, source- and headmodel, etc. >>>>>> >>>>>> Also, you can check in Matlab the respective fields of source and >>>>>> sourceInt and see whether that makes sense. >>>>>> >>>>>> Lastly, a neat way to check is always to use your code on data from the >>>>>> tutorial, and vice versa, use code from the tutorial on your data and >>>>>> see whether that works. Both should give sensible results, and if one >>>>>> does not, you know where to start looking for a solution ;) >>>>>> >>>>>> Best, >>>>>> Jörn >>>>>> >>>>>> >>>>>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>>>>> Hey Jorn, >>>>>>> >>>>>>> Previously I have let ft_sourceanalysis do a lead field because if >>>>>>> I use the following code: >>>>>>> >>>>>>> % compute lead field ( apparently source analysis computes >>>>>>> % lead field anyway >>>>>>> cfg = []; >>>>>>> cfg.elec = timelock.elec; >>>>>>> cfg.vol = vol; >>>>>>> cfg.reducerank = 3; >>>>>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>>>>> cm resolution >>>>>>> cfg.grid.unit = 'cm'; >>>>>>> cfg.normalize = 'yes'; % if you are not >>>>>>> contrasting the activity of interest again another condition or >>>>>>> baseline time-window >>>>>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>>>>> I AM UP TO >>>>>>> >>>>>>> and then calculate the source analysis: >>>>>>> >>>>>>> % Source Analysis: without contrasting condition >>>>>>> cfg = []; >>>>>>> cfg.method = 'lcmv'; >>>>>>> cfg.grid = grid; >>>>>>> cfg.vol = vol; >>>>>>> % cfg.grid.pos = maxpos; >>>>>>> cfg.keepfilter = 'yes'; >>>>>>> cfg.dics.projectnoise = 'yes'; >>>>>>> % cfg.dics.lambda = 0; >>>>>>> source = ft_sourceanalysis( cfg, timelock); >>>>>>> >>>>>>> then I get an error than says: >>>>>>> >>>>>>> Error using * >>>>>>> Inner matrix dimensions must agree. >>>>>>> >>>>>>> Error in beamformer_lcmv (line 268) >>>>>>> filt = pinv(lf' * invCy * lf) * lf' * >>>>>>> invCy; % van Veen eqn. 23, use >>>>>>> PINV/SVD to cover rank deficient leadfield >>>>>>> >>>>>>> Error in ft_sourceanalysis (line 794) >>>>>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>>>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>>>>> optarg{:}); >>>>>>> >>>>>>> I just removed the leadfield code and it successfully ran. I could >>>>>>> also interpolate it later. >>>>>>> Is this the correct approach. >>>>>>> >>>>>>> Thankyou in advance! >>>>>>> >>>>>>> Tyler >>>>>>> >>>>>>> ************************* >>>>>>> >>>>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>>>> PhD Candidate >>>>>>> Brain Signals Laboratory >>>>>>> Flinders University >>>>>>> Rm 5A301 >>>>>>> Ext 66124 >>>>>>> >>>>>>> ________________________________________ >>>>>>> From: fieldtrip-bounces at science.ru.nl >>>>>>> on behalf of "Jörn M. Horschig" >>>>>>> >>>>>>> Sent: Monday, 31 March 2014 5:30 PM >>>>>>> To: FieldTrip discussion list >>>>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>>>> ft_sourceplot >>>>>>> >>>>>>> Hi Tyler, >>>>>>> >>>>>>> what you are describing sounds to me like the center bias of the >>>>>>> beamformer. Did you contrast the activity with anything, or did you >>>>>>> normalize your leadfield? >>>>>>> Check this out: >>>>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>>>>> >>>>>>> >>>>>>> Best, >>>>>>> Jörn >>>>>>> >>>>>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>>>>> I have been trying to plot my interpolated source data using the >>>>>>>> code: >>>>>>>> >>>>>>>> % interpolate sources >>>>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>>>> mri = ft_volumereslice([], mri); >>>>>>>> cfg = []; >>>>>>>> cfg.downsample = 2; >>>>>>>> cfg.parameter = 'avg.pow'; >>>>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>>>> parameter >>>>>>>> % does not vary over time, therefore the time >>>>>>>> dimension >>>>>>>> is not needed. >>>>>>>> >>>>>>>> % Plot interpolated data >>>>>>>> cfg = []; %#ok >>>>>>>> cfg.method = 'ortho'; % spline >>>>>>>> cfg.funparameter = 'avg.pow'; >>>>>>>> ft_sourceplot( cfg, sourceInt); >>>>>>>> >>>>>>>> However the figure that comes up just had orange squares in the >>>>>>>> subplots. >>>>>>>> >>>>>>>> I dont know where Ive gone wrong. >>>>>>>> >>>>>>>> >>>>>>>> Tyler >>>>>>>> >>>>>>>> >>>>>>>> ************************* >>>>>>>> >>>>>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>>>>> /PhD Candidate/ >>>>>>>> /Brain Signals Laboratory/ >>>>>>>> /Flinders University/ >>>>>>>> /Rm 5A301/ >>>>>>>> /Ext 66124/ >>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> fieldtrip mailing list >>>>>>>> fieldtrip at donders.ru.nl >>>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> -- >>>>>>> Jörn M. Horschig >>>>>>> PhD Student >>>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>>> Centre for Cognitive Neuroimaging >>>>>>> Radboud University Nijmegen >>>>>>> Neuronal Oscillations Group >>>>>>> FieldTrip Development Team >>>>>>> >>>>>>> P.O. Box 9101 >>>>>>> NL-6500 HB Nijmegen >>>>>>> The Netherlands >>>>>>> >>>>>>> Contact: >>>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>>> Tel: +31-(0)24-36-68493 >>>>>>> Web: http://www.ru.nl/donders >>>>>>> >>>>>>> Visiting address: >>>>>>> Trigon, room 2.30 >>>>>>> Kapittelweg 29 >>>>>>> NL-6525 EN Nijmegen >>>>>>> The Netherlands >>>>>>> >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> -- >>>>>> Jörn M. Horschig >>>>>> PhD Student >>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>> Centre for Cognitive Neuroimaging >>>>>> Radboud University Nijmegen >>>>>> Neuronal Oscillations Group >>>>>> FieldTrip Development Team >>>>>> >>>>>> P.O. Box 9101 >>>>>> NL-6500 HB Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> Contact: >>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>> Tel: +31-(0)24-36-68493 >>>>>> Web: http://www.ru.nl/donders >>>>>> >>>>>> Visiting address: >>>>>> Trigon, room 2.30 >>>>>> Kapittelweg 29 >>>>>> NL-6525 EN Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> -- >>>>> Jörn M. Horschig >>>>> PhD Student >>>>> Donders Institute for Brain, Cognition and Behaviour >>>>> Centre for Cognitive Neuroimaging >>>>> Radboud University Nijmegen >>>>> Neuronal Oscillations Group >>>>> FieldTrip Development Team >>>>> >>>>> P.O. Box 9101 >>>>> NL-6500 HB Nijmegen >>>>> The Netherlands >>>>> >>>>> Contact: >>>>> E-Mail: jm.horschig at donders.ru.nl >>>>> Tel: +31-(0)24-36-68493 >>>>> Web: http://www.ru.nl/donders >>>>> >>>>> Visiting address: >>>>> Trigon, room 2.30 >>>>> Kapittelweg 29 >>>>> NL-6525 EN Nijmegen >>>>> The Netherlands >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From tyler.grummett at flinders.edu.au Tue Apr 1 23:06:40 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 1 Apr 2014 21:06:40 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <533B22CA.8040305@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>, <533985D8.4080504@donders.ru.nl> <533AD84B.6060600@donders.ru.nl> , <533B22CA.8040305@donders.ru.nl> Message-ID: Hello jorn and robert, The plan is to use the data for functional connectivity. The only alternative we seem to have is dipole fitting in eeglab and then clustering. However we thought that if we used beamformer we would have many more sources to be able to run functional connectivity algorithms. I'm sorry of this has become an issue, what do you advise? Tyler > On 2 Apr 2014, at 7:06 am, "Jörn M. Horschig" wrote: > > Hi Robert, > > yes, I thought so, that's why I put it on the agenda for tomorrow's meeting to discuss in more detail to figure out what needs to be done :) > > Best, > Jörn > >> On 4/1/2014 7:19 PM, Robert Oostenveld wrote: >> Hi Jorn >> >> I was browsing the FT list and see that you got involved with this question from Tyler. I can imagine there being problems with a pipeline like this >> >> preprocessing -> componentanalysis -> timelockanalysis -> dipolefitting >> >> although it should (i.e. "is meant to") work by fitting dipoles to component topographies. But the code is not frequently used like this and it might be possible that there has been regression of the code (i.e bugs in the latest version that were not there before). >> >> With sourceanalysis it depends on the method. Covariance estimates between components does not make much sense in the further inversion, and thereby beamforming won’t work. MNE should in principle work, but not with an estimated data covariance but rather a scaled identity covariance. >> >> Given the uncertain level of support , but clear expectations on what should (and should not) work, I suggest to file it as “bug” (i.e. the issue is that it should be tested) and to write a test script that goes (with e.g. some simulated data) over the various options. >> >> best regards, >> Robert >> >>> On 01 Apr 2014, at 17:16, Jörn M. Horschig wrote: >>> >>> Hi Tyler, >>> >>> any reason why you don't want to go back to sensor-space but stay in component-space with your data? I would assume that the error will be gone if you use the back-projected data (ft_rejectcomponent, with cfg.component = []). >>> >>> Best, >>> Jörn >>> >>>> On 4/1/2014 8:15 AM, Tyler Grummett wrote: >>>> Hey Jorn, >>>> >>>> In addition to my previous emails, Ive been trying to debug the functions. >>>> >>>> In ft_sourceanalysis, line 661 to 677: >>>> >>>> % HACK: use the default code >>>> % select the channels of interest >>>> [dum, datchanindx] = match_str(cfg.channel, data.label); >>>> if strcmp(data.dimord, 'chan_time') >>>> % It is in principle possible to have timelockanalysis with >>>> % keeptrial=yes and only a single trial in the raw data. >>>> % In that case the covariance should be represented as Nchan*Nchan >>>> data.avg = data.avg(datchanindx,:); >>>> %data.cov = reshape(data.cov, length(datchanindx), length(datchanindx)); >>>> data.cov = data.cov(datchanindx,datchanindx); >>>> else >>>> data.avg = data.avg(datchanindx,:); >>>> data.cov = data.cov(:,datchanindx,datchanindx); >>>> data.trial = data.trial(:,datchanindx,:); >>>> end >>>> data.label = data.label(datchanindx); >>>> Nchans = length(data.label); >>>> >>>> I found that my cfg.channel is []; and the data.label is all my ICA components labelled ica_001 etc. >>>> >>>> So it is returned as a []; >>>> which means data.cov = []; >>>> >>>> I think then it will crash later parts of the code. Does this function work on ICA components? >>>> >>>> I ran the ICA in eeglab. >>>> >>>> Tyler. >>>> >>>> ************************* >>>> >>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>> PhD Candidate >>>> Brain Signals Laboratory >>>> Flinders University >>>> Rm 5A301 >>>> Ext 66124 >>>> >>>> ________________________________________ >>>> From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" >>>> Sent: Tuesday, 1 April 2014 1:42 AM >>>> To: fieldtrip at science.ru.nl >>>> Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot >>>> >>>> just to clarify and be precise >>>>> The pos-matrix has to be a regular 3D grid, i.e. be representable as a >>>>> 3x3x3 matrix. >>>> it actually does not have to be as you can also beam individual grid >>>> points, but if you have a .dim field, then is has to be like above. But >>>> that does not affect the rest of the mail I wrote ;) >>>> >>>> >>>>> I am not quite sure how the sourceinterpolate function is handeling >>>>> the fact that you do not have that .dim field. Apparently, it is also >>>>> confused ;) >>>>> >>>>> Do you want to reconstruct only some voxels? From your code it seems >>>>> that you want to cover the whole brain with a 1cm resolution. If the >>>>> latter is the case, maybe restart with creating your forward model by >>>>> following the tutorial that I posted in my previous mail. There are >>>>> some sanity checks that can help you figuring out if you are doing the >>>>> correct thing. If the former one is the case, please explain again >>>>> what exactly you want to achieve and how you are building your forward >>>>> model. >>>>> >>>>> Best, >>>>> Jörn >>>>> >>>>> btw, there's nothing wrong with being a PhD student, it's just a >>>>> matter of experience in practice and theory as in all domains in life ;) >>>>> >>>>> >>>>>> On 3/31/2014 3:15 PM, Tyler Grummett wrote: >>>>>> Hey Jorn, >>>>>> >>>>>> Yes I am definitely confused haha, this stuff is way out of my league >>>>>> as a PhD student. >>>>>> Anyway, I feel we are getting somewhere. >>>>>> >>>>>> timelock = >>>>>> >>>>>> avg: [121x19767 double] >>>>>> var: [121x19767 double] >>>>>> time: [1x19767 double] >>>>>> dof: [121x19767 double] >>>>>> label: {1x121 cell} >>>>>> dimord: 'chan_time' >>>>>> cov: [121x121 double] >>>>>> elec: [1x1 struct] >>>>>> cfg: [1x1 struct] >>>>>> >>>>>> source = >>>>>> >>>>>> time: [1x19767 double] >>>>>> pos: [642x3 double] >>>>>> inside: [642x1 double] >>>>>> outside: [] >>>>>> method: 'average' >>>>>> avg: [1x1 struct] >>>>>> cfg: [1x1 struct] >>>>>> >>>>>> sourceInt = >>>>>> >>>>>> time: [1x19767 double] >>>>>> avg: [1x1 struct] >>>>>> pos: [16777216x3 double] >>>>>> dim: [256 256 256] >>>>>> inside: [1x16777216 double] >>>>>> outside: [1x0 double] >>>>>> coordsys: 'ctf' >>>>>> unit: 'mm' >>>>>> cfg: [1x1 struct] >>>>>> >>>>>> Given what I said last time, I might not comment on the differences. >>>>>> I hope you can see something wrong. >>>>>> >>>>>> One thing I should mention is that the data is continuous, around 30 >>>>>> seconds. Therefore there is only one trial, >>>>>> is that an issue? >>>>>> >>>>>> Tyler >>>>>> >>>>>> ************************* >>>>>> >>>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>>> PhD Candidate >>>>>> Brain Signals Laboratory >>>>>> Flinders University >>>>>> Rm 5A301 >>>>>> Ext 66124 >>>>>> >>>>>> ________________________________________ >>>>>> From: fieldtrip-bounces at science.ru.nl >>>>>> on behalf of "Jörn M. Horschig" >>>>>> >>>>>> Sent: Monday, 31 March 2014 10:24 PM >>>>>> To: FieldTrip discussion list >>>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>>> ft_sourceplot >>>>>> >>>>>> Hi Tyler, >>>>>> >>>>>> there is not much inherently different between time- and >>>>>> freuqency-domain beamformer, at least in terms of computing the forward >>>>>> and the inverse solution. But I see that you are obviously confused, so >>>>>> let me try to help you out and shed some light on what you are actually >>>>>> doing ;) >>>>>> >>>>>> >>>>>>> I had a look at my variables. >>>>>>> >>>>>>> source.avg = >>>>>>> >>>>>>> pow: [642x1 double] >>>>>>> filter: {642x1 cell} >>>>>>> >>>>>>> sourceInt.avg = >>>>>>> >>>>>>> pow: [16777216x1 double] >>>>>>> >>>>>>> So clearly, as both variables are completely different. Something >>>>>>> has gone wrong. >>>>>> No, that is actually how it should be. From below you can see that your >>>>>> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >>>>>> 16777216 elements. In line with source.avg.pow, you should see that your >>>>>> 'grid' consists of 642 elements, so you were computing your source >>>>>> activity on a grid of in total 642 elements. Then you used the original >>>>>> MRI to interpolate from 642 to these 16 million grid points. Actually, >>>>>> since you specific cfg.downsample = 2, it should have been only 8 >>>>>> million points, so that's where things already get a bit weird. >>>>>> >>>>>> So let's go into some sanity checks: >>>>>> 1. are you using the latest version (or a recent, i.e. from this year) >>>>>> of FielTrip? >>>>>> 2. sourceInt should look something like this, does it? >>>>>> >>>>>> source_diff_int = >>>>>> inside: [46x55x46 logical] >>>>>> avg: [1x1 struct] >>>>>> dim: [46 55 46] >>>>>> transform: [4x4 double] >>>>>> anatomy: [46x55x46 double] >>>>>> unit: 'mm' >>>>>> cfg: [1x1 struct] >>>>>> >>>>>> >>>>>> >>>>>> 3. source should look something like this: >>>>>> >>>>>> source = >>>>>> dim: [20 25 22] >>>>>> freq: 54.8287 >>>>>> cumtapcnt: [338x1 double] >>>>>> pos: [11000x3 double] >>>>>> inside: [1x5798 double] >>>>>> outside: [1x5202 double] >>>>>> method: 'average' >>>>>> avg: [1x1 struct] >>>>>> trialinfo: [338x1 double] >>>>>> cfg: [1x1 struct] >>>>>> >>>>>> 4. also check your grid, should be something like this: >>>>>> >>>>>> sourcemodel = >>>>>> >>>>>> pos: [11000x3 double] >>>>>> dim: [20 25 22] >>>>>> unit: 'cm' >>>>>> inside: [1x5798 double] >>>>>> outside: [1x5202 double] >>>>>> params: [1x1 struct] >>>>>> initial: [4x4 double] >>>>>> cfg: [1x1 struct] >>>>>> >>>>>> >>>>>> Of course, it should all look a bit different, because you are using >>>>>> LCMV, but essentially it should be the same. Lastly, you can check other >>>>>> source plotting methods, like 'ortho' or try to plot the source >>>>>> structure rather than the sourceInt structure. In the end, the error >>>>>> must be somewhere in your grid, be it in .pos or .inside, because >>>>>> FieldTrip thinks that there is only one voxel to be plotted. There are >>>>>> other things that may be the issue, but I am not sure about these. So, I >>>>>> would suggest that you play a bit around and see where the error might >>>>>> come from (e.g. follow this tutorial: >>>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >>>>>> steps that you need for LCMV, maybe also check out: >>>>>> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >>>>>> >>>>>> there, LCMV is used, but on one voxel only) >>>>>> >>>>>> Best, >>>>>> Jörn >>>>>> >>>>>>> The next part of my code is the following: >>>>>>> >>>>>>> % interpolate sources >>>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>>> mri = ft_volumereslice([], mri); >>>>>>> >>>>>>> cfg = []; >>>>>>> cfg.downsample = 2; >>>>>>> cfg.parameter = 'avg.pow'; >>>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>>> parameter >>>>>>> % does not vary over time, therefore the time >>>>>>> dimension is not needed. >>>>>>> >>>>>>> mri = >>>>>>> >>>>>>> anatomy: [256x256x256 double] >>>>>>> dim: [256 256 256] >>>>>>> transform: [4x4 double] >>>>>>> coordsys: 'ctf' >>>>>>> unit: 'mm' >>>>>>> cfg: [1x1 struct] >>>>>>> >>>>>>> I cant really see if the data works in the tutorial because it >>>>>>> doesnt appear as though fieldtrip has a tutorial on lcmv >>>>>>> beamformers, they seem to stick to frequency domain beamformers. >>>>>>> >>>>>>> Ive been wrong before though, >>>>>>> >>>>>>> thanks for your help. >>>>>>> >>>>>>> Tyler >>>>>>> >>>>>>> ************************* >>>>>>> >>>>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>>>> PhD Candidate >>>>>>> Brain Signals Laboratory >>>>>>> Flinders University >>>>>>> Rm 5A301 >>>>>>> Ext 66124 >>>>>>> >>>>>>> ________________________________________ >>>>>>> From: fieldtrip-bounces at science.ru.nl >>>>>>> on behalf of "Jörn M. Horschig" >>>>>>> >>>>>>> Sent: Monday, 31 March 2014 7:13 PM >>>>>>> To: FieldTrip discussion list >>>>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>>>> ft_sourceplot >>>>>>> >>>>>>> Hi Tyler, >>>>>>> >>>>>>> hm, okay, it could be that the issue with the leadfield and with the >>>>>>> plot are related, but it could also be that they are separate issues. I >>>>>>> just saw that you posted the same 'problem' on bugzilla and included a >>>>>>> picture. Maybe for next time, include a picture on the mailinglist and >>>>>>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>>>>>> and not if you are not sure. That saves us a lot of time in separating >>>>>>> code issues from user problems ;) >>>>>>> >>>>>>> So, back to you problem. It seems that your reconstruction results in >>>>>>> one voxel only. Are you sure that your grid consistents of more than >>>>>>> just one position? So, for example check the size of the matrices in >>>>>>> source.avg, source- and headmodel, etc. >>>>>>> >>>>>>> Also, you can check in Matlab the respective fields of source and >>>>>>> sourceInt and see whether that makes sense. >>>>>>> >>>>>>> Lastly, a neat way to check is always to use your code on data from the >>>>>>> tutorial, and vice versa, use code from the tutorial on your data and >>>>>>> see whether that works. Both should give sensible results, and if one >>>>>>> does not, you know where to start looking for a solution ;) >>>>>>> >>>>>>> Best, >>>>>>> Jörn >>>>>>> >>>>>>> >>>>>>>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>>>>>> Hey Jorn, >>>>>>>> >>>>>>>> Previously I have let ft_sourceanalysis do a lead field because if >>>>>>>> I use the following code: >>>>>>>> >>>>>>>> % compute lead field ( apparently source analysis computes >>>>>>>> % lead field anyway >>>>>>>> cfg = []; >>>>>>>> cfg.elec = timelock.elec; >>>>>>>> cfg.vol = vol; >>>>>>>> cfg.reducerank = 3; >>>>>>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>>>>>> cm resolution >>>>>>>> cfg.grid.unit = 'cm'; >>>>>>>> cfg.normalize = 'yes'; % if you are not >>>>>>>> contrasting the activity of interest again another condition or >>>>>>>> baseline time-window >>>>>>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>>>>>> I AM UP TO >>>>>>>> >>>>>>>> and then calculate the source analysis: >>>>>>>> >>>>>>>> % Source Analysis: without contrasting condition >>>>>>>> cfg = []; >>>>>>>> cfg.method = 'lcmv'; >>>>>>>> cfg.grid = grid; >>>>>>>> cfg.vol = vol; >>>>>>>> % cfg.grid.pos = maxpos; >>>>>>>> cfg.keepfilter = 'yes'; >>>>>>>> cfg.dics.projectnoise = 'yes'; >>>>>>>> % cfg.dics.lambda = 0; >>>>>>>> source = ft_sourceanalysis( cfg, timelock); >>>>>>>> >>>>>>>> then I get an error than says: >>>>>>>> >>>>>>>> Error using * >>>>>>>> Inner matrix dimensions must agree. >>>>>>>> >>>>>>>> Error in beamformer_lcmv (line 268) >>>>>>>> filt = pinv(lf' * invCy * lf) * lf' * >>>>>>>> invCy; % van Veen eqn. 23, use >>>>>>>> PINV/SVD to cover rank deficient leadfield >>>>>>>> >>>>>>>> Error in ft_sourceanalysis (line 794) >>>>>>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>>>>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>>>>>> optarg{:}); >>>>>>>> >>>>>>>> I just removed the leadfield code and it successfully ran. I could >>>>>>>> also interpolate it later. >>>>>>>> Is this the correct approach. >>>>>>>> >>>>>>>> Thankyou in advance! >>>>>>>> >>>>>>>> Tyler >>>>>>>> >>>>>>>> ************************* >>>>>>>> >>>>>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>>>>> PhD Candidate >>>>>>>> Brain Signals Laboratory >>>>>>>> Flinders University >>>>>>>> Rm 5A301 >>>>>>>> Ext 66124 >>>>>>>> >>>>>>>> ________________________________________ >>>>>>>> From: fieldtrip-bounces at science.ru.nl >>>>>>>> on behalf of "Jörn M. Horschig" >>>>>>>> >>>>>>>> Sent: Monday, 31 March 2014 5:30 PM >>>>>>>> To: FieldTrip discussion list >>>>>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>>>>> ft_sourceplot >>>>>>>> >>>>>>>> Hi Tyler, >>>>>>>> >>>>>>>> what you are describing sounds to me like the center bias of the >>>>>>>> beamformer. Did you contrast the activity with anything, or did you >>>>>>>> normalize your leadfield? >>>>>>>> Check this out: >>>>>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>>>>>> >>>>>>>> >>>>>>>> Best, >>>>>>>> Jörn >>>>>>>> >>>>>>>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>>>>>> I have been trying to plot my interpolated source data using the >>>>>>>>> code: >>>>>>>>> >>>>>>>>> % interpolate sources >>>>>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>>>>> mri = ft_volumereslice([], mri); >>>>>>>>> cfg = []; >>>>>>>>> cfg.downsample = 2; >>>>>>>>> cfg.parameter = 'avg.pow'; >>>>>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>>>>> parameter >>>>>>>>> % does not vary over time, therefore the time >>>>>>>>> dimension >>>>>>>>> is not needed. >>>>>>>>> >>>>>>>>> % Plot interpolated data >>>>>>>>> cfg = []; %#ok >>>>>>>>> cfg.method = 'ortho'; % spline >>>>>>>>> cfg.funparameter = 'avg.pow'; >>>>>>>>> ft_sourceplot( cfg, sourceInt); >>>>>>>>> >>>>>>>>> However the figure that comes up just had orange squares in the >>>>>>>>> subplots. >>>>>>>>> >>>>>>>>> I dont know where Ive gone wrong. >>>>>>>>> >>>>>>>>> >>>>>>>>> Tyler >>>>>>>>> >>>>>>>>> >>>>>>>>> ************************* >>>>>>>>> >>>>>>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>>>>>> /PhD Candidate/ >>>>>>>>> /Brain Signals Laboratory/ >>>>>>>>> /Flinders University/ >>>>>>>>> /Rm 5A301/ >>>>>>>>> /Ext 66124/ >>>>>>>>> >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> fieldtrip mailing list >>>>>>>>> fieldtrip at donders.ru.nl >>>>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>>> -- >>>>>>>> Jörn M. Horschig >>>>>>>> PhD Student >>>>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>>>> Centre for Cognitive Neuroimaging >>>>>>>> Radboud University Nijmegen >>>>>>>> Neuronal Oscillations Group >>>>>>>> FieldTrip Development Team >>>>>>>> >>>>>>>> P.O. Box 9101 >>>>>>>> NL-6500 HB Nijmegen >>>>>>>> The Netherlands >>>>>>>> >>>>>>>> Contact: >>>>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>>>> Tel: +31-(0)24-36-68493 >>>>>>>> Web: http://www.ru.nl/donders >>>>>>>> >>>>>>>> Visiting address: >>>>>>>> Trigon, room 2.30 >>>>>>>> Kapittelweg 29 >>>>>>>> NL-6525 EN Nijmegen >>>>>>>> The Netherlands >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> fieldtrip mailing list >>>>>>>> fieldtrip at donders.ru.nl >>>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>>> _______________________________________________ >>>>>>>> fieldtrip mailing list >>>>>>>> fieldtrip at donders.ru.nl >>>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> -- >>>>>>> Jörn M. Horschig >>>>>>> PhD Student >>>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>>> Centre for Cognitive Neuroimaging >>>>>>> Radboud University Nijmegen >>>>>>> Neuronal Oscillations Group >>>>>>> FieldTrip Development Team >>>>>>> >>>>>>> P.O. Box 9101 >>>>>>> NL-6500 HB Nijmegen >>>>>>> The Netherlands >>>>>>> >>>>>>> Contact: >>>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>>> Tel: +31-(0)24-36-68493 >>>>>>> Web: http://www.ru.nl/donders >>>>>>> >>>>>>> Visiting address: >>>>>>> Trigon, room 2.30 >>>>>>> Kapittelweg 29 >>>>>>> NL-6525 EN Nijmegen >>>>>>> The Netherlands >>>>>>> >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> -- >>>>>> Jörn M. Horschig >>>>>> PhD Student >>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>> Centre for Cognitive Neuroimaging >>>>>> Radboud University Nijmegen >>>>>> Neuronal Oscillations Group >>>>>> FieldTrip Development Team >>>>>> >>>>>> P.O. Box 9101 >>>>>> NL-6500 HB Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> Contact: >>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>> Tel: +31-(0)24-36-68493 >>>>>> Web: http://www.ru.nl/donders >>>>>> >>>>>> Visiting address: >>>>>> Trigon, room 2.30 >>>>>> Kapittelweg 29 >>>>>> NL-6525 EN Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> -- >>>> Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ittan at npsych.med.kyushu-u.ac.jp Wed Apr 2 06:38:02 2014 From: ittan at npsych.med.kyushu-u.ac.jp (=?iso-2022-jp?B?GyRCQ2ZCPDBsQkAbKEI=?=) Date: Wed, 2 Apr 2014 13:38:02 +0900 Subject: [FieldTrip] In BIOSEMI data format, baseline of each data much differ depending on channels Message-ID: <0038B093-BA65-4278-A2D9-936D8142C303@npsych.med.kyushu-u.ac.jp> Hi All, Now I try to read BIOSEMI data (.bdf format, 64ch) by using "ft_preprocessing", but I have one trouble. Baseline of each data much differ depending on channels. So, now I use cfg.demean as below script. cfg.trialdef.prestim = 0.5; % in seconds cfg.trialdef.poststim = 1; % in seconds cfg = ft_definetrial(cfg); cfg.demean='yes'; cfg.baselinewindow = [-0.1 0]; cfg.channel = {'Fp1' 'AF7' 'AF3' 'F1' 'F3' 'F5' 'F7' 'FT9' 'FT7' 'FC5' 'FC3' 'FC1' 'C1' 'C3' 'C5' 'T7' 'TP7'... 'CP5' 'CP3' 'CP1' 'P1' 'P3' 'P5' 'P7' 'P9' 'PO7' 'PO3' 'O1' 'Iz' 'Oz' 'POz' 'Pz' 'Fp2' 'AF8' 'AF4' 'Fz' 'F2'... 'F4' 'F6' 'F8' 'FT10' 'FT8' 'FC6' 'FC4' 'FC2' 'FCz' 'Cz' 'C2' 'C4' 'C6' 'T8' 'TP8' 'CP6' 'CP4' 'CP2' 'CPz' 'P2'... 'P4' 'P6' 'P8' 'P10' 'PO8' 'PO4' 'O2' 'PO9' 'PO10' }; cfd.reref=('yes'); cfg.refchannel=('all'); data = ft_preprocessing(cfg); But, I now focused on DC shift(Slow cortical potential <0.5Hz), so, I can't use cfg.demean and I'm looking for another method to solve this problem. Additionally, is this trouble( Baseline of each data much differ depending on channels.) common with BIOSEMI data format ? or is it due to our recording device? I woud appreciate if someone could advise or comment on how bests to go about this issue. Thanks. Itta Nakamura M.D. Kyushu-University Neuropsychiatry Department, Japan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jan.Hirschmann at med.uni-duesseldorf.de Wed Apr 2 09:42:10 2014 From: Jan.Hirschmann at med.uni-duesseldorf.de (Jan.Hirschmann at med.uni-duesseldorf.de) Date: Wed, 2 Apr 2014 07:42:10 +0000 Subject: [FieldTrip] PLV with DICS beamformer In-Reply-To: <003FC94A-3967-44F3-A0E2-BC813E99C4D8@cin.uni-tuebingen.de> References: <003FC94A-3967-44F3-A0E2-BC813E99C4D8@cin.uni-tuebingen.de> Message-ID: <33DD7D51F083DA488E69A067A5C39FBC8625F610@MAIL1-UKD.VMED.UKD> Hi Natalia, How are you? I didn't know you were fieldtripin', too. I can't really tell if your approach is correct, but I have some comments. First, to me it seems that the imaginary part of csd is not enough to calculate PLV. But then, I don't know the details of how you compute it. Second, the 3 orientations issue is commonly tackled by singular value decomposition rather than by averaging (see e.g. beamformer_dics.m). One can use svd to compute the orientation of maximum power, and I think one could adapt the code, e.g. to get the orientation of maximum phase difference. One straight-forward alternative I know of, is to extract source level time courses using the LCMV beamfomer. You can set cfg.projectmom='yes' to only get the direction of max. power. Then you could use ft_connectivityanalysis with cfg.method='plv' to get the phase locking values. Hope this helps, Jan Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Natalia Zaretskaya Gesendet: Dienstag, 1. April 2014 09:20 An: fieldtrip at science.ru.nl Betreff: [FieldTrip] PLV with DICS beamformer Dear FieldTrip experts, I would like to be able to compute the phase-locking value (Lachaux, 1999) using source data derived from disc beamformer. Right now I perform ft_sourceanalysis with cfg.method = 'dics'; cfg.refdip = [x y z]; cfg.rawtrial = 'yes'; cfg.keepcsd = 'yes'; cfg.grid.filter = source.avg.filter; % precomputed common filter for two conditions and then use the imaginary part of the single-trial cross-spectral densities to compute PLV "by hand". Cross-spectra at each position have a 3x3 format, so I compute the PLV for each dipole orientation pair and then average. I was wondering whether 1) the above procedure is technically correct and 2) whether there is a better, more efficient way to do it (I assume plv can be derived at the same step where source.avg.coh is computed?). Many thanks in advance! Best regards, Natalia Zaretskaya --- Dr. Natalia Zaretskaya Centre for Integrative Neuroscience Vision and Cognition Lab (AG Bartels) 72076 Tübingen, Germany natalia.zaretskaya at cin.uni-tuebingen.de phone: +49 7071 2989032 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ktyler at swin.edu.au Wed Apr 2 09:50:48 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Wed, 2 Apr 2014 07:50:48 +0000 Subject: [FieldTrip] problems with dipole fitting and anatomical alignment Message-ID: Hi All, I am having a great deal of difficulty accurately fitting dipoles. 'Dipoles' are ending up being shown outside the head...... This may be to do with problems in aligning the anatomical data with the sensors. I have used ft_volumerealign to fit the MRI to the neuromag coordinate system, so I am not sure where the problem is arising from. Any help or suggestions, especially from Neuromag users, much appreciated! Here is my code: mri = ft_read_mri('MRI.nii'); %% cfg=[]; cfg.method = 'interactive'; cfg.coordsys = 'neuromag'; mri_real = ft_volumerealign(cfg, mri); % Marked left and right fiducials along with naison %% cfg = []; cfg.coordsys='neuromag'; cfg.output = {'skullstrip' 'brain'}; seg = ft_volumesegment(cfg, mri_real); %% cfg = []; cfg.coordsys='neuromag'; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, seg); %Volume conduction model %% Plotting volume conduction model along with sensor positions. % When these are plotted, the volume conduction model does appear to be positioned too high in the sensors- see jpg vol = ft_convert_units(vol,'cm'); sens = grad;% 'grad' contains neuromag sensor info- taken from MEG data figure ft_plot_sens(sens, 'style', '*b'); hold on ft_plot_vol(vol); %% Fitting dipoles cfg=[]; cfg.numdipoles =1; cfg.latency = [0.05, 0.10]; cfg.vol = vol; %volume conduction model for the subject cfg.model = 'regional'; cfg.grad=grad;% 'grad' contains neuromag sensor info- taken from MEG data source = ft_dipolefitting(cfg, timelocked_data); %% make a plot of the location of the dipoles cfg = []; cfg.location = source.dip.pos* 10; % convert from cm to mm figure; ft_sourceplot(cfg, mri_real); Once again, any help or suggestions, especially from Neuromag users, much appreciated! Kaelasha Tyler -------------- next part -------------- An HTML attachment was scrubbed... URL: From poil.simonshlomo at gmail.com Wed Apr 2 11:44:42 2014 From: poil.simonshlomo at gmail.com (Simon-Shlomo Poil) Date: Wed, 2 Apr 2014 11:44:42 +0200 Subject: [FieldTrip] Import of Brainlab .sig files? Message-ID: Dear all, I have a problem importing .sig files from Brainlab to Matlab (I have .sig and .sts file for each recording). It seems that neither EEGLAB nor Fieldtrip supports import of these files. Does anybody have an idea of how to import these files to Matlab? Best regards, Simon-Shlomo Poil, Dr. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.rotonda at gmail.com Wed Apr 2 12:31:47 2014 From: marco.rotonda at gmail.com (Marco Rotonda) Date: Wed, 2 Apr 2014 12:31:47 +0200 Subject: [FieldTrip] Statistics on ratio frequencies Message-ID: Hi all, I would like to compute a simple alpha-theta ratio and do some statistics on it. I had my data from freqanalysis. Then I averaged with selectdata_new to have the mean for a band. Then the simple ratio for each channel. If now I call freqstatistics I have an error. Any suggestion? Thanks Marco -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Wed Apr 2 12:39:21 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 02 Apr 2014 12:39:21 +0200 Subject: [FieldTrip] Statistics on ratio frequencies In-Reply-To: References: Message-ID: <533BE8D9.6000502@donders.ru.nl> Hi Marco, could you be more specific, in the style of e.g. http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community#how_to_ask_a_questio ? Best, Jörn On 4/2/2014 12:31 PM, Marco Rotonda wrote: > Hi all, > I would like to compute a simple alpha-theta ratio and do some > statistics on it. > I had my data from freqanalysis. > Then I averaged with selectdata_new to have the mean for a band. > Then the simple ratio for each channel. > If now I call freqstatistics I have an error. > Any suggestion? > > Thanks > > Marco > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jan.schoffelen at donders.ru.nl Wed Apr 2 12:42:56 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Wed, 2 Apr 2014 12:42:56 +0200 Subject: [FieldTrip] Statistics on ratio frequencies In-Reply-To: References: Message-ID: <7DC258EF-0DD9-44BD-B0D6-F699575772C2@donders.ru.nl> Not if you don't provide us with some more input. Jan-Mathijs On Apr 2, 2014, at 12:31 PM, Marco Rotonda wrote: > Hi all, > I would like to compute a simple alpha-theta ratio and do some statistics on it. > I had my data from freqanalysis. > Then I averaged with selectdata_new to have the mean for a band. > Then the simple ratio for each channel. > If now I call freqstatistics I have an error. > Any suggestion? > > Thanks > > Marco > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.rotonda at gmail.com Wed Apr 2 12:52:18 2014 From: marco.rotonda at gmail.com (Marco Rotonda) Date: Wed, 2 Apr 2014 12:52:18 +0200 Subject: [FieldTrip] Statistics on ratio frequencies In-Reply-To: <7DC258EF-0DD9-44BD-B0D6-F699575772C2@donders.ru.nl> References: <7DC258EF-0DD9-44BD-B0D6-F699575772C2@donders.ru.nl> Message-ID: Sorry guys I attach the script I used: cfg = []; cfg.method = 'mtmfft'; cfg.taper = 'hanning'; cfg.foi = [4:1:8]; freqmw1theta = ft_freqanalysis(cfg, mw1); freqmw2theta = ft_freqanalysis(cfg, mw2); freqmw3theta = ft_freqanalysis(cfg, mw3); freqmw4theta = ft_freqanalysis(cfg, mw4); freqmw5theta = ft_freqanalysis(cfg, mw5); freqmw6theta = ft_freqanalysis(cfg, mw6); freqmw7theta = ft_freqanalysis(cfg, mw7); freqmwe1theta = ft_freqanalysis(cfg, mwe1); freqmwe2theta = ft_freqanalysis(cfg, mwe2); freqmwe3theta = ft_freqanalysis(cfg, mwe3); freqmwe4theta = ft_freqanalysis(cfg, mwe4); freqmwe5theta = ft_freqanalysis(cfg, mwe5); freqmwe6theta = ft_freqanalysis(cfg, mwe6); freqmwe7theta = ft_freqanalysis(cfg, mwe7); cfg = []; cfg.method = 'mtmfft'; cfg.taper = 'hanning'; cfg.foi = [8:1:12]; freqmw1alpha = ft_freqanalysis(cfg, mw1); freqmw2alpha = ft_freqanalysis(cfg, mw2); freqmw3alpha = ft_freqanalysis(cfg, mw3); freqmw4alpha = ft_freqanalysis(cfg, mw4); freqmw5alpha = ft_freqanalysis(cfg, mw5); freqmw6alpha = ft_freqanalysis(cfg, mw6); freqmw7alpha = ft_freqanalysis(cfg, mw7); freqmwe1alpha = ft_freqanalysis(cfg, mwe1); freqmwe2alpha = ft_freqanalysis(cfg, mwe2); freqmwe3alpha = ft_freqanalysis(cfg, mwe3); freqmwe4alpha = ft_freqanalysis(cfg, mwe4); freqmwe5alpha = ft_freqanalysis(cfg, mwe5); freqmwe6alpha = ft_freqanalysis(cfg, mwe6); freqmwe7alpha = ft_freqanalysis(cfg, mwe7); cfg = [ ]; cfg.parameter = 'powspctrm'; cfg.avgoverfreq = 'yes'; amw1 = ft_selectdata_new(cfg, freqmw1alpha); amw2 = ft_selectdata_new(cfg, freqmw2alpha); amw3 = ft_selectdata_new(cfg, freqmw3alpha); amw4 = ft_selectdata_new(cfg, freqmw4alpha); amw5 = ft_selectdata_new(cfg, freqmw5alpha); amw6 = ft_selectdata_new(cfg, freqmw6alpha); amw7 = ft_selectdata_new(cfg, freqmw7alpha); amwe1 = ft_selectdata_new(cfg, freqmwe1alpha); amwe2 = ft_selectdata_new(cfg, freqmwe2alpha); amwe3 = ft_selectdata_new(cfg, freqmwe3alpha); amwe4 = ft_selectdata_new(cfg, freqmwe4alpha); amwe5 = ft_selectdata_new(cfg, freqmwe5alpha); amwe6 = ft_selectdata_new(cfg, freqmwe6alpha); amwe7 = ft_selectdata_new(cfg, freqmwe7alpha); tmw1 = ft_selectdata_new(cfg, freqmw1theta); tmw2 = ft_selectdata_new(cfg, freqmw2theta); tmw3 = ft_selectdata_new(cfg, freqmw3theta); tmw4 = ft_selectdata_new(cfg, freqmw4theta); tmw5 = ft_selectdata_new(cfg, freqmw5theta); tmw6 = ft_selectdata_new(cfg, freqmw6theta); tmw7 = ft_selectdata_new(cfg, freqmw7theta); tmwe1 = ft_selectdata_new(cfg, freqmwe1theta); tmwe2 = ft_selectdata_new(cfg, freqmwe2theta); tmwe3 = ft_selectdata_new(cfg, freqmwe3theta); tmwe4 = ft_selectdata_new(cfg, freqmwe4theta); tmwe5 = ft_selectdata_new(cfg, freqmwe5theta); tmwe6 = ft_selectdata_new(cfg, freqmwe6theta); tmwe7 = ft_selectdata_new(cfg, freqmwe7theta); atmw1 = amw1; atmw2 = amw2; atmw3 = amw3; atmw4 = amw4; atmw5 = amw5; atmw6 = amw6; atmw7 = amw7; atmwe1 = amwe1; atmwe2 = amwe2; atmwe3 = amwe3; atmwe4 = amwe4; atmwe5 = amwe5; atmwe6 = amwe6; atmwe7 = amwe7; atmw1.powspctrm = amw1.powspctrm./tmw1.powspctrm; atmw2.powspctrm = amw2.powspctrm./tmw2.powspctrm; atmw3.powspctrm = amw3.powspctrm./tmw3.powspctrm; atmw4.powspctrm = amw4.powspctrm./tmw4.powspctrm; atmw5.powspctrm = amw5.powspctrm./tmw5.powspctrm; atmw6.powspctrm = amw6.powspctrm./tmw6.powspctrm; atmw7.powspctrm = amw7.powspctrm./tmw7.powspctrm; atmwe1.powspctrm = amwe1.powspctrm./tmwe1.powspctrm; atmwe2.powspctrm = amwe2.powspctrm./tmwe2.powspctrm; atmwe3.powspctrm = amwe3.powspctrm./tmwe3.powspctrm; atmwe4.powspctrm = amwe4.powspctrm./tmwe4.powspctrm; atmwe5.powspctrm = amwe5.powspctrm./tmwe5.powspctrm; atmwe6.powspctrm = amwe6.powspctrm./tmwe6.powspctrm; atmwe7.powspctrm = amwe7.powspctrm./tmwe7.powspctrm; cfg_neighb = []; cfg_neighb.method = 'distance'; neighbours = ft_prepare_neighbours(cfg_neighb, mwe1); ntrials = 7; cfg = []; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.parameter = 'powspctrm'; cfg.correctm = 'cluster'; cfg.template = 'easycapM11_neighb.mat'; cfg.neighbours = neighbours; cfg.numrandomization = 5000; cfg.avgoverfreq = 'yes'; cfg.alpha = 0.05; cfg.tail = 0; design = [ones(1,ntrials) ones(1,ntrials)*2]; cfg.design = design; cfg.uvar = 1; cfg.ivar = 2; statat = ft_freqstatistics(cfg, atmwe1, atmwe2, atmwe3, atmwe4, atmwe5,... atmwe6, atmwe7, atmw1, atmw2, atmw3, atmw4, atmw5,... atmw6, atmw7); the error I have is: Undefined function or variable "param". Error in seloverdim (line 57) for i = 1:numel(param) Error in ft_selectdata_old (line 601) if selectfoi, data = seloverdim(data, 'freq', selfoi, fb); end Error in ft_selectdata (line 45) [varargout{1:nargout}] = ft_selectdata_old(varargin{:}); Error in ft_freqstatistics (line 245) data = ft_selectdata(data, 'param', cfg.parameter, 'avgoverrpt', false, ... hope is more clear On 2 April 2014 12:42, jan-mathijs schoffelen wrote: > Not if you don't provide us with some more input. > Jan-Mathijs > > On Apr 2, 2014, at 12:31 PM, Marco Rotonda wrote: > > Hi all, > I would like to compute a simple alpha-theta ratio and do some statistics > on it. > I had my data from freqanalysis. > Then I averaged with selectdata_new to have the mean for a band. > Then the simple ratio for each channel. > If now I call freqstatistics I have an error. > Any suggestion? > > Thanks > > Marco > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From meschwe at gmail.com Wed Apr 2 14:49:49 2014 From: meschwe at gmail.com (Meike Schweisfurth) Date: Wed, 2 Apr 2014 14:49:49 +0200 Subject: [FieldTrip] warping from MNI to individual subjects In-Reply-To: <57CBCEA0-7232-44A9-A8B0-05588E4C2310@gmail.com> References: <57CBCEA0-7232-44A9-A8B0-05588E4C2310@gmail.com> Message-ID: Dear Julian! Thanks for your help! I guess it has been only a visualisation problem, it seems to be fine now! Thanks anyway! Meike 2014-04-01 15:12 GMT+02:00 Julian Keil : > Dear Meike, > > I'm not sure if this relates to your problem, but I had - possibly similar > - issues with the warped grid and the template being 90° rotated. > My problem was due to an error during the realignment of the MRI. > Did you check whether the realignment works and whether your different > coordinate systems make sense? > > Could you also maybe attach a picture of your exchanged axes? At least for > me it's hard to image how this looks. > > Best, > > Julian > > > ******************** > *Dr. Julian Keil* > > AG Multisensorische Integration > Psychiatrische Universitätsklinik > der Charité im St. Hedwig-Krankenhaus > Große Hamburger Straße 5-11, Raum E 307 > 10115 Berlin > > Telefon: +49-30-2311-1879 > Fax: +49-30-2311-2209 > > http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration > > Am 01.04.2014 um 14:12 schrieb Meike Schweisfurth: > > Dear Fieldtrippers! > As newbie I have another question, now concerning the warping from MNI to > individual subjects. > Using the below code (the first part almost entirely from > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space), > I get first the template and then apply the grid to the individual > subjects. > However, in later on analysis step it turned out that while the subjects > where nicely similar positioned, the template position is entirely > different, as it is was even axes were exchanged... > Does anybody know what could be the reason and how to change it? > Thanks for any suggestions! > Best, Meike > > > % NOTE: the path to the template file is user-specific > template = > ft_read_mri('fieldtrip/fieldtrip-20140316/external/spm8/templates/T1.nii'); > template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the > coordinate system > > % segment the template brain and construct a volume conduction model (i.e. > head model): this is needed > % for the inside/outside detection of voxels. > cfg = []; > template_seg = ft_volumesegment(cfg, template); > > cfg = []; > cfg.method = 'singleshell'; > template_vol = ft_prepare_headmodel(cfg, template_seg); > template_vol = ft_convert_units(template_vol, 'cm'); % Convert the vol to > cm, since the grid will also be expressed in cm > > % construct the dipole grid in the template brain coordinates > % the source units are in cm > % the negative inwardshift means an outward shift of the brain surface for > inside/outside detection > cfg = []; > cfg.grid.xgrid = -20:1:20; > cfg.grid.ygrid = -20:1:20; > cfg.grid.zgrid = -20:1:20; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > cfg.inwardshift = -1.5; > cfg.vol = template_vol; > template_grid = ft_prepare_sourcemodel(cfg); > save('../analysis/MEG/source_analysis/MNI','template_grid','template_vol','template_seg','template') > > % make a figure with the template head model and dipole grid > figure > hold on > ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', > 'none');alpha 0.5; camlight; > ft_plot_mesh(template_grid.pos(template_grid.inside,:)); > else > load('../analysis/MEG/source_analysis/MNI','template_grid','template_vol','template_seg','template') > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > SUBJECTS={ 'VP02' 'VP03' 'VP04' 'VP05' 'VP06' > 'VP07' 'VP08' 'VP09' 'VP11' 'VP12' 'VP13' 'VP14' > 'VP15' 'VP16' 'VP17' 'VP18'} > > for SUBJI=SUBJECTS > SUBJ=SUBJI{1}; > % read the single subject anatomical MRI > load(['..*/analysis/MEG/source_analysis/*',SUBJ,'/mri']); %Has been > processed to CFT coordinates before > load(['..*/analysis/MEG/source_analysis/*',SUBJ,'/segmentedmri']); > > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > % create the subject specific grid, using the template grid that has just > been created > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template_grid; > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > cfg.mri = mri_ra; > grid = ft_prepare_sourcemodel(cfg); > > % make a figure of the single subject headmodel, and grid positions > figure; > ft_plot_vol(vol, 'edgecolor', 'none'); alpha 0.4; %camlight > ft_plot_mesh(grid.pos(grid.inside,:)); > > save(['..*/analysis/MEG/source_analysis/*',SUBJ,'/MNIgrid'],'grid','vol') > end > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nkrishna at mprc.umaryland.edu Wed Apr 2 16:23:01 2014 From: nkrishna at mprc.umaryland.edu (Nithin Krishna) Date: Wed, 2 Apr 2014 10:23:01 -0400 Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data References: <533BE8D9.6000502@donders.ru.nl> Message-ID: <20140402T102301Z_155300170001@mprc.umaryland.edu> Dear All, I read the tutorial section on Cluster-based permutation tests on time-frequency data as well as the Maris and Oostenveld, Journal of Neuroscience Methods, 2007 report. I am interested in setting up a ERP experiment on EEG data in this regard I like the procedure and processing section of the tutorial, however I would like to know if there is any section for EEG, I understand that megplanar is specific for MEG. Also is it possible to use 3D matrix (TFR) (time, Freq channels ) non feild trip output to run the cluster based permutation tests. Looking forward Nithin >>> "Jörn M. Horschig" 4/2/2014 6:39 AM >>> Hi Marco, could you be more specific, in the style of e.g. http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community#how_to_ask_a_questio ? Best, Jörn On 4/2/2014 12:31 PM, Marco Rotonda wrote: > Hi all, > I would like to compute a simple alpha-theta ratio and do some > statistics on it. > I had my data from freqanalysis. > Then I averaged with selectdata_new to have the mean for a band. > Then the simple ratio for each channel. > If now I call freqstatistics I have an error. > Any suggestion? > > Thanks > > Marco > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Wed Apr 2 16:39:14 2014 From: n.lam at fcdonders.ru.nl (Lam, Nietzsche) Date: Wed, 2 Apr 2014 16:39:14 +0200 (CEST) Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data In-Reply-To: <20140402T102301Z_155300170001@mprc.umaryland.edu> Message-ID: <463655257.1716412.1396449554295.JavaMail.root@indus.zimbra.ru.nl> Dear Nithin, FieldTrip was primarily set up for MEG data but we definitely have several tutorials discussing similar procedures for EEG data. Perhaps these tutorials can help you out. http://fieldtrip.fcdonders.nl/tutorial/eeg_preprocessing_erp http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock http://fieldtrip.fcdonders.nl/tutorial/eventrelatedstatistics Although these later two links are performed on MEG data, I think they are useful to you because functions used to calculate ERFs are also used for ERPs. For example, in FieldTrip you can use ft_timelockanalysis and ft_timelockstatistics for both EEG and MEG data. Regarding the use of non-FieldTrip data for cluster-permutations. Theoretically, I think it is possible, but probably more experienced users can answer this. Nevertheless, you could look into this FAQ about how to import your data so that it ca be used by FieldTrip here: http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat?s[]=import&s[]=data best, Nietzsche ----- Original Message ----- > From: "Nithin Krishna" > To: "FieldTrip discussion list" > Sent: Wednesday, 2 April, 2014 4:23:01 PM > Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data > Dear All, > I read the tutorial section on Cluster-based permutation tests on > time-frequency data as well as the Maris and Oostenveld, Journal of > Neuroscience Methods, 2007 report. I am interested in setting up a ERP > experiment on EEG data in this regard I like the procedure and > processing section of the tutorial, however I would like to know if > there is any section for EEG, I understand that megplanar is specific > for MEG. > Also is it possible to use 3D matrix (TFR) (time, Freq channels ) non > feild trip output to run the cluster based permutation tests. > Looking forward > Nithin > > > >>> "Jörn M. Horschig" 4/2/2014 6:39 AM >>> > > Hi Marco, > > could you be more specific, in the style of e.g. > http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community#how_to_ask_a_questio > ? > > Best, > Jörn > > On 4/2/2014 12:31 PM, Marco Rotonda wrote: > > Hi all, > > I would like to compute a simple alpha-theta ratio and do some > > statistics on it. > > I had my data from freqanalysis. > > Then I averaged with selectdata_new to have the mean for a band. > > Then the simple ratio for each channel. > > If now I call freqstatistics I have an error. > > Any suggestion? > > > > Thanks > > > > Marco > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com From nkrishna at mprc.umaryland.edu Wed Apr 2 16:43:45 2014 From: nkrishna at mprc.umaryland.edu (Nithin Krishna) Date: Wed, 2 Apr 2014 10:43:45 -0400 Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data References: <20140402T102301Z_155300170001@mprc.umaryland.edu> <463655257.1716412.1396449554295.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <20140402T104345Z_155300170001@mprc.umaryland.edu> Thanks a lot Nietzsche, will explore the tutorials. Nithin >>> "Lam, Nietzsche" 4/2/2014 10:39 AM >>> Dear Nithin, FieldTrip was primarily set up for MEG data but we definitely have several tutorials discussing similar procedures for EEG data. Perhaps these tutorials can help you out. http://fieldtrip.fcdonders.nl/tutorial/eeg_preprocessing_erp http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock http://fieldtrip.fcdonders.nl/tutorial/eventrelatedstatistics Although these later two links are performed on MEG data, I think they are useful to you because functions used to calculate ERFs are also used for ERPs. For example, in FieldTrip you can use ft_timelockanalysis and ft_timelockstatistics for both EEG and MEG data. Regarding the use of non-FieldTrip data for cluster-permutations. Theoretically, I think it is possible, but probably more experienced users can answer this. Nevertheless, you could look into this FAQ about how to import your data so that it ca be used by FieldTrip here: http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat?s[]=import&s[]=data best, Nietzsche ----- Original Message ----- > From: "Nithin Krishna" > To: "FieldTrip discussion list" > Sent: Wednesday, 2 April, 2014 4:23:01 PM > Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data > Dear All, > I read the tutorial section on Cluster-based permutation tests on > time-frequency data as well as the Maris and Oostenveld, Journal of > Neuroscience Methods, 2007 report. I am interested in setting up a ERP > experiment on EEG data in this regard I like the procedure and > processing section of the tutorial, however I would like to know if > there is any section for EEG, I understand that megplanar is specific > for MEG. > Also is it possible to use 3D matrix (TFR) (time, Freq channels ) non > feild trip output to run the cluster based permutation tests. > Looking forward > Nithin > > > >>> "Jörn M. Horschig" 4/2/2014 6:39 AM >>> > > Hi Marco, > > could you be more specific, in the style of e.g. > http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community#how_to_ask_a_questio > ? > > Best, > Jörn > > On 4/2/2014 12:31 PM, Marco Rotonda wrote: > > Hi all, > > I would like to compute a simple alpha-theta ratio and do some > > statistics on it. > > I had my data from freqanalysis. > > Then I averaged with selectdata_new to have the mean for a band. > > Then the simple ratio for each channel. > > If now I call freqstatistics I have an error. > > Any suggestion? > > > > Thanks > > > > Marco > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at fcdonders.ru.nl Wed Apr 2 17:10:52 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Wed, 2 Apr 2014 17:10:52 +0200 (CEST) Subject: [FieldTrip] Fieldtrip ICA crashes Matlab In-Reply-To: References: Message-ID: <005101cf4e85$bd08ef50$371acdf0$@herring@fcdonders.ru.nl> Hi Hweeling, Could you please copy and paste the exact error message Matlab is producing? Also, which version (e.g. 2013a) of Matlab are you using? Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Hwee Ling Lee Sent: maandag 31 maart 2014 17:25 To: Stephen Politzer-Ahles; FieldTrip discussion list Subject: Re: [FieldTrip] Fieldtrip ICA crashes Matlab Hi, Thanks for your reply. I'm running Matlab with 64 bit. I've got 32GB of RAM installed. In the previous month, I was able to run ICA and plot its components without any error message from Matlab. Recently, I keep experiencing the error message, and Matlab crashes completely. I have no clue what could have gone wrong. Cheers, Hweeling On 31 March 2014 17:08, Stephen Politzer-Ahles wrote: Hello Hweeling, What kind of error do you get in MATLAB when you try to do ICA, is it an "Out of memory" error? I'm asking because this is a fairly common issue in MATLAB on Windows systems (I don't know the details of your data, but I've experienced this issue on 32-channel, 1000-Hz epoched EEG data if the epochs are long enough and numerous enough). For me the only solutions (other than shortening the epochs or downsampling the data, which might not be good options depending on your research question) were to use a Unix-based operating system (like Mac OS) or to upgrade my Windows (I had errors like this when using a 32-bit version of Windows with 2 GB of RAM, but not so much after I upgraded to 64-bit and 8 GB of RAM). I'm not sure if this is the issue you're having, though. Best, Steve Stephen Politzer-Ahles New York University, Abu Dhabi Neuroscience of Language Lab http://www.nyu.edu/projects/politzer-ahles/ On Mon, Mar 31, 2014 at 7:02 PM, wrote: Send fieldtrip mailing list submissions to fieldtrip at science.ru.nl To subscribe or unsubscribe via the World Wide Web, visit http://mailman.science.ru.nl/mailman/listinfo/fieldtrip or, via email, send a message with subject or body 'help' to fieldtrip-request at science.ru.nl You can reach the person managing the list at fieldtrip-owner at science.ru.nl When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..." Today's Topics: 1. Fieldtrip ICA crashes Matlab (Hwee Ling Lee) 2. Re: plotting interpolated sources with ft_sourceplot (J?rn M. Horschig) 3. Re: help about ' fieldtrip2fiff ' (Gio Piantoni) ---------------------------------------------------------------------- Message: 1 Date: Mon, 31 Mar 2014 16:48:34 +0200 From: Hwee Ling Lee To: FieldTrip discussion list Subject: [FieldTrip] Fieldtrip ICA crashes Matlab Message-ID: Content-Type: text/plain; charset="iso-8859-1" Dear all, I'm encountering a problem with running ICA in Matlab. After ICA, when I tried to plot the components, Matlab keeps prompting an internal problem and needs to be closed. I wonder why this is the case. Could someone please tell me what went wrong? Here's part of my script for ICA: cfg = []; % if data were cleaned, then use this if sub == 5 %|| sub == 7 cfg.channel = {'all', '-AFz', '-FT7'}; elseif sub == 7 cfg.channel = {'all' '-AFz'}; else cfg.channel = {'all'}; end % cfg.runica.pca = 121; % using the rank of my data % ic_data = ft_componentanalysis(cfg,cleandata); % if data were cleaned then use this ic_data = ft_componentanalysis(cfg, cleandata); % after ICA, look for components that we want to substract from our data, % only looking at ten channels (components) at a time cfg = []; cfg.dataset = rawdatafile; cfg.viewmode = 'component'; cfg.continuous = 'no'; cfg.blocksize = 8; cfg.channels = 'all'; cfg.layout = 'EEG1020.lay'; ft_databrowser(cfg,ic_data); The internal problem appears even when I downsampled my data from 5000 Hz to 1000 Hz. The internal problem appears also when I have short segments of my data (i.e. 2s per trial), and long segments of my data (i.e. 6s per trial). The memory of my PC workstation is: Maximum possible array: 60253 MB (6.318e+10 bytes) * Memory available for all arrays: 60253 MB (6.318e+10 bytes) * Memory used by MATLAB: 560 MB (5.872e+08 bytes) Physical Memory (RAM): 32685 MB (3.427e+10 bytes) Interestingly, this internal problem does not occur when I ran my script on my Macbook Pro. I'm feeling very lost here. Any help is highly appreciated. Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: -- ================================================= Dr. rer. nat. Lee, Hwee Ling Postdoc German Center for Neurodegenerative Diseases (DZNE) Bonn Email 1: hwee-ling.leedzne.de Email 2: hweeling.leegmail.com https://sites.google.com/site/hweelinglee/home Correspondence Address: Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany ================================================= -------------- next part -------------- An HTML attachment was scrubbed... URL: From joramvandriel at gmail.com Wed Apr 2 17:25:29 2014 From: joramvandriel at gmail.com (Joram van Driel) Date: Wed, 2 Apr 2014 17:25:29 +0200 Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data In-Reply-To: <463655257.1716412.1396449554295.JavaMail.root@indus.zimbra.ru.nl> References: <20140402T102301Z_155300170001@mprc.umaryland.edu> <463655257.1716412.1396449554295.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Dear Nithin, I use Fieldtrip's permutation testing routines quite often on non-fieldtrip analyzed data. It is quite straightforward as long as you have your channel/neighbour layout the way Fieldtrip needs it. Try playing around with the ft_read_sens(*[EEG file with readable channel locations]*), or simply choose a layout file from the folder /template/layout/ inside your fieldtrip folder; from this you need to use ft_prepare_neighbours; or more simple, choose a predefined neighbour structure from /template/neighbours. This covers quite a lot of systems; of course yours may not be in there; then I think ft_read_sens is your only option. I use EEGLAB for example, and I could import a .set file with a field EEG.chanlocs using ft_read_sens. Then, I do the following for time-frequency data (but in principle this should be very similar for time-domain ERP data): - I first configure the cfg as described in the cluster permutation testing tutorial - Then I manually put my own analyzed data into a "freqs" structure; name is of course arbitrary, but should have the same fields as the output from ft_freqanalysis: freq1.freq = [the values of the different frequencies]; freq1.time = [the different time points]; freq1.dimord = 'subj_chan_freq_time'; freq1.grad = [the result from ft_read_sense]; freq1.label = [the labels from the result of ft_read_sense]; freq1.powspctrm = [the result of your own custom/EEGLAB/whatever non-fieldtrip analysis, provided this has the dimensions of freqs.dimord]; Then I do this for example for two different conditions, make my design matrix in cfg.design, and put it into ft_freqstatistics(cfg,freq1,freq2) Hope this helps. - Joram On Wed, Apr 2, 2014 at 4:39 PM, Lam, Nietzsche wrote: > Dear Nithin, > > FieldTrip was primarily set up for MEG data but we definitely have several > tutorials discussing similar procedures for EEG data. Perhaps these > tutorials can help you out. > > http://fieldtrip.fcdonders.nl/tutorial/eeg_preprocessing_erp > > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock > http://fieldtrip.fcdonders.nl/tutorial/eventrelatedstatistics > Although these later two links are performed on MEG data, I think they are > useful to you because functions used to calculate ERFs are also used for > ERPs. For example, in FieldTrip you can use ft_timelockanalysis and > ft_timelockstatistics for both EEG and MEG data. > > Regarding the use of non-FieldTrip data for cluster-permutations. > Theoretically, I think it is possible, but probably more experienced users > can answer this. Nevertheless, you could look into this FAQ about how to > import your data so that it ca be used by FieldTrip here: > > http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat?s[]=import&s[]=data > > best, > Nietzsche > > > > ----- Original Message ----- > > From: "Nithin Krishna" > > To: "FieldTrip discussion list" > > Sent: Wednesday, 2 April, 2014 4:23:01 PM > > Subject: [FieldTrip] Question on Cluster-based permutation tests on > time-frequency data > > Dear All, > > I read the tutorial section on Cluster-based permutation tests on > > time-frequency data as well as the Maris and Oostenveld, Journal of > > Neuroscience Methods, 2007 report. I am interested in setting up a ERP > > experiment on EEG data in this regard I like the procedure and > > processing section of the tutorial, however I would like to know if > > there is any section for EEG, I understand that megplanar is specific > > for MEG. > > Also is it possible to use 3D matrix (TFR) (time, Freq channels ) non > > feild trip output to run the cluster based permutation tests. > > Looking forward > > Nithin > > > > > > >>> "Jörn M. Horschig" 4/2/2014 6:39 AM >>> > > > > Hi Marco, > > > > could you be more specific, in the style of e.g. > > > http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community#how_to_ask_a_questio > > ? > > > > Best, > > Jörn > > > > On 4/2/2014 12:31 PM, Marco Rotonda wrote: > > > Hi all, > > > I would like to compute a simple alpha-theta ratio and do some > > > statistics on it. > > > I had my data from freqanalysis. > > > Then I averaged with selectdata_new to have the mean for a band. > > > Then the simple ratio for each channel. > > > If now I call freqstatistics I have an error. > > > Any suggestion? > > > > > > Thanks > > > > > > Marco > > > > > > > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > -- > > Jörn M. Horschig > > PhD Student > > Donders Institute for Brain, Cognition and Behaviour > > Centre for Cognitive Neuroimaging > > Radboud University Nijmegen > > Neuronal Oscillations Group > > FieldTrip Development Team > > > > P.O. Box 9101 > > NL-6500 HB Nijmegen > > The Netherlands > > > > Contact: > > E-Mail: jm.horschig at donders.ru.nl > > Tel: +31-(0)24-36-68493 > > Web: http://www.ru.nl/donders > > > > Visiting address: > > Trigon, room 2.30 > > Kapittelweg 29 > > NL-6525 EN Nijmegen > > The Netherlands > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Nietzsche H.L. Lam, MSc > PhD Candidate > > Max Planck Institute for Psycholinguistics > Wundtlaan 1, 6525 XD Nijmegen, The Netherlands > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Kapittelweg 29, 6525EN Nijmegen, The Netherlands > > n.lam at fcdonders.ru.nl > +31-24-3668219 > > > neurobiologyoflanguage.com > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Joram van Driel, MSc. PhD student @ University of Amsterdam Brain & Cognition @ Department of Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: From nkrishna at mprc.umaryland.edu Wed Apr 2 18:28:08 2014 From: nkrishna at mprc.umaryland.edu (Nithin Krishna) Date: Wed, 2 Apr 2014 12:28:08 -0400 Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data References: <20140402T102301Z_155300170001@mprc.umaryland.edu> <463655257.1716412.1396449554295.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <20140402T122808Z_155300170001@mprc.umaryland.edu> Thanks a lot Joram, Actually this helps a lot and the layout does have my system. Cheers Nithin >>> Joram van Driel 4/2/2014 11:25 AM >>> Dear Nithin, I use Fieldtrip's permutation testing routines quite often on non-fieldtrip analyzed data. It is quite straightforward as long as you have your channel/neighbour layout the way Fieldtrip needs it. Try playing around with the ft_read_sens([EEG file with readable channel locations]), or simply choose a layout file from the folder /template/layout/ inside your fieldtrip folder; from this you need to use ft_prepare_neighbours; or more simple, choose a predefined neighbour structure from /template/neighbours. This covers quite a lot of systems; of course yours may not be in there; then I think ft_read_sens is your only option. I use EEGLAB for example, and I could import a .set file with a field EEG.chanlocs using ft_read_sens. Then, I do the following for time-frequency data (but in principle this should be very similar for time-domain ERP data): - I first configure the cfg as described in the cluster permutation testing tutorial - Then I manually put my own analyzed data into a "freqs" structure; name is of course arbitrary, but should have the same fields as the output from ft_freqanalysis: freq1.freq = [the values of the different frequencies]; freq1.time = [the different time points]; freq1.dimord = 'subj_chan_freq_time'; freq1.grad = [the result from ft_read_sense]; freq1.label = [the labels from the result of ft_read_sense]; freq1.powspctrm = [the result of your own custom/EEGLAB/whatever non-fieldtrip analysis, provided this has the dimensions of freqs.dimord]; Then I do this for example for two different conditions, make my design matrix in cfg.design, and put it into ft_freqstatistics(cfg,freq1,freq2) Hope this helps. - Joram On Wed, Apr 2, 2014 at 4:39 PM, Lam, Nietzsche wrote: Dear Nithin, FieldTrip was primarily set up for MEG data but we definitely have several tutorials discussing similar procedures for EEG data. Perhaps these tutorials can help you out. http://fieldtrip.fcdonders.nl/tutorial/eeg_preprocessing_erp http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock http://fieldtrip.fcdonders.nl/tutorial/eventrelatedstatistics Although these later two links are performed on MEG data, I think they are useful to you because functions used to calculate ERFs are also used for ERPs. For example, in FieldTrip you can use ft_timelockanalysis and ft_timelockstatistics for both EEG and MEG data. Regarding the use of non-FieldTrip data for cluster-permutations. Theoretically, I think it is possible, but probably more experienced users can answer this. Nevertheless, you could look into this FAQ about how to import your data so that it ca be used by FieldTrip here: http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat?s[]=import&s[]=data best, Nietzsche ----- Original Message ----- > From: "Nithin Krishna" > To: "FieldTrip discussion list" > Sent: Wednesday, 2 April, 2014 4:23:01 PM > Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data > Dear All, > I read the tutorial section on Cluster-based permutation tests on > time-frequency data as well as the Maris and Oostenveld, Journal of > Neuroscience Methods, 2007 report. I am interested in setting up a ERP > experiment on EEG data in this regard I like the procedure and > processing section of the tutorial, however I would like to know if > there is any section for EEG, I understand that megplanar is specific > for MEG. > Also is it possible to use 3D matrix (TFR) (time, Freq channels ) non > feild trip output to run the cluster based permutation tests. > Looking forward > Nithin > > > >>> "Jörn M. Horschig" 4/2/2014 6:39 AM >>> > > Hi Marco, > > could you be more specific, in the style of e.g. > http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community#how_to_ask_a_questio > ? > > Best, > Jörn > > On 4/2/2014 12:31 PM, Marco Rotonda wrote: > > Hi all, > > I would like to compute a simple alpha-theta ratio and do some > > statistics on it. > > I had my data from freqanalysis. > > Then I averaged with selectdata_new to have the mean for a band. > > Then the simple ratio for each channel. > > If now I call freqstatistics I have an error. > > Any suggestion? > > > > Thanks > > > > Marco > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Joram van Driel, MSc. PhD student @ University of Amsterdam Brain & Cognition @ Department of Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Wed Apr 2 20:47:13 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Wed, 2 Apr 2014 20:47:13 +0200 Subject: [FieldTrip] Fieldtrip ICA crashes Matlab In-Reply-To: <533c287d.43040e0a.3506.3700SMTPIN_ADDED_BROKEN@mx.google.com> References: <533c287d.43040e0a.3506.3700SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: Dear Jim, I figured that the error occurs when I tried to plot the ICA components using ft_databrowser, with viewmode as "component". For the PC, I'm running a 64 bit Windows 7, 32 GB of RAM, and 1000 MB of graphics memory (NIVDIA Quadro 600). I've also tried the command on another PC running 64 bit Windows 7, Matlab R2012b, 64 GB of RAM and 457 MB of graphics memory. Both PCs produced the same internal error that crashes Matlab. I was not able to copy the message, as it was a pop out window that informs me of the fatal error, and I would have to end the program. The funny thing was that I was able to plot the ICA components a month ago, but not able to. This error occurred once to me as well. I've also updated my fieldtrip toolbox to the version on 30 March 2014. For the Macbook Pro, I did not get this error when I plotted the ICA components using the same data and the same commands. I suspect that it may be a problem with my graphics memory, however, the error seems strange to me as it occurs on some times, and the error "disappears" on some other times. I'm contemplating of converting one of my PC to a linux workstation. Do you think this will resolve my problems? Thanks for your help. I'm totally lost here. Best regards, Hweeling On 2 April 2014 17:10, Herring, J.D. (Jim) wrote: > Hi Hweeling, > > > > Could you please copy and paste the exact error message Matlab is > producing? Also, which version (e.g. 2013a) of Matlab are you using? > > > > Best, > > > > Jim > > > > > > > > *From:* fieldtrip-bounces at science.ru.nl [mailto: > fieldtrip-bounces at science.ru.nl] *On Behalf Of *Hwee Ling Lee > *Sent:* maandag 31 maart 2014 17:25 > *To:* Stephen Politzer-Ahles; FieldTrip discussion list > *Subject:* Re: [FieldTrip] Fieldtrip ICA crashes Matlab > > > > Hi, > > > > Thanks for your reply. I'm running Matlab with 64 bit. I've got 32GB of > RAM installed. In the previous month, I was able to run ICA and plot its > components without any error message from Matlab. Recently, I keep > experiencing the error message, and Matlab crashes completely. I have no > clue what could have gone wrong. > > > > Cheers, > > Hweeling > > > > On 31 March 2014 17:08, Stephen Politzer-Ahles > wrote: > > Hello Hweeling, > > > > What kind of error do you get in MATLAB when you try to do ICA, is it an > "Out of memory" error? I'm asking because this is a fairly common issue in > MATLAB on Windows systems (I don't know the details of your data, but I've > experienced this issue on 32-channel, 1000-Hz epoched EEG data if the > epochs are long enough and numerous enough). For me the only solutions > (other than shortening the epochs or downsampling the data, which might not > be good options depending on your research question) were to use a > Unix-based operating system (like Mac OS) or to upgrade my Windows (I had > errors like this when using a 32-bit version of Windows with 2 GB of RAM, > but not so much after I upgraded to 64-bit and 8 GB of RAM). I'm not sure > if this is the issue you're having, though. > > > > Best, > > Steve > > > > > > > Stephen Politzer-Ahles > New York University, Abu Dhabi > Neuroscience of Language Lab > http://www.nyu.edu/projects/politzer-ahles/ > > > > On Mon, Mar 31, 2014 at 7:02 PM, wrote: > > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Fieldtrip ICA crashes Matlab (Hwee Ling Lee) > 2. Re: plotting interpolated sources with ft_sourceplot > (J?rn M. Horschig) > 3. Re: help about ' fieldtrip2fiff ' (Gio Piantoni) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 31 Mar 2014 16:48:34 +0200 > From: Hwee Ling Lee > To: FieldTrip discussion list > Subject: [FieldTrip] Fieldtrip ICA crashes Matlab > Message-ID: > poVtb-1ApZuDQ at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Dear all, > > I'm encountering a problem with running ICA in Matlab. After ICA, when I > tried to plot the components, Matlab keeps prompting an internal problem > and needs to be closed. I wonder why this is the case. Could someone please > tell me what went wrong? > > Here's part of my script for ICA: > > cfg = []; % if data were cleaned, then use this > > if sub == 5 %|| sub == 7 > cfg.channel = {'all', '-AFz', '-FT7'}; > elseif sub == 7 > cfg.channel = {'all' '-AFz'}; > else > cfg.channel = {'all'}; > end > > % cfg.runica.pca = 121; % using the rank of my data > % ic_data = ft_componentanalysis(cfg,cleandata); % if data were > cleaned then use this > ic_data = ft_componentanalysis(cfg, cleandata); > > % after ICA, look for components that we want to substract from our > data, > % only looking at ten channels (components) at a time > cfg = []; > cfg.dataset = rawdatafile; > cfg.viewmode = 'component'; > cfg.continuous = 'no'; > cfg.blocksize = 8; > cfg.channels = 'all'; > cfg.layout = 'EEG1020.lay'; > ft_databrowser(cfg,ic_data); > > > The internal problem appears even when I downsampled my data from 5000 Hz > to 1000 Hz. > > The internal problem appears also when I have short segments of my data > (i.e. 2s per trial), and long segments of my data (i.e. 6s per trial). > > The memory of my PC workstation is: > Maximum possible array: 60253 MB (6.318e+10 bytes) * > Memory available for all arrays: 60253 MB (6.318e+10 bytes) * > Memory used by MATLAB: 560 MB (5.872e+08 bytes) > Physical Memory (RAM): 32685 MB (3.427e+10 bytes) > > Interestingly, this internal problem does not occur when I ran my script on > my Macbook Pro. > > I'm feeling very lost here. Any help is highly appreciated. > > Cheers, > Hweeling > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/f756367f/attachment-0001.html > > > > > > > > -- > > ================================================= > Dr. rer. nat. Lee, Hwee Ling > Postdoc > German Center for Neurodegenerative Diseases (DZNE) Bonn > > Email 1: hwee-ling.leedzne.de > Email 2: hweeling.leegmail.com > > > > https://sites.google.com/site/hweelinglee/home > > Correspondence Address: > Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany > ================================================= > -- ================================================= Dr. rer. nat. Lee, Hwee Ling Postdoc German Center for Neurodegenerative Diseases (DZNE) Bonn Email 1: hwee-ling.leedzne.de Email 2: hweeling.leegmail.com https://sites.google.com/site/hweelinglee/home Correspondence Address: Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany ================================================= -------------- next part -------------- An HTML attachment was scrubbed... URL: From elmeri.syrjanen at gmail.com Wed Apr 2 22:17:51 2014 From: elmeri.syrjanen at gmail.com (=?ISO-8859-1?Q?Elmeri_Syrj=E4nen?=) Date: Wed, 2 Apr 2014 22:17:51 +0200 Subject: [FieldTrip] Fieldtrip ICA crashes Matlab In-Reply-To: References: <533c287d.43040e0a.3506.3700SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: Dear Whee Ling, this is an old bug that has been in FieldTrip since October last year. You can see the bug report here: http://bugzilla.fcdonders.nl/show_bug.cgi?id=2316 Safest way to avoid it is to use a mac computer or revert to a FieldTrip version from September last year. /elmeri On Wed, Apr 2, 2014 at 8:47 PM, Hwee Ling Lee wrote: > Dear Jim, > > I figured that the error occurs when I tried to plot the ICA components > using ft_databrowser, with viewmode as "component". > > For the PC, I'm running a 64 bit Windows 7, 32 GB of RAM, and 1000 MB of > graphics memory (NIVDIA Quadro 600). I've also tried the command on another > PC running 64 bit Windows 7, Matlab R2012b, 64 GB of RAM and 457 MB of > graphics memory. Both PCs produced the same internal error that crashes > Matlab. I was not able to copy the message, as it was a pop out window that > informs me of the fatal error, and I would have to end the program. > > The funny thing was that I was able to plot the ICA components a month > ago, but not able to. This error occurred once to me as well. I've also > updated my fieldtrip toolbox to the version on 30 March 2014. > > For the Macbook Pro, I did not get this error when I plotted the ICA > components using the same data and the same commands. > > I suspect that it may be a problem with my graphics memory, however, the > error seems strange to me as it occurs on some times, and the error > "disappears" on some other times. > > I'm contemplating of converting one of my PC to a linux workstation. Do > you think this will resolve my problems? > > Thanks for your help. I'm totally lost here. > > Best regards, > Hweeling > > > > > On 2 April 2014 17:10, Herring, J.D. (Jim) wrote: > >> Hi Hweeling, >> >> >> >> Could you please copy and paste the exact error message Matlab is >> producing? Also, which version (e.g. 2013a) of Matlab are you using? >> >> >> >> Best, >> >> >> >> Jim >> >> >> >> >> >> >> >> *From:* fieldtrip-bounces at science.ru.nl [mailto: >> fieldtrip-bounces at science.ru.nl] *On Behalf Of *Hwee Ling Lee >> >> *Sent:* maandag 31 maart 2014 17:25 >> *To:* Stephen Politzer-Ahles; FieldTrip discussion list >> *Subject:* Re: [FieldTrip] Fieldtrip ICA crashes Matlab >> >> >> >> Hi, >> >> >> >> Thanks for your reply. I'm running Matlab with 64 bit. I've got 32GB of >> RAM installed. In the previous month, I was able to run ICA and plot its >> components without any error message from Matlab. Recently, I keep >> experiencing the error message, and Matlab crashes completely. I have no >> clue what could have gone wrong. >> >> >> >> Cheers, >> >> Hweeling >> >> >> >> On 31 March 2014 17:08, Stephen Politzer-Ahles >> wrote: >> >> Hello Hweeling, >> >> >> >> What kind of error do you get in MATLAB when you try to do ICA, is it an >> "Out of memory" error? I'm asking because this is a fairly common issue in >> MATLAB on Windows systems (I don't know the details of your data, but I've >> experienced this issue on 32-channel, 1000-Hz epoched EEG data if the >> epochs are long enough and numerous enough). For me the only solutions >> (other than shortening the epochs or downsampling the data, which might not >> be good options depending on your research question) were to use a >> Unix-based operating system (like Mac OS) or to upgrade my Windows (I had >> errors like this when using a 32-bit version of Windows with 2 GB of RAM, >> but not so much after I upgraded to 64-bit and 8 GB of RAM). I'm not sure >> if this is the issue you're having, though. >> >> >> >> Best, >> >> Steve >> >> >> >> >> >> >> Stephen Politzer-Ahles >> New York University, Abu Dhabi >> Neuroscience of Language Lab >> http://www.nyu.edu/projects/politzer-ahles/ >> >> >> >> On Mon, Mar 31, 2014 at 7:02 PM, wrote: >> >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. Fieldtrip ICA crashes Matlab (Hwee Ling Lee) >> 2. Re: plotting interpolated sources with ft_sourceplot >> (J?rn M. Horschig) >> 3. Re: help about ' fieldtrip2fiff ' (Gio Piantoni) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Mon, 31 Mar 2014 16:48:34 +0200 >> From: Hwee Ling Lee >> To: FieldTrip discussion list >> Subject: [FieldTrip] Fieldtrip ICA crashes Matlab >> Message-ID: >> > poVtb-1ApZuDQ at mail.gmail.com> >> Content-Type: text/plain; charset="iso-8859-1" >> >> Dear all, >> >> I'm encountering a problem with running ICA in Matlab. After ICA, when I >> tried to plot the components, Matlab keeps prompting an internal problem >> and needs to be closed. I wonder why this is the case. Could someone >> please >> tell me what went wrong? >> >> Here's part of my script for ICA: >> >> cfg = []; % if data were cleaned, then use this >> >> if sub == 5 %|| sub == 7 >> cfg.channel = {'all', '-AFz', '-FT7'}; >> elseif sub == 7 >> cfg.channel = {'all' '-AFz'}; >> else >> cfg.channel = {'all'}; >> end >> >> % cfg.runica.pca = 121; % using the rank of my data >> % ic_data = ft_componentanalysis(cfg,cleandata); % if data were >> cleaned then use this >> ic_data = ft_componentanalysis(cfg, cleandata); >> >> % after ICA, look for components that we want to substract from >> our >> data, >> % only looking at ten channels (components) at a time >> cfg = []; >> cfg.dataset = rawdatafile; >> cfg.viewmode = 'component'; >> cfg.continuous = 'no'; >> cfg.blocksize = 8; >> cfg.channels = 'all'; >> cfg.layout = 'EEG1020.lay'; >> ft_databrowser(cfg,ic_data); >> >> >> The internal problem appears even when I downsampled my data from 5000 Hz >> to 1000 Hz. >> >> The internal problem appears also when I have short segments of my data >> (i.e. 2s per trial), and long segments of my data (i.e. 6s per trial). >> >> The memory of my PC workstation is: >> Maximum possible array: 60253 MB (6.318e+10 bytes) * >> Memory available for all arrays: 60253 MB (6.318e+10 bytes) * >> Memory used by MATLAB: 560 MB (5.872e+08 bytes) >> Physical Memory (RAM): 32685 MB (3.427e+10 bytes) >> >> Interestingly, this internal problem does not occur when I ran my script >> on >> my Macbook Pro. >> >> I'm feeling very lost here. Any help is highly appreciated. >> >> Cheers, >> Hweeling >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: < >> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/f756367f/attachment-0001.html >> > >> >> >> >> >> >> -- >> >> ================================================= >> Dr. rer. nat. Lee, Hwee Ling >> Postdoc >> German Center for Neurodegenerative Diseases (DZNE) Bonn >> >> Email 1: hwee-ling.leedzne.de >> Email 2: hweeling.leegmail.com >> >> >> >> https://sites.google.com/site/hweelinglee/home >> >> Correspondence Address: >> Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany >> ================================================= >> > > > > -- > ================================================= > Dr. rer. nat. Lee, Hwee Ling > Postdoc > German Center for Neurodegenerative Diseases (DZNE) Bonn > > Email 1: hwee-ling.leedzne.de > Email 2: hweeling.leegmail.com > > https://sites.google.com/site/hweelinglee/home > > Correspondence Address: > Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany > ================================================= > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.todorovic at fcdonders.ru.nl Thu Apr 3 00:54:42 2014 From: a.todorovic at fcdonders.ru.nl (Todorovic, A.) Date: Thu, 3 Apr 2014 00:54:42 +0200 (CEST) Subject: [FieldTrip] denoising data In-Reply-To: <800964494.215951.1396478020373.JavaMail.root@monoceros.zimbra.ru.nl> Message-ID: <124252612.215995.1396479282885.JavaMail.root@monoceros.zimbra.ru.nl> Dear 'trippers, I'm curious to hear your thoughts on how to best denoise data. What I'm doing is working, but I'd like to hear whether it's logical or reasonable. In particular, I have two issues. One is that I use ICA to remove blinks, so I have to fit denoising into a pipeline that incorporates ICA (which, I am guessing, works well only without including reference channels). The other is that I see there are two functions for denoising, ft_denoise_synthetic and ft_denoise_pca. In sum (1) I'm not really sure WHEN the best moment for denoising is, given that I use ICA, and (2) I don't understand when it's better to use ft_denoise_synthetic and when ft_denoise_pca. I do see that ft_denoise_pca has the option of preprocessing reference channels separately, which makes it easier to use after ICA. I used to know only about the first function, and my solution was to do ft_denoise_synthetic (using the 'G3BR' option) prior to the ICA. Then I would remove components which contain artifacts, and continue with making ERF/TFRs/whatever. This produces data that is somewhat cleaner than when I skip the denoising step. I was curious about the ft_denoise_pca when I saw it, so I tried running it on filtered, preprocessed data that I had after I rejected ICA components. [In the process of doing ICA, I used the ft_denoise_synthetic option, as above.] This produced a different TFR at the end of the road, which again looked cleaner. Significantly cleaner, actually, but N=1. Now I'm not sure if it was a logical step to use both denoising functions, and if it would have been a better idea to do things differently. I'd like to hear both whether something in the logic is wrong, and whether it's inelegant. Cheers, Ana From haiteng.jiang at gmail.com Thu Apr 3 07:53:36 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Thu, 3 Apr 2014 07:53:36 +0200 Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data Message-ID: Dear Nithin, Cluster statistic works both for MEG and EEG data since the machinery is the same . You can organize the Non-FT in the Fieldtrip style. Please not that FT have a data structure (channel*frequency*time ), so you need to transpose your data matrix first. Besides , you also need to define the layout of your channels , then you know the neighbors of channels (see ft_prepare_neighbours) because clusters are formed on the basis of temporal, spatial and spectral adjacency. For more information, please have a look at the tutorial again http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq. All the best, Haiteng > > Message: 6 > Date: Wed, 2 Apr 2014 10:23:01 -0400 > From: "Nithin Krishna" > To: "list, FieldTrip discussion" > Subject: [FieldTrip] Question on Cluster-based permutation tests on > time-frequency data > Message-ID: <20140402T102301Z_155300170001 at mprc.umaryland.edu> > Content-Type: text/plain; charset="utf-8" > > Dear All, > I read the tutorial section on Cluster-based permutation tests on > time-frequency data as well as the Maris and Oostenveld, Journal of > Neuroscience Methods, 2007 report. I am interested in setting up a ERP > experiment on EEG data in this regard I like the procedure and processing > section of the tutorial, however I would like to know if there is any > section for EEG, I understand that megplanar is specific for MEG. > Also is it possible to use 3D matrix (TFR) (time, Freq channels ) non > feild trip output to run the cluster based permutation tests. > Looking forward > Nithin > > > > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Thu Apr 3 08:27:30 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Thu, 3 Apr 2014 08:27:30 +0200 Subject: [FieldTrip] denoising data Message-ID: > > Dear Ana, > If I understand correctly , we use ft_denoise_synthetic and ft_denoise_pca to reduce noise due to recording (e.g. environment noise , thermal noise... ) not the brain signal artefact (e.g eye blink). Normally ,I use these two functions in the very early stage . Best, Haiteng > > Message: 5 > Date: Thu, 3 Apr 2014 00:54:42 +0200 (CEST) > From: "Todorovic, A." > To: FieldTrip List > Subject: [FieldTrip] denoising data > Message-ID: > < > 124252612.215995.1396479282885.JavaMail.root at monoceros.zimbra.ru.nl> > Content-Type: text/plain; charset=utf-8 > > Dear 'trippers, > > I'm curious to hear your thoughts on how to best denoise data. What I'm > doing is working, but I'd like to hear whether it's logical or reasonable. > > In particular, I have two issues. One is that I use ICA to remove blinks, > so I have to fit denoising into a pipeline that incorporates ICA (which, I > am guessing, works well only without including reference channels). > > The other is that I see there are two functions for denoising, > ft_denoise_synthetic and ft_denoise_pca. > > In sum (1) I'm not really sure WHEN the best moment for denoising is, > given that I use ICA, and (2) I don't understand when it's better to use > ft_denoise_synthetic and when ft_denoise_pca. I do see that ft_denoise_pca > has the option of preprocessing reference channels separately, which makes > it easier to use after ICA. > > I used to know only about the first function, and my solution was to do > ft_denoise_synthetic (using the 'G3BR' option) prior to the ICA. Then I > would remove components which contain artifacts, and continue with making > ERF/TFRs/whatever. This produces data that is somewhat cleaner than when I > skip the denoising step. > > I was curious about the ft_denoise_pca when I saw it, so I tried running > it on filtered, preprocessed data that I had after I rejected ICA > components. [In the process of doing ICA, I used the ft_denoise_synthetic > option, as above.] This produced a different TFR at the end of the road, > which again looked cleaner. Significantly cleaner, actually, but N=1. > > Now I'm not sure if it was a logical step to use both denoising functions, > and if it would have been a better idea to do things differently. I'd like > to hear both whether something in the logic is wrong, and whether it's > inelegant. > > Cheers, > Ana > > > ------------------------------ > > Message: 6 > Date: Thu, 3 Apr 2014 07:53:36 +0200 > From: Haiteng Jiang > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] Question on Cluster-based permutation tests > on time-frequency data > Message-ID: > 2+knQ6iHyZqSfyu0r2xvLessob65w at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Dear Nithin, > > Cluster statistic works both for MEG and EEG data since the machinery > is the same . You can organize the Non-FT in the Fieldtrip style. > Please not that FT have a data structure (channel*frequency*time ), so you > need to transpose your data matrix first. Besides , you also need to > define the layout of your channels , then you know the neighbors of > channels (see ft_prepare_neighbours) because clusters are formed on the > basis of temporal, spatial and spectral adjacency. For more information, > please have a look at the tutorial again > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq. > > All > the best, > > Haiteng > > > > > > > > Message: 6 > > Date: Wed, 2 Apr 2014 10:23:01 -0400 > > From: "Nithin Krishna" > > To: "list, FieldTrip discussion" > > Subject: [FieldTrip] Question on Cluster-based permutation tests on > > time-frequency data > > Message-ID: <20140402T102301Z_155300170001 at mprc.umaryland.edu> > > Content-Type: text/plain; charset="utf-8" > > > > Dear All, > > I read the tutorial section on Cluster-based permutation tests on > > time-frequency data as well as the Maris and Oostenveld, Journal of > > Neuroscience Methods, 2007 report. I am interested in setting up a ERP > > experiment on EEG data in this regard I like the procedure and processing > > section of the tutorial, however I would like to know if there is any > > section for EEG, I understand that megplanar is specific for MEG. > > Also is it possible to use 3D matrix (TFR) (time, Freq channels ) non > > feild trip output to run the cluster based permutation tests. > > Looking forward > > Nithin > > > > > > > > -- > Haiteng Jiang > PhD candidate > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Visiting address > Room 2.32 > Donders Centre for Cognitive Neuroimaging > Kapittelweg 29 > 6525 EN Nijmegen > the Netherlands > > Tel.: +31 (0)243668291 > Web: https://sites.google.com/site/haitengjiang/ > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140403/31c1ca38/attachment.html > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 8 > **************************************** > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.roux at bcbl.eu Thu Apr 3 12:07:11 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Thu, 3 Apr 2014 12:07:11 +0200 (CEST) Subject: [FieldTrip] denoising data In-Reply-To: Message-ID: <867980492.1251689.1396519631090.JavaMail.root@bcbl.eu> Hi Ana, Haiteng and everyone else, I am joining in on this discussion as I am thinking about a way of combining ft_componentanalysis with ft_denoise_pca to remove EOG, ECG and EMG activity. The pipeline that I would like to try is the following: %% ICA decomposition cfg = []; cfg.method = 'runica'; ICs = ft_componentanalysis(cfg,meg_data); % here meg_data has undergone basic preprocessing including bp-filtering as well as & ft_artifact_jump and ft_artifact_clip %% Substract artifacts from ICA components cfg = []; cfg.refchannel = eeg_data.label(1); % eeg_data contains the EOG (1-2), ECG(3) and EMG(4) ref-channels cfg.channel = {'runica'}; cfg.zscore = 'yes'; cfg.pertrial = 'yes'; cfg.trials = 'all'; [ICs] = ft_denoise_pca(cfg,ICs,eeg_data); % substract VEOG activity from all ICs %% The idea is to repeat this step for all refchannels in order to substract the artifacts. Then backproject ICs to original data: %% Backproject data cfg = []; meg_data = ft_rejectcomponent(cfg,ICs,meg_data); The advantage is that you don't have to "throw away" the entire component as sometimes ICs contain a mix of artifacts and brain activity. So by regressing out the artifacts, you could avoid throwing away the good stuff. However, I don't know if this is a good approach. There may be pitfalls that I am not thinking of right now. Therefore any suggestions or comments about whether this is a good idea would be very welcome! I am hoping that some of the ft_guru's could drop a line or two about this! Fred ----- Original Message ----- From: "Haiteng Jiang" To: fieldtrip at science.ru.nl Sent: Thursday, April 3, 2014 8:27:30 AM Subject: Re: [FieldTrip] denoising data Dear Ana, If I understand correctly , we use ft_denoise_synthetic and ft_denoise_pca to reduce noise due to recording (e.g. environment noise , thermal noise... ) not the brain signal artefact (e.g eye blink). Normally ,I use these two functions in the very early stage . Best, Haiteng Message: 5 Date: Thu, 3 Apr 2014 00:54:42 +0200 (CEST) From: "Todorovic, A." < a.todorovic at fcdonders.ru.nl > To: FieldTrip List < fieldtrip at donders.ru.nl > Subject: [FieldTrip] denoising data Message-ID: < 124252612.215995.1396479282885.JavaMail.root at monoceros.zimbra.ru.nl > Content-Type: text/plain; charset=utf-8 Dear 'trippers, I'm curious to hear your thoughts on how to best denoise data. What I'm doing is working, but I'd like to hear whether it's logical or reasonable. In particular, I have two issues. One is that I use ICA to remove blinks, so I have to fit denoising into a pipeline that incorporates ICA (which, I am guessing, works well only without including reference channels). The other is that I see there are two functions for denoising, ft_denoise_synthetic and ft_denoise_pca. In sum (1) I'm not really sure WHEN the best moment for denoising is, given that I use ICA, and (2) I don't understand when it's better to use ft_denoise_synthetic and when ft_denoise_pca. I do see that ft_denoise_pca has the option of preprocessing reference channels separately, which makes it easier to use after ICA. I used to know only about the first function, and my solution was to do ft_denoise_synthetic (using the 'G3BR' option) prior to the ICA. Then I would remove components which contain artifacts, and continue with making ERF/TFRs/whatever. This produces data that is somewhat cleaner than when I skip the denoising step. I was curious about the ft_denoise_pca when I saw it, so I tried running it on filtered, preprocessed data that I had after I rejected ICA components. [In the process of doing ICA, I used the ft_denoise_synthetic option, as above.] This produced a different TFR at the end of the road, which again looked cleaner. Significantly cleaner, actually, but N=1. Now I'm not sure if it was a logical step to use both denoising functions, and if it would have been a better idea to do things differently. I'd like to hear both whether something in the logic is wrong, and whether it's inelegant. Cheers, Ana ------------------------------ Message: 6 Date: Thu, 3 Apr 2014 07:53:36 +0200 From: Haiteng Jiang < haiteng.jiang at gmail.com > To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data Message-ID: Content-Type: text/plain; charset="iso-8859-1" Dear Nithin, Cluster statistic works both for MEG and EEG data since the machinery is the same . You can organize the Non-FT in the Fieldtrip style. Please not that FT have a data structure (channel*frequency*time ), so you need to transpose your data matrix first. Besides , you also need to define the layout of your channels , then you know the neighbors of channels (see ft_prepare_neighbours) because clusters are formed on the basis of temporal, spatial and spectral adjacency. For more information, please have a look at the tutorial again http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq . All the best, Haiteng > > Message: 6 > Date: Wed, 2 Apr 2014 10:23:01 -0400 > From: "Nithin Krishna" < nkrishna at mprc.umaryland.edu > > To: "list, FieldTrip discussion" < fieldtrip at science.ru.nl > > Subject: [FieldTrip] Question on Cluster-based permutation tests on > time-frequency data > Message-ID: < 20140402T102301Z_155300170001 at mprc.umaryland.edu > > Content-Type: text/plain; charset="utf-8" > > Dear All, > I read the tutorial section on Cluster-based permutation tests on > time-frequency data as well as the Maris and Oostenveld, Journal of > Neuroscience Methods, 2007 report. I am interested in setting up a ERP > experiment on EEG data in this regard I like the procedure and processing > section of the tutorial, however I would like to know if there is any > section for EEG, I understand that megplanar is specific for MEG. > Also is it possible to use 3D matrix (TFR) (time, Freq channels ) non > feild trip output to run the cluster based permutation tests. > Looking forward > Nithin > > > > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: < http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140403/31c1ca38/attachment.html > ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip End of fieldtrip Digest, Vol 41, Issue 8 **************************************** -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From luke.bloy at gmail.com Thu Apr 3 20:19:29 2014 From: luke.bloy at gmail.com (Luke Bloy) Date: Thu, 3 Apr 2014 14:19:29 -0400 Subject: [FieldTrip] fiff_read_epochs undefined Message-ID: I'm having trouble reading in headers from fif files. it seems like read_header now needs a file in /external/mne but that isn't being automatically added to the path via (ft_defaults) %----------------------------------- megFile = 'T110_012413_eyes_closed1_raw_tsss_mc.fif'; >> hdr = ft_read_header(megFile); grad = ft_convert_units(hdr.grad,'m'); 306 MEG channel locations transformed Undefined function 'fiff_read_epochs' for input arguments of type 'char'. Error in ft_read_header (line 1386) epochs = fiff_read_epochs(filename); %----------------------------------- am I missing something? THanks Luke -------------- next part -------------- An HTML attachment was scrubbed... URL: From luke.bloy at gmail.com Thu Apr 3 21:03:59 2014 From: luke.bloy at gmail.com (Luke Bloy) Date: Thu, 3 Apr 2014 15:03:59 -0400 Subject: [FieldTrip] fiff_read_epochs undefined In-Reply-To: References: Message-ID: Sorry ignore this last email. An update to the newest source fixed the issue. Sorry On Thu, Apr 3, 2014 at 2:19 PM, Luke Bloy wrote: > I'm having trouble reading in headers from fif files. > > it seems like read_header now needs a file in /external/mne but that isn't > being automatically added to the path via (ft_defaults) > > %----------------------------------- > megFile = 'T110_012413_eyes_closed1_raw_tsss_mc.fif'; > >> hdr = ft_read_header(megFile); > grad = ft_convert_units(hdr.grad,'m'); > 306 MEG channel locations transformed > Undefined function 'fiff_read_epochs' for input arguments of type 'char'. > > Error in ft_read_header (line 1386) > epochs = fiff_read_epochs(filename); > %----------------------------------- > > > am I missing something? > > THanks > Luke > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Fri Apr 4 02:08:02 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Fri, 4 Apr 2014 00:08:02 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <533B22CA.8040305@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>, <533985D8.4080504@donders.ru.nl> <533AD84B.6060600@donders.ru.nl> , <533B22CA.8040305@donders.ru.nl> Message-ID: Hello Jorn and Robert, Can you please keep me updated on your plans for the previously discussed functions? Just to remind you, I wish apply the LCMV beamformer on continuous data with ICA components instead of electrodes. Kind regards, Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" Sent: Wednesday, 2 April 2014 7:04 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot Hi Robert, yes, I thought so, that's why I put it on the agenda for tomorrow's meeting to discuss in more detail to figure out what needs to be done :) Best, Jörn On 4/1/2014 7:19 PM, Robert Oostenveld wrote: > Hi Jorn > > I was browsing the FT list and see that you got involved with this question from Tyler. I can imagine there being problems with a pipeline like this > > preprocessing -> componentanalysis -> timelockanalysis -> dipolefitting > > although it should (i.e. "is meant to") work by fitting dipoles to component topographies. But the code is not frequently used like this and it might be possible that there has been regression of the code (i.e bugs in the latest version that were not there before). > > With sourceanalysis it depends on the method. Covariance estimates between components does not make much sense in the further inversion, and thereby beamforming won’t work. MNE should in principle work, but not with an estimated data covariance but rather a scaled identity covariance. > > Given the uncertain level of support , but clear expectations on what should (and should not) work, I suggest to file it as “bug” (i.e. the issue is that it should be tested) and to write a test script that goes (with e.g. some simulated data) over the various options. > > best regards, > Robert > > > On 01 Apr 2014, at 17:16, Jörn M. Horschig wrote: > >> Hi Tyler, >> >> any reason why you don't want to go back to sensor-space but stay in component-space with your data? I would assume that the error will be gone if you use the back-projected data (ft_rejectcomponent, with cfg.component = []). >> >> Best, >> Jörn >> >> On 4/1/2014 8:15 AM, Tyler Grummett wrote: >>> Hey Jorn, >>> >>> In addition to my previous emails, Ive been trying to debug the functions. >>> >>> In ft_sourceanalysis, line 661 to 677: >>> >>> % HACK: use the default code >>> % select the channels of interest >>> [dum, datchanindx] = match_str(cfg.channel, data.label); >>> if strcmp(data.dimord, 'chan_time') >>> % It is in principle possible to have timelockanalysis with >>> % keeptrial=yes and only a single trial in the raw data. >>> % In that case the covariance should be represented as Nchan*Nchan >>> data.avg = data.avg(datchanindx,:); >>> %data.cov = reshape(data.cov, length(datchanindx), length(datchanindx)); >>> data.cov = data.cov(datchanindx,datchanindx); >>> else >>> data.avg = data.avg(datchanindx,:); >>> data.cov = data.cov(:,datchanindx,datchanindx); >>> data.trial = data.trial(:,datchanindx,:); >>> end >>> data.label = data.label(datchanindx); >>> Nchans = length(data.label); >>> >>> I found that my cfg.channel is []; and the data.label is all my ICA components labelled ica_001 etc. >>> >>> So it is returned as a []; >>> which means data.cov = []; >>> >>> I think then it will crash later parts of the code. Does this function work on ICA components? >>> >>> I ran the ICA in eeglab. >>> >>> Tyler. >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" >>> Sent: Tuesday, 1 April 2014 1:42 AM >>> To: fieldtrip at science.ru.nl >>> Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot >>> >>> just to clarify and be precise >>>> The pos-matrix has to be a regular 3D grid, i.e. be representable as a >>>> 3x3x3 matrix. >>> it actually does not have to be as you can also beam individual grid >>> points, but if you have a .dim field, then is has to be like above. But >>> that does not affect the rest of the mail I wrote ;) >>> >>> >>>> I am not quite sure how the sourceinterpolate function is handeling >>>> the fact that you do not have that .dim field. Apparently, it is also >>>> confused ;) >>>> >>>> Do you want to reconstruct only some voxels? From your code it seems >>>> that you want to cover the whole brain with a 1cm resolution. If the >>>> latter is the case, maybe restart with creating your forward model by >>>> following the tutorial that I posted in my previous mail. There are >>>> some sanity checks that can help you figuring out if you are doing the >>>> correct thing. If the former one is the case, please explain again >>>> what exactly you want to achieve and how you are building your forward >>>> model. >>>> >>>> Best, >>>> Jörn >>>> >>>> btw, there's nothing wrong with being a PhD student, it's just a >>>> matter of experience in practice and theory as in all domains in life ;) >>>> >>>> >>>> On 3/31/2014 3:15 PM, Tyler Grummett wrote: >>>>> Hey Jorn, >>>>> >>>>> Yes I am definitely confused haha, this stuff is way out of my league >>>>> as a PhD student. >>>>> Anyway, I feel we are getting somewhere. >>>>> >>>>> timelock = >>>>> >>>>> avg: [121x19767 double] >>>>> var: [121x19767 double] >>>>> time: [1x19767 double] >>>>> dof: [121x19767 double] >>>>> label: {1x121 cell} >>>>> dimord: 'chan_time' >>>>> cov: [121x121 double] >>>>> elec: [1x1 struct] >>>>> cfg: [1x1 struct] >>>>> >>>>> source = >>>>> >>>>> time: [1x19767 double] >>>>> pos: [642x3 double] >>>>> inside: [642x1 double] >>>>> outside: [] >>>>> method: 'average' >>>>> avg: [1x1 struct] >>>>> cfg: [1x1 struct] >>>>> >>>>> sourceInt = >>>>> >>>>> time: [1x19767 double] >>>>> avg: [1x1 struct] >>>>> pos: [16777216x3 double] >>>>> dim: [256 256 256] >>>>> inside: [1x16777216 double] >>>>> outside: [1x0 double] >>>>> coordsys: 'ctf' >>>>> unit: 'mm' >>>>> cfg: [1x1 struct] >>>>> >>>>> Given what I said last time, I might not comment on the differences. >>>>> I hope you can see something wrong. >>>>> >>>>> One thing I should mention is that the data is continuous, around 30 >>>>> seconds. Therefore there is only one trial, >>>>> is that an issue? >>>>> >>>>> Tyler >>>>> >>>>> ************************* >>>>> >>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>> PhD Candidate >>>>> Brain Signals Laboratory >>>>> Flinders University >>>>> Rm 5A301 >>>>> Ext 66124 >>>>> >>>>> ________________________________________ >>>>> From: fieldtrip-bounces at science.ru.nl >>>>> on behalf of "Jörn M. Horschig" >>>>> >>>>> Sent: Monday, 31 March 2014 10:24 PM >>>>> To: FieldTrip discussion list >>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>> ft_sourceplot >>>>> >>>>> Hi Tyler, >>>>> >>>>> there is not much inherently different between time- and >>>>> freuqency-domain beamformer, at least in terms of computing the forward >>>>> and the inverse solution. But I see that you are obviously confused, so >>>>> let me try to help you out and shed some light on what you are actually >>>>> doing ;) >>>>> >>>>> >>>>>> I had a look at my variables. >>>>>> >>>>>> source.avg = >>>>>> >>>>>> pow: [642x1 double] >>>>>> filter: {642x1 cell} >>>>>> >>>>>> sourceInt.avg = >>>>>> >>>>>> pow: [16777216x1 double] >>>>>> >>>>>> So clearly, as both variables are completely different. Something >>>>>> has gone wrong. >>>>> No, that is actually how it should be. From below you can see that your >>>>> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >>>>> 16777216 elements. In line with source.avg.pow, you should see that your >>>>> 'grid' consists of 642 elements, so you were computing your source >>>>> activity on a grid of in total 642 elements. Then you used the original >>>>> MRI to interpolate from 642 to these 16 million grid points. Actually, >>>>> since you specific cfg.downsample = 2, it should have been only 8 >>>>> million points, so that's where things already get a bit weird. >>>>> >>>>> So let's go into some sanity checks: >>>>> 1. are you using the latest version (or a recent, i.e. from this year) >>>>> of FielTrip? >>>>> 2. sourceInt should look something like this, does it? >>>>> >>>>> source_diff_int = >>>>> inside: [46x55x46 logical] >>>>> avg: [1x1 struct] >>>>> dim: [46 55 46] >>>>> transform: [4x4 double] >>>>> anatomy: [46x55x46 double] >>>>> unit: 'mm' >>>>> cfg: [1x1 struct] >>>>> >>>>> >>>>> >>>>> 3. source should look something like this: >>>>> >>>>> source = >>>>> dim: [20 25 22] >>>>> freq: 54.8287 >>>>> cumtapcnt: [338x1 double] >>>>> pos: [11000x3 double] >>>>> inside: [1x5798 double] >>>>> outside: [1x5202 double] >>>>> method: 'average' >>>>> avg: [1x1 struct] >>>>> trialinfo: [338x1 double] >>>>> cfg: [1x1 struct] >>>>> >>>>> 4. also check your grid, should be something like this: >>>>> >>>>> sourcemodel = >>>>> >>>>> pos: [11000x3 double] >>>>> dim: [20 25 22] >>>>> unit: 'cm' >>>>> inside: [1x5798 double] >>>>> outside: [1x5202 double] >>>>> params: [1x1 struct] >>>>> initial: [4x4 double] >>>>> cfg: [1x1 struct] >>>>> >>>>> >>>>> Of course, it should all look a bit different, because you are using >>>>> LCMV, but essentially it should be the same. Lastly, you can check other >>>>> source plotting methods, like 'ortho' or try to plot the source >>>>> structure rather than the sourceInt structure. In the end, the error >>>>> must be somewhere in your grid, be it in .pos or .inside, because >>>>> FieldTrip thinks that there is only one voxel to be plotted. There are >>>>> other things that may be the issue, but I am not sure about these. So, I >>>>> would suggest that you play a bit around and see where the error might >>>>> come from (e.g. follow this tutorial: >>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >>>>> steps that you need for LCMV, maybe also check out: >>>>> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >>>>> >>>>> there, LCMV is used, but on one voxel only) >>>>> >>>>> Best, >>>>> Jörn >>>>> >>>>>> The next part of my code is the following: >>>>>> >>>>>> % interpolate sources >>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>> mri = ft_volumereslice([], mri); >>>>>> >>>>>> cfg = []; >>>>>> cfg.downsample = 2; >>>>>> cfg.parameter = 'avg.pow'; >>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>> parameter >>>>>> % does not vary over time, therefore the time >>>>>> dimension is not needed. >>>>>> >>>>>> mri = >>>>>> >>>>>> anatomy: [256x256x256 double] >>>>>> dim: [256 256 256] >>>>>> transform: [4x4 double] >>>>>> coordsys: 'ctf' >>>>>> unit: 'mm' >>>>>> cfg: [1x1 struct] >>>>>> >>>>>> I cant really see if the data works in the tutorial because it >>>>>> doesnt appear as though fieldtrip has a tutorial on lcmv >>>>>> beamformers, they seem to stick to frequency domain beamformers. >>>>>> >>>>>> Ive been wrong before though, >>>>>> >>>>>> thanks for your help. >>>>>> >>>>>> Tyler >>>>>> >>>>>> ************************* >>>>>> >>>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>>> PhD Candidate >>>>>> Brain Signals Laboratory >>>>>> Flinders University >>>>>> Rm 5A301 >>>>>> Ext 66124 >>>>>> >>>>>> ________________________________________ >>>>>> From: fieldtrip-bounces at science.ru.nl >>>>>> on behalf of "Jörn M. Horschig" >>>>>> >>>>>> Sent: Monday, 31 March 2014 7:13 PM >>>>>> To: FieldTrip discussion list >>>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>>> ft_sourceplot >>>>>> >>>>>> Hi Tyler, >>>>>> >>>>>> hm, okay, it could be that the issue with the leadfield and with the >>>>>> plot are related, but it could also be that they are separate issues. I >>>>>> just saw that you posted the same 'problem' on bugzilla and included a >>>>>> picture. Maybe for next time, include a picture on the mailinglist and >>>>>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>>>>> and not if you are not sure. That saves us a lot of time in separating >>>>>> code issues from user problems ;) >>>>>> >>>>>> So, back to you problem. It seems that your reconstruction results in >>>>>> one voxel only. Are you sure that your grid consistents of more than >>>>>> just one position? So, for example check the size of the matrices in >>>>>> source.avg, source- and headmodel, etc. >>>>>> >>>>>> Also, you can check in Matlab the respective fields of source and >>>>>> sourceInt and see whether that makes sense. >>>>>> >>>>>> Lastly, a neat way to check is always to use your code on data from the >>>>>> tutorial, and vice versa, use code from the tutorial on your data and >>>>>> see whether that works. Both should give sensible results, and if one >>>>>> does not, you know where to start looking for a solution ;) >>>>>> >>>>>> Best, >>>>>> Jörn >>>>>> >>>>>> >>>>>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>>>>> Hey Jorn, >>>>>>> >>>>>>> Previously I have let ft_sourceanalysis do a lead field because if >>>>>>> I use the following code: >>>>>>> >>>>>>> % compute lead field ( apparently source analysis computes >>>>>>> % lead field anyway >>>>>>> cfg = []; >>>>>>> cfg.elec = timelock.elec; >>>>>>> cfg.vol = vol; >>>>>>> cfg.reducerank = 3; >>>>>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>>>>> cm resolution >>>>>>> cfg.grid.unit = 'cm'; >>>>>>> cfg.normalize = 'yes'; % if you are not >>>>>>> contrasting the activity of interest again another condition or >>>>>>> baseline time-window >>>>>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>>>>> I AM UP TO >>>>>>> >>>>>>> and then calculate the source analysis: >>>>>>> >>>>>>> % Source Analysis: without contrasting condition >>>>>>> cfg = []; >>>>>>> cfg.method = 'lcmv'; >>>>>>> cfg.grid = grid; >>>>>>> cfg.vol = vol; >>>>>>> % cfg.grid.pos = maxpos; >>>>>>> cfg.keepfilter = 'yes'; >>>>>>> cfg.dics.projectnoise = 'yes'; >>>>>>> % cfg.dics.lambda = 0; >>>>>>> source = ft_sourceanalysis( cfg, timelock); >>>>>>> >>>>>>> then I get an error than says: >>>>>>> >>>>>>> Error using * >>>>>>> Inner matrix dimensions must agree. >>>>>>> >>>>>>> Error in beamformer_lcmv (line 268) >>>>>>> filt = pinv(lf' * invCy * lf) * lf' * >>>>>>> invCy; % van Veen eqn. 23, use >>>>>>> PINV/SVD to cover rank deficient leadfield >>>>>>> >>>>>>> Error in ft_sourceanalysis (line 794) >>>>>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>>>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>>>>> optarg{:}); >>>>>>> >>>>>>> I just removed the leadfield code and it successfully ran. I could >>>>>>> also interpolate it later. >>>>>>> Is this the correct approach. >>>>>>> >>>>>>> Thankyou in advance! >>>>>>> >>>>>>> Tyler >>>>>>> >>>>>>> ************************* >>>>>>> >>>>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>>>> PhD Candidate >>>>>>> Brain Signals Laboratory >>>>>>> Flinders University >>>>>>> Rm 5A301 >>>>>>> Ext 66124 >>>>>>> >>>>>>> ________________________________________ >>>>>>> From: fieldtrip-bounces at science.ru.nl >>>>>>> on behalf of "Jörn M. Horschig" >>>>>>> >>>>>>> Sent: Monday, 31 March 2014 5:30 PM >>>>>>> To: FieldTrip discussion list >>>>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>>>> ft_sourceplot >>>>>>> >>>>>>> Hi Tyler, >>>>>>> >>>>>>> what you are describing sounds to me like the center bias of the >>>>>>> beamformer. Did you contrast the activity with anything, or did you >>>>>>> normalize your leadfield? >>>>>>> Check this out: >>>>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>>>>> >>>>>>> >>>>>>> Best, >>>>>>> Jörn >>>>>>> >>>>>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>>>>> I have been trying to plot my interpolated source data using the >>>>>>>> code: >>>>>>>> >>>>>>>> % interpolate sources >>>>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>>>> mri = ft_volumereslice([], mri); >>>>>>>> cfg = []; >>>>>>>> cfg.downsample = 2; >>>>>>>> cfg.parameter = 'avg.pow'; >>>>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>>>> parameter >>>>>>>> % does not vary over time, therefore the time >>>>>>>> dimension >>>>>>>> is not needed. >>>>>>>> >>>>>>>> % Plot interpolated data >>>>>>>> cfg = []; %#ok >>>>>>>> cfg.method = 'ortho'; % spline >>>>>>>> cfg.funparameter = 'avg.pow'; >>>>>>>> ft_sourceplot( cfg, sourceInt); >>>>>>>> >>>>>>>> However the figure that comes up just had orange squares in the >>>>>>>> subplots. >>>>>>>> >>>>>>>> I dont know where Ive gone wrong. >>>>>>>> >>>>>>>> >>>>>>>> Tyler >>>>>>>> >>>>>>>> >>>>>>>> ************************* >>>>>>>> >>>>>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>>>>> /PhD Candidate/ >>>>>>>> /Brain Signals Laboratory/ >>>>>>>> /Flinders University/ >>>>>>>> /Rm 5A301/ >>>>>>>> /Ext 66124/ >>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> fieldtrip mailing list >>>>>>>> fieldtrip at donders.ru.nl >>>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> -- >>>>>>> Jörn M. Horschig >>>>>>> PhD Student >>>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>>> Centre for Cognitive Neuroimaging >>>>>>> Radboud University Nijmegen >>>>>>> Neuronal Oscillations Group >>>>>>> FieldTrip Development Team >>>>>>> >>>>>>> P.O. Box 9101 >>>>>>> NL-6500 HB Nijmegen >>>>>>> The Netherlands >>>>>>> >>>>>>> Contact: >>>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>>> Tel: +31-(0)24-36-68493 >>>>>>> Web: http://www.ru.nl/donders >>>>>>> >>>>>>> Visiting address: >>>>>>> Trigon, room 2.30 >>>>>>> Kapittelweg 29 >>>>>>> NL-6525 EN Nijmegen >>>>>>> The Netherlands >>>>>>> >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> -- >>>>>> Jörn M. Horschig >>>>>> PhD Student >>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>> Centre for Cognitive Neuroimaging >>>>>> Radboud University Nijmegen >>>>>> Neuronal Oscillations Group >>>>>> FieldTrip Development Team >>>>>> >>>>>> P.O. Box 9101 >>>>>> NL-6500 HB Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> Contact: >>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>> Tel: +31-(0)24-36-68493 >>>>>> Web: http://www.ru.nl/donders >>>>>> >>>>>> Visiting address: >>>>>> Trigon, room 2.30 >>>>>> Kapittelweg 29 >>>>>> NL-6525 EN Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> -- >>>>> Jörn M. Horschig >>>>> PhD Student >>>>> Donders Institute for Brain, Cognition and Behaviour >>>>> Centre for Cognitive Neuroimaging >>>>> Radboud University Nijmegen >>>>> Neuronal Oscillations Group >>>>> FieldTrip Development Team >>>>> >>>>> P.O. Box 9101 >>>>> NL-6500 HB Nijmegen >>>>> The Netherlands >>>>> >>>>> Contact: >>>>> E-Mail: jm.horschig at donders.ru.nl >>>>> Tel: +31-(0)24-36-68493 >>>>> Web: http://www.ru.nl/donders >>>>> >>>>> Visiting address: >>>>> Trigon, room 2.30 >>>>> Kapittelweg 29 >>>>> NL-6525 EN Nijmegen >>>>> The Netherlands >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tyler.grummett at flinders.edu.au Fri Apr 4 07:23:48 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Fri, 4 Apr 2014 05:23:48 +0000 Subject: [FieldTrip] spatial and temporal ICA after beamformer Message-ID: Hello fieldtrip, I was wondering whether it was possible in the fieldtrip toolbox to run a spatial and temporal ICA on data after it has been run through ft_sourceanalysis (We can a LCMV beamformer on EEG data that had been timelocked). Currently it is saying that I need raw data for it to be processed. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Fri Apr 4 10:17:55 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 04 Apr 2014 10:17:55 +0200 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: References: Message-ID: <533E6AB3.3080003@donders.ru.nl> Hi Tyler, sorry, I realized too late that you want to use LCMV on ICA components - mostly because your approach resulted in many different erros ;). Afaik, it is not possible to use beamforming on ICA components. On Wednesday we talked about this in our weekly FieldTrip meeting and identified some occasions where FieldTrip is not handling IC-data well. This can lead to unexpected results and missing warnings or errors. However, you can use dipole modelling (like EEGlab does) or MNE if you want to. These should work with ICs. Any reason why you want to use LCMV on ICs? In theory, both steps constitute a spatial filter, so you can try to be smart and first to LCMV on all your channel level data, and then apply the LCMV spatial filter on the individual backprojected ICs. Somewhat a complicated procedure, but I think it would work? Best, Jörn On 4/4/2014 7:23 AM, Tyler Grummett wrote: > > Hello fieldtrip, > > > I was wondering whether it was possible in the fieldtrip toolbox to > run a spatial and temporal ICA on data after it has been run through > ft_sourceanalysis (We can a LCMV beamformer on EEG data that had been > timelocked). > > > Currently it is saying that I need raw data for it to be processed. > > > Tyler > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jan.schoffelen at donders.ru.nl Fri Apr 4 10:32:14 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 4 Apr 2014 10:32:14 +0200 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: <533E6AB3.3080003@donders.ru.nl> References: <533E6AB3.3080003@donders.ru.nl> Message-ID: Hi all, Allow me to chime in here. As I understand it Tyler wants to do ICA on the output of an LCMV beamformer. This is in general allowed, and can be done if you know how to handle the data. In Fieldtrip there is no pre-cooked way of doing it. What you need is to fool ft_componentanalysis into believing that your source reconstructed data is of the type 'raw'. To get started, you can have a look at http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors. In this particular tutorial, only a few 'virtual channels' are created. You probably want many of those, defined on a 3D grid. The only constraint there is probably the amount of RAM on your computer. Note that you want to do (and will do) temporal ICA in this case. Also, note that you probably should pre-PCA your data (this will be a parameter in the specs for the options for the ICA algorithm you are going to use). If you want to apply the ICA algorithm on amplitude envelope timeseries of band-limited activity, rumour has it that the fastica method works quite well. Cheers, Jan-Mathijs On Apr 4, 2014, at 10:17 AM, Jörn M. Horschig wrote: > Hi Tyler, > > sorry, I realized too late that you want to use LCMV on ICA components - mostly because your approach resulted in many different erros ;). Afaik, it is not possible to use beamforming on ICA components. On Wednesday we talked about this in our weekly FieldTrip meeting and identified some occasions where FieldTrip is not handling IC-data well. This can lead to unexpected results and missing warnings or errors. However, you can use dipole modelling (like EEGlab does) or MNE if you want to. These should work with ICs. > > Any reason why you want to use LCMV on ICs? In theory, both steps constitute a spatial filter, so you can try to be smart and first to LCMV on all your channel level data, and then apply the LCMV spatial filter on the individual backprojected ICs. Somewhat a complicated procedure, but I think it would work? > > Best, > Jörn > > > > On 4/4/2014 7:23 AM, Tyler Grummett wrote: >> >> Hello fieldtrip, >> >> >> I was wondering whether it was possible in the fieldtrip toolbox to run a spatial and temporal ICA on data after it has been run through ft_sourceanalysis (We can a LCMV beamformer on EEG data that had been timelocked). >> >> >> Currently it is saying that I need raw data for it to be processed. >> >> >> Tyler >> >> >> ************************* >> >> /Tyler Grummett ( BBSc, BSc(Hons I))/ >> /PhD Candidate/ >> /Brain Signals Laboratory/ >> /Flinders University/ >> /Rm 5A301/ >> /Ext 66124/ >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Fri Apr 4 11:37:25 2014 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Fri, 4 Apr 2014 10:37:25 +0100 Subject: [FieldTrip] 1 PostDoc + 2 PhD positions in Computational Cognitive NeuroImaging Message-ID: 2 PhD and 1 PostDoc positions in Computational Cognitive Neuroimaging; University of Birmingham, UK In our natural dynamic environment the senses are constantly bombarded with many different signals. How does the human brain integrate information from multiple senses during perception? To study the neural mechanisms of multisensory integration and learning, we combine psychophysics, functional imaging (fMRI, EEG/MEG & interleaved TMS-fMRI) and models of Bayesian Inference and learning. The Computational Cognitive Neuroimaging Group (Prof Uta Noppeney) is seeking 1 enthusiastic PostDoc and 2 PhD candidates. Applicants should have a strong quantitative background and a degree in neuroscience, psychology, computer science, physics, medicine or related areas. Prior experience in functional imaging, MatLab, data analysis and/or machine learning would be an advantage. The lab is part of the Computational Neuroscience and Cognitive Robotics Centre and the Department of Psychology of the University of Birmingham, UK. The centre provides an excellent multidisciplinary and collaborative research environment combining expertise in cognitive neuroimaging, psychophysics and computational neuroscience. The psychology department was rated 3rd in the UK research assessment exercise. Applications will be considered until the positions are filled. Starting dates are flexible. For further information, please contact u.noppeney at bham.ac.uk and see http://www.birmingham.ac.uk/research/activity/cncr/index.aspx< http://www.birmingham.ac.uk/schools/psychology/index.aspx> http://www.birmingham.ac.uk/schools/psychology/index.aspx< http://www.birmingham.ac.uk/schools/psychology/people/profile.aspx?ReferenceId=29516 > http://www.birmingham.ac.uk/schools/psychology/people/profile.aspx?ReferenceId=29516 For application to the PostDoc positions, please send applications to http://www.jobs.ac.uk/job/AIM528/research-fellow/ For application to the PhD positions, please send application including CV, statement of research interests, and the names and full contact details of two referees to: u.noppeney at bham.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From luca.turella at unitn.it Fri Apr 4 13:31:47 2014 From: luca.turella at unitn.it (Luca Turella) Date: Fri, 4 Apr 2014 13:31:47 +0200 Subject: [FieldTrip] PostDoc opportunity at CIMeC - Neural substrates and temporal dynamics of prehension (fMRI/MEG) Message-ID: PostDoc opportunity at CIMeC - University of Trento Neural substrates and temporal dynamics of prehension (fMRI/MEG) A postdoctoral position (funded by italian "FIRB 2013" grant) will be available soon at Center for Mind/Brain Sciences (CIMeC, www.unitn.it/en/cimec) at the University of Trento (Italy). The topic of investigation will cover the neural substrates and temporal dynamics of action representations during planning and execution. The focus of the project is on the investigation of the coding of prehension movements at the level of their neural representations using fMRI and at the level of their dynamics using MEG. The requirements for the candidates are the following. Candidates must have a Ph.D. degree in a field related to Cognitive Neuroscience. Previous experience with EEG/MEG or fMRI methods and data analysis is required. The ideal candidate should have good programming skills in Matlab, preferably related to EEG/MEG data analysis (Fieldtrip) and/or to fMRI data analysis (SPM/BrainVoyager). Knowledge of kinematic data analysis is also a plus. Knowledge of Italian language is not required. The Center for Mind/Brain Sciences at the University of Trento is an outstanding working place situated in a beautiful surrounding (e.g. Dolomites, Garda Lake; see http://www.visittrentino.it/en). CIMeC offers an international and vibrant research setting with access to state-of-the-art neuroimaging methodologies, including a research-only MR scanner, MEG, EEG and TMS, as well as behavioural, eye tracking and motion tracking laboratories. The University of Trento is ranked first among research universities in Italy and the Trentino region is consistently at the top for quality of life and for the most efficient services in Italy. English is the official language of the CIMeC, where a large proportion of the faculty, post-docs and students come from a wide range of countries outside of Italy. The salary will be proportional to the level of experience and the starting date of the appointment is negotiable, but within the next 6 months. Applications will be considered until the position is filled. The contract will have a duration of 2 years. Applications should be sent to luca.turella at unitn.it, including complete CV, statement of research interests, and contact details of two referees. Potential candidates are also encouraged to send me directly informal inquires luca.turella at unitn.it . -- Luca Turella, PhD Assistant Professor CIMeC - Center for Mind/Brain Sciences University of Trento Mattarello (TN), Via Delle Regole 101 Tel.+39 0461-28 3098 http://www.unitn.it/cimec -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Fri Apr 4 14:27:17 2014 From: julian.keil at gmail.com (Julian Keil) Date: Fri, 4 Apr 2014 14:27:17 +0200 Subject: [FieldTrip] =?iso-8859-1?q?PhD-Position_in_Multisensory_Integrati?= =?iso-8859-1?q?on_=28Charit=E9_Berlin=29?= Message-ID: <758A5578-4860-4834-B8AB-071E74B039A9@gmail.com> The Department of Psychiatry and Psychotherapy, Charité – Universitätsmedizin Berlin invites applications for a PhD position A project grant of the Deutsche Forschungsgemeinschaft (DFG), entitled “Predicting the multisensory future: Role of neuronal connectivity for integrative information processing across modalities“ will fund the currently open position (initially 24 months). The main objective of this project is to examine neural markers of multisensory integration and to test a new hypothesis that considers dynamic interplay of synchronized neural populations as a key to multisensory processes (Senkowski et al. 2008, TINS; Keil et al. 2013, Cerebral Cortex). The studies within this program include EEG, TMS and possibly other neuroimaging methods. Multisensory processes will be examined in a series of experiments requiring both bottom-up and top-down processing. Applicants should have a background in psychology, medicine, biology, physics, engineering, or neuroscience. Basic experience in human EEG or MEG studies, Matlab programming skills, as well as basic German language skills for interacting with the study participants are prerequisites for the position. An interest in neurophysiological studies including clinical populations is expected. Applicants are asked to submit their CV, a motivation letter including information about a possible starting date, 2 names of referees, and documentation of relevant qualifications (e.g., copies of diplomas and/or transcripts of grades) until April 30, 2014, electronically to: julian.keil at charite.de http://psy-ccm.charite.de/en/research/neuroimaging/multisensory_integration/ ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail URL: From Heng-RuMay.Tan at glasgow.ac.uk Fri Apr 4 15:12:04 2014 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Fri, 4 Apr 2014 14:12:04 +0100 Subject: [FieldTrip] MRC-Ph.D. Studentship at University of Glasgow Message-ID: <533EAFA4.9010105@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Fri Apr 4 16:19:11 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Fri, 4 Apr 2014 14:19:11 +0000 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: References: <533E6AB3.3080003@donders.ru.nl>, Message-ID: <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com> Hello All, So once I have calculated the preprocessing data, timelock data, headmodel, lead field and source. I have the following code to create virtual EEG channels of data (similar to the tutorial): % find sensor names and indices chans = ft_channelselection( 'EEG', data.label); chans = match_str( data.label, chans); % compute virtual channels virtual_chans = []; virtual_chans.label = data.label; virtual_chans.time = data.time; virtual_chans.trial = source.avg.filter{ 1} * timelock.trial{ 1}(chans,:); However as I have 642 source.avg.filter, which filter do I chose? Or do I calculate EEG channels for each voxel I landed with (I only had one trial). Btw, the source was calculated with the following code: cfg = []; cfg.method = 'lcmv'; cfg.grid.inside = grid.inside; cfg.grid.outside = []; cfg.vol = vol; cfg.keepfilter = 'yes'; source = ft_sourceanalysis( cfg, timelock); Thankyou for all the help you have provided me thus far. tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of jan-mathijs schoffelen Sent: Friday, 4 April 2014 7:02 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] spatial and temporal ICA after beamformer Hi all, Allow me to chime in here. As I understand it Tyler wants to do ICA on the output of an LCMV beamformer. This is in general allowed, and can be done if you know how to handle the data. In Fieldtrip there is no pre-cooked way of doing it. What you need is to fool ft_componentanalysis into believing that your source reconstructed data is of the type 'raw'. To get started, you can have a look at http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors. In this particular tutorial, only a few 'virtual channels' are created. You probably want many of those, defined on a 3D grid. The only constraint there is probably the amount of RAM on your computer. Note that you want to do (and will do) temporal ICA in this case. Also, note that you probably should pre-PCA your data (this will be a parameter in the specs for the options for the ICA algorithm you are going to use). If you want to apply the ICA algorithm on amplitude envelope timeseries of band-limited activity, rumour has it that the fastica method works quite well. Cheers, Jan-Mathijs On Apr 4, 2014, at 10:17 AM, Jörn M. Horschig wrote: Hi Tyler, sorry, I realized too late that you want to use LCMV on ICA components - mostly because your approach resulted in many different erros ;). Afaik, it is not possible to use beamforming on ICA components. On Wednesday we talked about this in our weekly FieldTrip meeting and identified some occasions where FieldTrip is not handling IC-data well. This can lead to unexpected results and missing warnings or errors. However, you can use dipole modelling (like EEGlab does) or MNE if you want to. These should work with ICs. Any reason why you want to use LCMV on ICs? In theory, both steps constitute a spatial filter, so you can try to be smart and first to LCMV on all your channel level data, and then apply the LCMV spatial filter on the individual backprojected ICs. Somewhat a complicated procedure, but I think it would work? Best, Jörn On 4/4/2014 7:23 AM, Tyler Grummett wrote: Hello fieldtrip, I was wondering whether it was possible in the fieldtrip toolbox to run a spatial and temporal ICA on data after it has been run through ft_sourceanalysis (We can a LCMV beamformer on EEG data that had been timelocked). Currently it is saying that I need raw data for it to be processed. Tyler ************************* /Tyler Grummett ( BBSc, BSc(Hons I))/ /PhD Candidate/ /Brain Signals Laboratory/ /Flinders University/ /Rm 5A301/ /Ext 66124/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Fri Apr 4 17:40:26 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Fri, 4 Apr 2014 15:40:26 +0000 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com> References: <533E6AB3.3080003@donders.ru.nl>, , <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com> Message-ID: <2E1BAFBE-15C2-46FD-B507-69A274CCB79D@flinders.edu.au> This line was meant to be: virtual_chans.trial = source.avg.filter{ 1} * data.trial{ 1}(chans,:); Tyler > On 5 Apr 2014, at 12:52 am, "Tyler Grummett" wrote: > > virtual_chans.trial = source.avg.filter{ 1} * timelock.trial{ 1}(chans,:); From dave at davebritton.com Fri Apr 4 19:35:09 2014 From: dave at davebritton.com (Dave Britton) Date: Fri, 04 Apr 2014 13:35:09 -0400 Subject: [FieldTrip] grandaveraging EEG question Message-ID: <533EED4D.1070904@davebritton.com> I have EEG data that consist of two separate file sets for each subject, and 20 subjects. When I process this to get ERPs for various conditions, does it matter if I just use ft_appenddata to concatenate all 40 files together and then run ft_timelockanalysis on the result, or should I use ft_grandaverage to combine the two runs for each subject, using the "within" parameter" and then combine the 20 resulting grandaverages with another call to ft_grandaverage using the "between parameter? -Dave From jm.horschig at donders.ru.nl Sat Apr 5 10:51:38 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Sat, 05 Apr 2014 10:51:38 +0200 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com> References: <533E6AB3.3080003@donders.ru.nl>, <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com> Message-ID: <533FC41A.8060309@donders.ru.nl> Hi Tyler, > However as I have 642 source.avg.filter, which filter do I chose? Or > do I calculate EEG channels for each voxel I landed with (I only had > one trial). Yep, you will (should) get 642 virtual channels, where each of these virtual channels correspond to the activity at the grid-point you specified when computing the spatial filter. Best, Jörn On 4/4/2014 4:19 PM, Tyler Grummett wrote: > > Hello All, > > > So once I have calculated the preprocessing data, timelock data, > headmodel, lead field and source. > > > I have the following code to create virtual EEG channels of data > (similar to the tutorial): > > % find sensor names and indices > chans = ft_channelselection( 'EEG', data.label); > chans = match_str( data.label, chans); > % compute virtual channels > virtual_chans = []; > virtual_chans.label = data.label; > virtual_chans.time = data.time; > virtual_chans.trial = source.avg.filter{ 1} * > timelock.trial{ 1}(chans,:); > > However as I have 642 source.avg.filter, which filter do I chose? Or > do I calculate EEG channels for each voxel I landed with (I only had > one trial). > > Btw, the source was calculated with the following code: > > ** > cfg = []; > cfg.method = 'lcmv'; > cfg.grid.inside = grid.inside; > cfg.grid.outside = []; > cfg.vol = vol; > cfg.keepfilter = 'yes'; > source = ft_sourceanalysis( cfg, timelock); > > Thankyou for all the help you have provided me thus far. > > tyler > > > > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > ------------------------------------------------------------------------ > *From:* fieldtrip-bounces at science.ru.nl > on behalf of jan-mathijs schoffelen > > *Sent:* Friday, 4 April 2014 7:02 PM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] spatial and temporal ICA after beamformer > Hi all, > > Allow me to chime in here. As I understand it Tyler wants to do ICA on > the output of an LCMV beamformer. This is in general allowed, and can > be done if you know how to handle the data. In Fieldtrip there is no > pre-cooked way of doing it. What you need is to fool > ft_componentanalysis into believing that your source reconstructed > data is of the type 'raw'. To get started, you can have a look at > http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors. In this > particular tutorial, only a few 'virtual channels' are created. You > probably want many of those, defined on a 3D grid. The only constraint > there is probably the amount of RAM on your computer. Note that you > want to do (and will do) temporal ICA in this case. Also, note that > you probably should pre-PCA your data (this will be a parameter in the > specs for the options for the ICA algorithm you are going to use). If > you want to apply the ICA algorithm on amplitude envelope timeseries > of band-limited activity, rumour has it that the fastica method works > quite well. > > Cheers, > Jan-Mathijs > > On Apr 4, 2014, at 10:17 AM, Jörn M. Horschig wrote: > >> Hi Tyler, >> >> sorry, I realized too late that you want to use LCMV on ICA >> components - mostly because your approach resulted in many different >> erros ;). Afaik, it is not possible to use beamforming on ICA >> components. On Wednesday we talked about this in our weekly FieldTrip >> meeting and identified some occasions where FieldTrip is not handling >> IC-data well. This can lead to unexpected results and missing >> warnings or errors. However, you can use dipole modelling (like >> EEGlab does) or MNE if you want to. These should work with ICs. >> >> Any reason why you want to use LCMV on ICs? In theory, both steps >> constitute a spatial filter, so you can try to be smart and first to >> LCMV on all your channel level data, and then apply the LCMV spatial >> filter on the individual backprojected ICs. Somewhat a complicated >> procedure, but I think it would work? >> >> Best, >> Jörn >> >> >> >> On 4/4/2014 7:23 AM, Tyler Grummett wrote: >>> >>> Hello fieldtrip, >>> >>> >>> I was wondering whether it was possible in the fieldtrip toolbox to >>> run a spatial and temporal ICA on data after it has been run through >>> ft_sourceanalysis (We can a LCMV beamformer on EEG data that had >>> been timelocked). >>> >>> >>> Currently it is saying that I need raw data for it to be processed. >>> >>> >>> Tyler >>> >>> >>> ************************* >>> >>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>> /PhD Candidate/ >>> /Brain Signals Laboratory/ >>> /Flinders University/ >>> /Rm 5A301/ >>> /Ext 66124/ >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From j.herring at fcdonders.ru.nl Sat Apr 5 22:20:53 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Sat, 5 Apr 2014 22:20:53 +0200 (CEST) Subject: [FieldTrip] grandaveraging EEG question In-Reply-To: <533EED4D.1070904@davebritton.com> References: <533EED4D.1070904@davebritton.com> Message-ID: Hi Dave, I would read in, and preprocess, the two files per subject and run ft_appenddata to combine the data from both files. Then I would run ft_timelockanalysis to get the erps for each condition. As soon as you have done this for all subjects, run ft_timelockgrandaverage to get the group averaged erps. Best, Jim > On 4 apr. 2014, at 19:38, Dave Britton wrote: > > I have EEG data that consist of two separate file sets for each subject, and 20 subjects. When I process this to get ERPs for various conditions, does it matter if I just use ft_appenddata to concatenate all 40 files together and then run ft_timelockanalysis on the result, or should I use ft_grandaverage to combine the two runs for each subject, using the "within" parameter" and then combine the 20 resulting grandaverages with another call to ft_grandaverage using the "between parameter? > -Dave > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tyler.grummett at flinders.edu.au Sun Apr 6 07:43:25 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Sun, 6 Apr 2014 05:43:25 +0000 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: <533FC41A.8060309@donders.ru.nl> References: <533E6AB3.3080003@donders.ru.nl>, <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com>, <533FC41A.8060309@donders.ru.nl> Message-ID: <99348662ba6848c587a589caa50167d4@SIXPR03MB368.apcprd03.prod.outlook.com> Hi Jorn, I think the fundamental issue with this is that the spatial filter has three dimensions, each corresponding to either x y or z. I must admit I am confused at this point, because I dont know whether to choose x, y or z or somehow combine them or have them as additional channels. >> source_inside.avg.filter ans = [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] etc.... Currently I am chosing only the first dimension ie source_inside.avg.filter{ 1}( 1, :) and then multiplying that by the data. for j = 1:numel( source_inside.avg.filter), temp{ j} = source_inside.avg.filter{ j}( 1, :) * data.trial{ 1}(chans,:); virtual_chans.trial( j, :) = temp{ j}; end to end up with: virtual_chans = label: {1x642 cell} time: {[1x19767 double]} trial: [642x19767 double] Like I said, I dont know what to with the 2nd and 3rd dimension filters. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" Sent: Saturday, 5 April 2014 7:21 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] spatial and temporal ICA after beamformer Hi Tyler, > However as I have 642 source.avg.filter, which filter do I chose? Or > do I calculate EEG channels for each voxel I landed with (I only had > one trial). Yep, you will (should) get 642 virtual channels, where each of these virtual channels correspond to the activity at the grid-point you specified when computing the spatial filter. Best, Jörn On 4/4/2014 4:19 PM, Tyler Grummett wrote: > > Hello All, > > > So once I have calculated the preprocessing data, timelock data, > headmodel, lead field and source. > > > I have the following code to create virtual EEG channels of data > (similar to the tutorial): > > % find sensor names and indices > chans = ft_channelselection( 'EEG', data.label); > chans = match_str( data.label, chans); > % compute virtual channels > virtual_chans = []; > virtual_chans.label = data.label; > virtual_chans.time = data.time; > virtual_chans.trial = source.avg.filter{ 1} * > timelock.trial{ 1}(chans,:); > > However as I have 642 source.avg.filter, which filter do I chose? Or > do I calculate EEG channels for each voxel I landed with (I only had > one trial). > > Btw, the source was calculated with the following code: > > ** > cfg = []; > cfg.method = 'lcmv'; > cfg.grid.inside = grid.inside; > cfg.grid.outside = []; > cfg.vol = vol; > cfg.keepfilter = 'yes'; > source = ft_sourceanalysis( cfg, timelock); > > Thankyou for all the help you have provided me thus far. > > tyler > > > > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > ------------------------------------------------------------------------ > *From:* fieldtrip-bounces at science.ru.nl > on behalf of jan-mathijs schoffelen > > *Sent:* Friday, 4 April 2014 7:02 PM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] spatial and temporal ICA after beamformer > Hi all, > > Allow me to chime in here. As I understand it Tyler wants to do ICA on > the output of an LCMV beamformer. This is in general allowed, and can > be done if you know how to handle the data. In Fieldtrip there is no > pre-cooked way of doing it. What you need is to fool > ft_componentanalysis into believing that your source reconstructed > data is of the type 'raw'. To get started, you can have a look at > http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors. In this > particular tutorial, only a few 'virtual channels' are created. You > probably want many of those, defined on a 3D grid. The only constraint > there is probably the amount of RAM on your computer. Note that you > want to do (and will do) temporal ICA in this case. Also, note that > you probably should pre-PCA your data (this will be a parameter in the > specs for the options for the ICA algorithm you are going to use). If > you want to apply the ICA algorithm on amplitude envelope timeseries > of band-limited activity, rumour has it that the fastica method works > quite well. > > Cheers, > Jan-Mathijs > > On Apr 4, 2014, at 10:17 AM, Jörn M. Horschig wrote: > >> Hi Tyler, >> >> sorry, I realized too late that you want to use LCMV on ICA >> components - mostly because your approach resulted in many different >> erros ;). Afaik, it is not possible to use beamforming on ICA >> components. On Wednesday we talked about this in our weekly FieldTrip >> meeting and identified some occasions where FieldTrip is not handling >> IC-data well. This can lead to unexpected results and missing >> warnings or errors. However, you can use dipole modelling (like >> EEGlab does) or MNE if you want to. These should work with ICs. >> >> Any reason why you want to use LCMV on ICs? In theory, both steps >> constitute a spatial filter, so you can try to be smart and first to >> LCMV on all your channel level data, and then apply the LCMV spatial >> filter on the individual backprojected ICs. Somewhat a complicated >> procedure, but I think it would work? >> >> Best, >> Jörn >> >> >> >> On 4/4/2014 7:23 AM, Tyler Grummett wrote: >>> >>> Hello fieldtrip, >>> >>> >>> I was wondering whether it was possible in the fieldtrip toolbox to >>> run a spatial and temporal ICA on data after it has been run through >>> ft_sourceanalysis (We can a LCMV beamformer on EEG data that had >>> been timelocked). >>> >>> >>> Currently it is saying that I need raw data for it to be processed. >>> >>> >>> Tyler >>> >>> >>> ************************* >>> >>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>> /PhD Candidate/ >>> /Brain Signals Laboratory/ >>> /Flinders University/ >>> /Rm 5A301/ >>> /Ext 66124/ >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From haiteng.jiang at gmail.com Sun Apr 6 09:54:38 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Sun, 6 Apr 2014 09:54:38 +0200 Subject: [FieldTrip] denoising data Message-ID: Hi Fred , This is an interesting/smart pipeline. However, I don't think it is proper to use EEG VEOG/ECG channel as reference on the IC component. The argument is that character of artifact components in EEG and MEG are different though similar . Best, Haiteng > > > > > Hi Ana, Haiteng and everyone else, > > I am joining in on this discussion as I am thinking about a way of > combining > ft_componentanalysis with ft_denoise_pca to remove EOG, ECG and EMG > activity. > > The pipeline that I would like to try is the following: > > %% ICA decomposition > cfg = []; > cfg.method = 'runica'; > > ICs = ft_componentanalysis(cfg,meg_data); % here meg_data has undergone > basic preprocessing including bp-filtering as well as > & ft_artifact_jump and > ft_artifact_clip > %% Substract artifacts from ICA components > cfg = []; > cfg.refchannel = eeg_data.label(1); % eeg_data contains the EOG (1-2), > ECG(3) and EMG(4) ref-channels > cfg.channel = {'runica'}; > cfg.zscore = 'yes'; > cfg.pertrial = 'yes'; > cfg.trials = 'all'; > > [ICs] = ft_denoise_pca(cfg,ICs,eeg_data); % substract VEOG activity from > all ICs > %% > > The idea is to repeat this step for all refchannels in order to substract > the artifacts. > > Then backproject ICs to original data: > > %% Backproject data > cfg = []; > meg_data = ft_rejectcomponent(cfg,ICs,meg_data); > > The advantage is that you don't have to "throw away" the entire component > as sometimes ICs > contain a mix of artifacts and brain activity. So by regressing out the > artifacts, you could > avoid throwing away the good stuff. > > However, I don't know if this is a good approach. There may be pitfalls > that I am not thinking > of right now. > Therefore any suggestions or comments about whether this is a good idea > would be very welcome! > I am hoping that some of the ft_guru's could drop a line or two about this! > > Fred > > > ----- Original Message ----- > From: "Haiteng Jiang" > To: fieldtrip at science.ru.nl > Sent: Thursday, April 3, 2014 8:27:30 AM > Subject: Re: [FieldTrip] denoising data > > > > > > > > Dear Ana, > > > If I understand correctly , we use ft_denoise_synthetic and ft_denoise_pca > to reduce noise due to recording (e.g. environment noise , thermal noise... > ) not the brain signal artefact (e.g eye blink). Normally ,I use these two > functions in the very early stage . > > Best, > Haiteng > > > > Message: 5 > Date: Thu, 3 Apr 2014 00:54:42 +0200 (CEST) > From: "Todorovic, A." < a.todorovic at fcdonders.ru.nl > > To: FieldTrip List < fieldtrip at donders.ru.nl > > Subject: [FieldTrip] denoising data > Message-ID: > < 124252612.215995.1396479282885.JavaMail.root at monoceros.zimbra.ru.nl > > Content-Type: text/plain; charset=utf-8 > > Dear 'trippers, > > I'm curious to hear your thoughts on how to best denoise data. What I'm > doing is working, but I'd like to hear whether it's logical or reasonable. > > In particular, I have two issues. One is that I use ICA to remove blinks, > so I have to fit denoising into a pipeline that incorporates ICA (which, I > am guessing, works well only without including reference channels). > > The other is that I see there are two functions for denoising, > ft_denoise_synthetic and ft_denoise_pca. > > In sum (1) I'm not really sure WHEN the best moment for denoising is, > given that I use ICA, and (2) I don't understand when it's better to use > ft_denoise_synthetic and when ft_denoise_pca. I do see that ft_denoise_pca > has the option of preprocessing reference channels separately, which makes > it easier to use after ICA. > > I used to know only about the first function, and my solution was to do > ft_denoise_synthetic (using the 'G3BR' option) prior to the ICA. Then I > would remove components which contain artifacts, and continue with making > ERF/TFRs/whatever. This produces data that is somewhat cleaner than when I > skip the denoising step. > > I was curious about the ft_denoise_pca when I saw it, so I tried running > it on filtered, preprocessed data that I had after I rejected ICA > components. [In the process of doing ICA, I used the ft_denoise_synthetic > option, as above.] This produced a different TFR at the end of the road, > which again looked cleaner. Significantly cleaner, actually, but N=1. > > Now I'm not sure if it was a logical step to use both denoising functions, > and if it would have been a better idea to do things differently. I'd like > to hear both whether something in the logic is wrong, and whether it's > inelegant. > > Cheers, > Ana > > > > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From sarathykousik at gmail.com Sun Apr 6 11:09:24 2014 From: sarathykousik at gmail.com (kousik sarathy) Date: Sun, 6 Apr 2014 11:09:24 +0200 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: <99348662ba6848c587a589caa50167d4@SIXPR03MB368.apcprd03.prod.outlook.com> References: <533E6AB3.3080003@donders.ru.nl> <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com> <533FC41A.8060309@donders.ru.nl> <99348662ba6848c587a589caa50167d4@SIXPR03MB368.apcprd03.prod.outlook.com> Message-ID: Hey Tyler, Check out the "Computation of virtual MEG channels in source-space" in this page (http://fieldtrip.fcdonders.nl/tutorial/connectivityextended). It gives some hints on what x-y-z components are, how to collapse it and use the filters. -- Regards, Kousik Sarathy, S On Sun, Apr 6, 2014 at 7:43 AM, Tyler Grummett < tyler.grummett at flinders.edu.au> wrote: > Hi Jorn, > > I think the fundamental issue with this is that the spatial filter has > three dimensions, each corresponding to either x y or z. > > I must admit I am confused at this point, because I dont know whether to > choose x, y or z or somehow combine them or have them as additional > channels. > > >> source_inside.avg.filter > > ans = > > [3x123 double] > [3x123 double] > [3x123 double] > [3x123 double] > [3x123 double] > [3x123 double] > [3x123 double] > [3x123 double] > [3x123 double] > [3x123 double] > etc.... > > Currently I am chosing only the first dimension ie > source_inside.avg.filter{ 1}( 1, :) and then multiplying that by the data. > > for j = 1:numel( source_inside.avg.filter), > temp{ j} = source_inside.avg.filter{ j}( 1, :) * > data.trial{ 1}(chans,:); > virtual_chans.trial( j, :) = temp{ j}; > end > > to end up with: > > virtual_chans = > > label: {1x642 cell} > time: {[1x19767 double]} > trial: [642x19767 double] > > Like I said, I dont know what to with the 2nd and 3rd dimension filters. > > Tyler > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl > on behalf of "Jörn M. Horschig" > Sent: Saturday, 5 April 2014 7:21 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] spatial and temporal ICA after beamformer > > Hi Tyler, > > > However as I have 642 source.avg.filter, which filter do I chose? Or > > do I calculate EEG channels for each voxel I landed with (I only had > > one trial). > > Yep, you will (should) get 642 virtual channels, where each of these > virtual channels correspond to the activity at the grid-point you > specified when computing the spatial filter. > > > Best, > Jörn > > > On 4/4/2014 4:19 PM, Tyler Grummett wrote: > > > > Hello All, > > > > > > So once I have calculated the preprocessing data, timelock data, > > headmodel, lead field and source. > > > > > > I have the following code to create virtual EEG channels of data > > (similar to the tutorial): > > > > % find sensor names and indices > > chans = ft_channelselection( 'EEG', data.label); > > chans = match_str( data.label, chans); > > % compute virtual channels > > virtual_chans = []; > > virtual_chans.label = data.label; > > virtual_chans.time = data.time; > > virtual_chans.trial = source.avg.filter{ 1} * > > timelock.trial{ 1}(chans,:); > > > > However as I have 642 source.avg.filter, which filter do I chose? Or > > do I calculate EEG channels for each voxel I landed with (I only had > > one trial). > > > > Btw, the source was calculated with the following code: > > > > ** > > cfg = []; > > cfg.method = 'lcmv'; > > cfg.grid.inside = grid.inside; > > cfg.grid.outside = []; > > cfg.vol = vol; > > cfg.keepfilter = 'yes'; > > source = ft_sourceanalysis( cfg, timelock); > > > > Thankyou for all the help you have provided me thus far. > > > > tyler > > > > > > > > > > > > ************************* > > > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > > /PhD Candidate/ > > /Brain Signals Laboratory/ > > /Flinders University/ > > /Rm 5A301/ > > /Ext 66124/ > > ------------------------------------------------------------------------ > > *From:* fieldtrip-bounces at science.ru.nl > > on behalf of jan-mathijs schoffelen > > > > *Sent:* Friday, 4 April 2014 7:02 PM > > *To:* FieldTrip discussion list > > *Subject:* Re: [FieldTrip] spatial and temporal ICA after beamformer > > Hi all, > > > > Allow me to chime in here. As I understand it Tyler wants to do ICA on > > the output of an LCMV beamformer. This is in general allowed, and can > > be done if you know how to handle the data. In Fieldtrip there is no > > pre-cooked way of doing it. What you need is to fool > > ft_componentanalysis into believing that your source reconstructed > > data is of the type 'raw'. To get started, you can have a look at > > http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors. In this > > particular tutorial, only a few 'virtual channels' are created. You > > probably want many of those, defined on a 3D grid. The only constraint > > there is probably the amount of RAM on your computer. Note that you > > want to do (and will do) temporal ICA in this case. Also, note that > > you probably should pre-PCA your data (this will be a parameter in the > > specs for the options for the ICA algorithm you are going to use). If > > you want to apply the ICA algorithm on amplitude envelope timeseries > > of band-limited activity, rumour has it that the fastica method works > > quite well. > > > > Cheers, > > Jan-Mathijs > > > > On Apr 4, 2014, at 10:17 AM, Jörn M. Horschig wrote: > > > >> Hi Tyler, > >> > >> sorry, I realized too late that you want to use LCMV on ICA > >> components - mostly because your approach resulted in many different > >> erros ;). Afaik, it is not possible to use beamforming on ICA > >> components. On Wednesday we talked about this in our weekly FieldTrip > >> meeting and identified some occasions where FieldTrip is not handling > >> IC-data well. This can lead to unexpected results and missing > >> warnings or errors. However, you can use dipole modelling (like > >> EEGlab does) or MNE if you want to. These should work with ICs. > >> > >> Any reason why you want to use LCMV on ICs? In theory, both steps > >> constitute a spatial filter, so you can try to be smart and first to > >> LCMV on all your channel level data, and then apply the LCMV spatial > >> filter on the individual backprojected ICs. Somewhat a complicated > >> procedure, but I think it would work? > >> > >> Best, > >> Jörn > >> > >> > >> > >> On 4/4/2014 7:23 AM, Tyler Grummett wrote: > >>> > >>> Hello fieldtrip, > >>> > >>> > >>> I was wondering whether it was possible in the fieldtrip toolbox to > >>> run a spatial and temporal ICA on data after it has been run through > >>> ft_sourceanalysis (We can a LCMV beamformer on EEG data that had > >>> been timelocked). > >>> > >>> > >>> Currently it is saying that I need raw data for it to be processed. > >>> > >>> > >>> Tyler > >>> > >>> > >>> ************************* > >>> > >>> /Tyler Grummett ( BBSc, BSc(Hons I))/ > >>> /PhD Candidate/ > >>> /Brain Signals Laboratory/ > >>> /Flinders University/ > >>> /Rm 5A301/ > >>> /Ext 66124/ > >>> > >>> > >>> _______________________________________________ > >>> fieldtrip mailing list > >>> fieldtrip at donders.ru.nl > >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> > >> -- > >> Jörn M. Horschig > >> PhD Student > >> Donders Institute for Brain, Cognition and Behaviour > >> Centre for Cognitive Neuroimaging > >> Radboud University Nijmegen > >> Neuronal Oscillations Group > >> FieldTrip Development Team > >> > >> P.O. Box 9101 > >> NL-6500 HB Nijmegen > >> The Netherlands > >> > >> Contact: > >> E-Mail: jm.horschig at donders.ru.nl > >> Tel: +31-(0)24-36-68493 > >> Web: http://www.ru.nl/donders > >> > >> Visiting address: > >> Trigon, room 2.30 > >> Kapittelweg 29 > >> NL-6525 EN Nijmegen > >> The Netherlands > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > Jan-Mathijs Schoffelen, MD PhD > > > > Donders Institute for Brain, Cognition and Behaviour, > > Centre for Cognitive Neuroimaging, > > Radboud University Nijmegen, The Netherlands > > > > Max Planck Institute for Psycholinguistics, > > Nijmegen, The Netherlands > > > > J.Schoffelen at donders.ru.nl > > Telephone: +31-24-3614793 > > > > http://www.hettaligebrein.nl > > > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Sun Apr 6 22:01:49 2014 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Sun, 6 Apr 2014 16:01:49 -0400 Subject: [FieldTrip] grandaveraging EEG question In-Reply-To: References: <533EED4D.1070904@davebritton.com> Message-ID: <32A64FF3-34C1-4260-B21E-E917E725B239@gmail.com> Hi Dave I would think that appending the data would weigh each subject by the number of trials, something that isn't done when we use timelock_grandaverage. Best, Raquel Sent from my iPhone > On Apr 5, 2014, at 4:20 PM, "Herring, J.D. (Jim)" wrote: > > Hi Dave, > > I would read in, and preprocess, the two files per subject and run ft_appenddata to combine the data from both files. Then I would run ft_timelockanalysis to get the erps for each condition. As soon as you have done this for all subjects, run ft_timelockgrandaverage to get the group averaged erps. > > Best, > > Jim > >> On 4 apr. 2014, at 19:38, Dave Britton wrote: >> >> I have EEG data that consist of two separate file sets for each subject, and 20 subjects. When I process this to get ERPs for various conditions, does it matter if I just use ft_appenddata to concatenate all 40 files together and then run ft_timelockanalysis on the result, or should I use ft_grandaverage to combine the two runs for each subject, using the "within" parameter" and then combine the 20 resulting grandaverages with another call to ft_grandaverage using the "between parameter? >> -Dave >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tyler.grummett at flinders.edu.au Mon Apr 7 02:18:28 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 7 Apr 2014 00:18:28 +0000 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: References: <533E6AB3.3080003@donders.ru.nl> <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com> <533FC41A.8060309@donders.ru.nl> <99348662ba6848c587a589caa50167d4@SIXPR03MB368.apcprd03.prod.outlook.com>, Message-ID: <4e7e440fb27846349d7033f7201328ce@SINPR03MB361.apcprd03.prod.outlook.com> ​Dear Kousik, Thank you very much, I was leading up to that tutorial but I didnt know that the information I was looking for was in it! Regards, Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of kousik sarathy Sent: Sunday, 6 April 2014 6:39 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] spatial and temporal ICA after beamformer Hey Tyler, Check out the "Computation of virtual MEG channels in source-space" in this page (http://fieldtrip.fcdonders.nl/tutorial/connectivityextended). It gives some hints on what x-y-z components are, how to collapse it and use the filters. -- Regards, Kousik Sarathy, S On Sun, Apr 6, 2014 at 7:43 AM, Tyler Grummett > wrote: Hi Jorn, I think the fundamental issue with this is that the spatial filter has three dimensions, each corresponding to either x y or z. I must admit I am confused at this point, because I dont know whether to choose x, y or z or somehow combine them or have them as additional channels. >> source_inside.avg.filter ans = [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] etc.... Currently I am chosing only the first dimension ie source_inside.avg.filter{ 1}( 1, :) and then multiplying that by the data. for j = 1:numel( source_inside.avg.filter), temp{ j} = source_inside.avg.filter{ j}( 1, :) * data.trial{ 1}(chans,:); virtual_chans.trial( j, :) = temp{ j}; end to end up with: virtual_chans = label: {1x642 cell} time: {[1x19767 double]} trial: [642x19767 double] Like I said, I dont know what to with the 2nd and 3rd dimension filters. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl > on behalf of "Jörn M. Horschig" > Sent: Saturday, 5 April 2014 7:21 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] spatial and temporal ICA after beamformer Hi Tyler, > However as I have 642 source.avg.filter, which filter do I chose? Or > do I calculate EEG channels for each voxel I landed with (I only had > one trial). Yep, you will (should) get 642 virtual channels, where each of these virtual channels correspond to the activity at the grid-point you specified when computing the spatial filter. Best, Jörn On 4/4/2014 4:19 PM, Tyler Grummett wrote: > > Hello All, > > > So once I have calculated the preprocessing data, timelock data, > headmodel, lead field and source. > > > I have the following code to create virtual EEG channels of data > (similar to the tutorial): > > % find sensor names and indices > chans = ft_channelselection( 'EEG', data.label); > chans = match_str( data.label, chans); > % compute virtual channels > virtual_chans = []; > virtual_chans.label = data.label; > virtual_chans.time = data.time; > virtual_chans.trial = source.avg.filter{ 1} * > timelock.trial{ 1}(chans,:); > > However as I have 642 source.avg.filter, which filter do I chose? Or > do I calculate EEG channels for each voxel I landed with (I only had > one trial). > > Btw, the source was calculated with the following code: > > ** > cfg = []; > cfg.method = 'lcmv'; > cfg.grid.inside = grid.inside; > cfg.grid.outside = []; > cfg.vol = vol; > cfg.keepfilter = 'yes'; > source = ft_sourceanalysis( cfg, timelock); > > Thankyou for all the help you have provided me thus far. > > tyler > > > > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > ------------------------------------------------------------------------ > *From:* fieldtrip-bounces at science.ru.nl > > on behalf of jan-mathijs schoffelen > > > *Sent:* Friday, 4 April 2014 7:02 PM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] spatial and temporal ICA after beamformer > Hi all, > > Allow me to chime in here. As I understand it Tyler wants to do ICA on > the output of an LCMV beamformer. This is in general allowed, and can > be done if you know how to handle the data. In Fieldtrip there is no > pre-cooked way of doing it. What you need is to fool > ft_componentanalysis into believing that your source reconstructed > data is of the type 'raw'. To get started, you can have a look at > http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors. In this > particular tutorial, only a few 'virtual channels' are created. You > probably want many of those, defined on a 3D grid. The only constraint > there is probably the amount of RAM on your computer. Note that you > want to do (and will do) temporal ICA in this case. Also, note that > you probably should pre-PCA your data (this will be a parameter in the > specs for the options for the ICA algorithm you are going to use). If > you want to apply the ICA algorithm on amplitude envelope timeseries > of band-limited activity, rumour has it that the fastica method works > quite well. > > Cheers, > Jan-Mathijs > > On Apr 4, 2014, at 10:17 AM, Jörn M. Horschig wrote: > >> Hi Tyler, >> >> sorry, I realized too late that you want to use LCMV on ICA >> components - mostly because your approach resulted in many different >> erros ;). Afaik, it is not possible to use beamforming on ICA >> components. On Wednesday we talked about this in our weekly FieldTrip >> meeting and identified some occasions where FieldTrip is not handling >> IC-data well. This can lead to unexpected results and missing >> warnings or errors. However, you can use dipole modelling (like >> EEGlab does) or MNE if you want to. These should work with ICs. >> >> Any reason why you want to use LCMV on ICs? In theory, both steps >> constitute a spatial filter, so you can try to be smart and first to >> LCMV on all your channel level data, and then apply the LCMV spatial >> filter on the individual backprojected ICs. Somewhat a complicated >> procedure, but I think it would work? >> >> Best, >> Jörn >> >> >> >> On 4/4/2014 7:23 AM, Tyler Grummett wrote: >>> >>> Hello fieldtrip, >>> >>> >>> I was wondering whether it was possible in the fieldtrip toolbox to >>> run a spatial and temporal ICA on data after it has been run through >>> ft_sourceanalysis (We can a LCMV beamformer on EEG data that had >>> been timelocked). >>> >>> >>> Currently it is saying that I need raw data for it to be processed. >>> >>> >>> Tyler >>> >>> >>> ************************* >>> >>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>> /PhD Candidate/ >>> /Brain Signals Laboratory/ >>> /Flinders University/ >>> /Rm 5A301/ >>> /Ext 66124/ >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl > >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl > >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Mon Apr 7 07:49:23 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 7 Apr 2014 05:49:23 +0000 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: References: <533E6AB3.3080003@donders.ru.nl> <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com> <533FC41A.8060309@donders.ru.nl> <99348662ba6848c587a589caa50167d4@SIXPR03MB368.apcprd03.prod.outlook.com>, Message-ID: Hello all, Im really interested in calculating granger causality using method in connectivity extended (last bit of the document). Specifically, I would like to compute the spectrally resolved granger connectivity. How would one go about doing that? Is it just be cfg = []; cfg.output = 'fourier'; cfg.method = 'mtmfft'; cfg.foilim = [5 100]; cfg.tapsmofrq = 5; cfg.keeptrials = 'yes'; cfg.channel = {'visual' 'motor' 'EMGlft' 'EMGrgt'}; freq = ft_freqanalysis(cfg, combineddata); cfg = []; cfg.method = 'granger'; coherence = ft_connectivityanalysis(cfg, freq); or would you need to calculate multivariate autoregressive coefficients. Because my data keeps crashing when I try to running it. cfg = []; cfg.order = 5; cfg.toolbox = 'bsmart'; mdata = ft_mvaranalysis( cfg, comp);​ With an error of: Index exceeds matrix dimensions. Error in ft_mvaranalysis (line 321) tmpcfg.toilim = [timeaxis(sample-floor(tfwin/2)) timeaxis(sample+ceil(tfwin/2)-1)];​ Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of kousik sarathy Sent: Sunday, 6 April 2014 6:39 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] spatial and temporal ICA after beamformer Hey Tyler, Check out the "Computation of virtual MEG channels in source-space" in this page (http://fieldtrip.fcdonders.nl/tutorial/connectivityextended). It gives some hints on what x-y-z components are, how to collapse it and use the filters. -- Regards, Kousik Sarathy, S On Sun, Apr 6, 2014 at 7:43 AM, Tyler Grummett > wrote: Hi Jorn, I think the fundamental issue with this is that the spatial filter has three dimensions, each corresponding to either x y or z. I must admit I am confused at this point, because I dont know whether to choose x, y or z or somehow combine them or have them as additional channels. >> source_inside.avg.filter ans = [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] etc.... Currently I am chosing only the first dimension ie source_inside.avg.filter{ 1}( 1, :) and then multiplying that by the data. for j = 1:numel( source_inside.avg.filter), temp{ j} = source_inside.avg.filter{ j}( 1, :) * data.trial{ 1}(chans,:); virtual_chans.trial( j, :) = temp{ j}; end to end up with: virtual_chans = label: {1x642 cell} time: {[1x19767 double]} trial: [642x19767 double] Like I said, I dont know what to with the 2nd and 3rd dimension filters. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl > on behalf of "Jörn M. Horschig" > Sent: Saturday, 5 April 2014 7:21 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] spatial and temporal ICA after beamformer Hi Tyler, > However as I have 642 source.avg.filter, which filter do I chose? Or > do I calculate EEG channels for each voxel I landed with (I only had > one trial). Yep, you will (should) get 642 virtual channels, where each of these virtual channels correspond to the activity at the grid-point you specified when computing the spatial filter. Best, Jörn On 4/4/2014 4:19 PM, Tyler Grummett wrote: > > Hello All, > > > So once I have calculated the preprocessing data, timelock data, > headmodel, lead field and source. > > > I have the following code to create virtual EEG channels of data > (similar to the tutorial): > > % find sensor names and indices > chans = ft_channelselection( 'EEG', data.label); > chans = match_str( data.label, chans); > % compute virtual channels > virtual_chans = []; > virtual_chans.label = data.label; > virtual_chans.time = data.time; > virtual_chans.trial = source.avg.filter{ 1} * > timelock.trial{ 1}(chans,:); > > However as I have 642 source.avg.filter, which filter do I chose? Or > do I calculate EEG channels for each voxel I landed with (I only had > one trial). > > Btw, the source was calculated with the following code: > > ** > cfg = []; > cfg.method = 'lcmv'; > cfg.grid.inside = grid.inside; > cfg.grid.outside = []; > cfg.vol = vol; > cfg.keepfilter = 'yes'; > source = ft_sourceanalysis( cfg, timelock); > > Thankyou for all the help you have provided me thus far. > > tyler > > > > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > ------------------------------------------------------------------------ > *From:* fieldtrip-bounces at science.ru.nl > > on behalf of jan-mathijs schoffelen > > > *Sent:* Friday, 4 April 2014 7:02 PM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] spatial and temporal ICA after beamformer > Hi all, > > Allow me to chime in here. As I understand it Tyler wants to do ICA on > the output of an LCMV beamformer. This is in general allowed, and can > be done if you know how to handle the data. In Fieldtrip there is no > pre-cooked way of doing it. What you need is to fool > ft_componentanalysis into believing that your source reconstructed > data is of the type 'raw'. To get started, you can have a look at > http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors. In this > particular tutorial, only a few 'virtual channels' are created. You > probably want many of those, defined on a 3D grid. The only constraint > there is probably the amount of RAM on your computer. Note that you > want to do (and will do) temporal ICA in this case. Also, note that > you probably should pre-PCA your data (this will be a parameter in the > specs for the options for the ICA algorithm you are going to use). If > you want to apply the ICA algorithm on amplitude envelope timeseries > of band-limited activity, rumour has it that the fastica method works > quite well. > > Cheers, > Jan-Mathijs > > On Apr 4, 2014, at 10:17 AM, Jörn M. Horschig wrote: > >> Hi Tyler, >> >> sorry, I realized too late that you want to use LCMV on ICA >> components - mostly because your approach resulted in many different >> erros ;). Afaik, it is not possible to use beamforming on ICA >> components. On Wednesday we talked about this in our weekly FieldTrip >> meeting and identified some occasions where FieldTrip is not handling >> IC-data well. This can lead to unexpected results and missing >> warnings or errors. However, you can use dipole modelling (like >> EEGlab does) or MNE if you want to. These should work with ICs. >> >> Any reason why you want to use LCMV on ICs? In theory, both steps >> constitute a spatial filter, so you can try to be smart and first to >> LCMV on all your channel level data, and then apply the LCMV spatial >> filter on the individual backprojected ICs. Somewhat a complicated >> procedure, but I think it would work? >> >> Best, >> Jörn >> >> >> >> On 4/4/2014 7:23 AM, Tyler Grummett wrote: >>> >>> Hello fieldtrip, >>> >>> >>> I was wondering whether it was possible in the fieldtrip toolbox to >>> run a spatial and temporal ICA on data after it has been run through >>> ft_sourceanalysis (We can a LCMV beamformer on EEG data that had >>> been timelocked). >>> >>> >>> Currently it is saying that I need raw data for it to be processed. >>> >>> >>> Tyler >>> >>> >>> ************************* >>> >>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>> /PhD Candidate/ >>> /Brain Signals Laboratory/ >>> /Flinders University/ >>> /Rm 5A301/ >>> /Ext 66124/ >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl > >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl > >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From lmelloni at gmail.com Mon Apr 7 12:45:22 2014 From: lmelloni at gmail.com (Lucia Melloni) Date: Mon, 7 Apr 2014 06:45:22 -0400 Subject: [FieldTrip] Applications open for the Neurobiology of Cognition GRC/GRS! In-Reply-To: References: Message-ID: Dear colleague, Applications are now open for the Gordon Research Seminar (GRS) and Conference (GRC) on the Neurobiology of Cognition to be held from the 19-20 July (Seminar) and 20-25 July (Conference), 2014. Space is limited. Don't forger to apply soon! Looking forward to seeing you at the GRS/GRC! Lucia Melloni. Ayelet A. Landau [image: Gordon Research Conferences] Join us at the 2014 *Gordon Conference* and *Seminar* On *Neurobiology of Cognition* Circuits, Dynamics, Action and Perception We are meeting *July 20-25, 2014 -*New GRC site: *Sunday River Resort* Newry, Maine Click *here*to see the *GRC* program. There is also an associated *GRS* *July 19-20 *for students and postdocs Click *here*to see the *GRS* website. *GRS* application & abstract deadline to be considered for oral presentation- *April 30* *Please use attached **flyer **to help spread the word! * The Neurobiology of Cognition is a recently-inaugurated GRC designed to foster convergence of traditional neuroscience investigations with more recent developments in systems, cellular and molecular neurobiology, in engineering and imaging and in computational sciences. Cognition is construed broadly to embrace empirical findings in a range of species including humans, and there is a strong focus on integration of findings and principles across species and levels of analysis. In the opening Keynote Session, two leading neuroscientists with provide an experimental and computational perspective on the recent initiative, termed Brain Research through Advancing Innovative Neurotechnologies (BRAIN). This initiative, spearheaded by the President and NIH, is aimed at developing innovative methodologies to study how complex systems of neurons interact in time and in space during complex behaviors. Along with recent findings in a few traditional "core" areas, formal sessions will then explore several new themes, including: 1) the neuroanatomy and 2) coordination of cognitive circuits in the brain, 3) motor cognition and brain-computer interfaces, 4) music and language, and 5) learning and plasticity. The program juxtaposes human psychophysical, neuroimaging and electrophysiological studies with parallel investigations in rodents and non-human primates, and with computational approaches that explicate empirical findings and construct robust, detailed models to represent the developing picture and guide future experimentation. The program also underscores novel experimental and theoretical approaches that promise to define fundamental principles that guide and integrate the understanding of cognition at a fundamental level, and to extend these to improved treatment of brain dysfunction. The format of the meeting promotes intensive interactions among investigators and trainees from different perspectives and analytic levels, and in particular, between experimentalists and theorists. There is a linked Gordon Research Seminar for trainees, most of whom also attend the GRC. All that is missing now is your *application* to attend. Click *here*for the *GRC*. Click* here*for the *GRS*. (You must apply to both to attend both.) Best regards, GRC Chair: *Charles E. Schroeder* GRC V. Chair:*Tatiana Pasternak* GRS Chair: *Lucia Melloni* GRS Assoc. Chair: *Ayelet N. Landau* *Apply* now and see why our attendees consistently rate GRCs "the best conference I've attended this year"! [image: Like us on Facebook] [image: Follow us on Twitter] [image: View our profile on LinkedIn] *Forward this email * -- -- Lucia. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Tue Apr 8 04:48:08 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 8 Apr 2014 02:48:08 +0000 Subject: [FieldTrip] ft_sourceanalysis using LCMV beamformer and grid from ft_prepare_leadfield Message-ID: Hello fieldtrip, I am trying to perform an LCMV beamformer on timelockanalysis data. timelock = avg: [124x20517 double] var: [124x20517 double] time: [1x20517 double] dof: [124x20517 double] label: {1x124 cell} dimord: 'chan_time' cov: [124x124 double] elec: [1x1 struct] cfg: [1x1 struct] I first run ft_prepare_leadfield cfg = []; cfg.elec = timelock.elec; cfg.vol = vol; cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution cfg.grid.unit = 'cm'; cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window grid = ft_prepare_leadfield( cfg); grid = xgrid: [-5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8] ygrid: [-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7] zgrid: [0 1 2 3 4 5 6 7 8 9 10 11 12] dim: [14 14 13] pos: [2548x3 double] unit: 'cm' inside: [1x1409 double] outside: [1x1139 double] cfg: [1x1 struct] leadfield: {1x2548 cell} I then try to run the ft_sourceanalysis code: cfg = []; cfg.channel = timelock.label; cfg.method = 'lcmv'; cfg.grid = grid; cfg.vol = vol; cfg.keepfilter = 'yes'; source = ft_sourceanalysis( cfg, timelock); And it crashes with the error message: Error using * Inner matrix dimensions must agree. Error in beamformer_lcmv (line 268) filt = pinv(lf' * invCy * lf) * lf' * invCy; % van Veen eqn. 23, use PINV/SVD to cover rank deficient leadfield Error in ft_sourceanalysis (line 794) dip(i) = beamformer_lcmv(grid, sens, vol, squeeze_avg, squeeze(Cy(i,:,:)), optarg{:}); However, the code does work if it is: cfg = []; cfg.channel = timelock.label; cfg.method = 'lcmv'; cfg.grid.inside = grid.inside; cfg.vol = vol; cfg.keepfilter = 'yes'; source = ft_sourceanalysis( cfg, timelock); However, I run the sourceplot code produces something that looks like the picture attached. What is interesting is that when I run the interp code: the input is source data with 16777216 positions on a [256 256 256] grid not plotting anatomy But when you run the same code from sourcePost_nocon from the beamformer tutorial, you get the following when you run the code: the input is source data with 3042 positions on a [18 13 13] grid the input is volume data with dimensions [256 256 256] I have used the same mri file for both. ? Please help, I cant work out the issue. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: sourceplot_example.png Type: image/png Size: 15766 bytes Desc: sourceplot_example.png URL: From tyler.grummett at flinders.edu.au Tue Apr 8 07:15:08 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 8 Apr 2014 05:15:08 +0000 Subject: [FieldTrip] ft_sourceanalysis using LCMV beamformer and grid from ft_prepare_leadfield In-Reply-To: References: Message-ID: <4b26ee20682b439b8bca1332f9ec9d66@SIXPR03MB368.apcprd03.prod.outlook.com> Fieldtrip, Ive got it working now. The follow error: ***************************************************************** Error using * Inner matrix dimensions must agree. Error in beamformer_lcmv (line 268) filt = pinv(lf' * invCy * lf) * lf' * invCy; % van Veen eqn. 23, use PINV/SVD to cover rank deficient leadfield Error in ft_sourceanalysis (line 794) dip(i) = beamformer_lcmv(grid, sens, vol, squeeze_avg, squeeze(Cy(i,:,:)), optarg{:}); ***************************************************************** It is because: if is 128x3 invCy is 124x124 When I ran the code: cfg = []; cfg.channel = 'EEG'; % only works for preprocessing cfg.vartrllength = 2; % accept variable length trials cfg.covariance = 'yes'; cfg.covariancewindow = 'all'; cfg.keeptrials = 'no'; timelock = ft_timelockanalysis(cfg, data); It did the timelockanalysis on 124 channels, but it didnt remove the non-EEG channels from timelock.elec and so the four EOG channels explains the 128. timelock = avg: [124x11758 double] var: [124x11758 double] time: [1x11758 double] dof: [124x11758 double] label: {1x124 cell} dimord: 'chan_time' cov: [124x124 double] elec: [1x1 struct] cfg: [1x1 struct] timelock.elec = chanpos: [128x3 double] elecpos: [128x3 double] label: {1x128 cell} type: 'eeg1005' unit: 'mm' I dont know if this is a bug or not. Please advise. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Tyler Grummett Sent: Tuesday, 8 April 2014 12:18 PM To: FieldTrip discussion list Subject: [FieldTrip] ft_sourceanalysis using LCMV beamformer and grid from ft_prepare_leadfield Hello fieldtrip, I am trying to perform an LCMV beamformer on timelockanalysis data. timelock = avg: [124x20517 double] var: [124x20517 double] time: [1x20517 double] dof: [124x20517 double] label: {1x124 cell} dimord: 'chan_time' cov: [124x124 double] elec: [1x1 struct] cfg: [1x1 struct] I first run ft_prepare_leadfield cfg = []; cfg.elec = timelock.elec; cfg.vol = vol; cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution cfg.grid.unit = 'cm'; cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window grid = ft_prepare_leadfield( cfg); grid = xgrid: [-5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8] ygrid: [-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7] zgrid: [0 1 2 3 4 5 6 7 8 9 10 11 12] dim: [14 14 13] pos: [2548x3 double] unit: 'cm' inside: [1x1409 double] outside: [1x1139 double] cfg: [1x1 struct] leadfield: {1x2548 cell} I then try to run the ft_sourceanalysis code: cfg = []; cfg.channel = timelock.label; cfg.method = 'lcmv'; cfg.grid = grid; cfg.vol = vol; cfg.keepfilter = 'yes'; source = ft_sourceanalysis( cfg, timelock); And it crashes with the error message: Error using * Inner matrix dimensions must agree. Error in beamformer_lcmv (line 268) filt = pinv(lf' * invCy * lf) * lf' * invCy; % van Veen eqn. 23, use PINV/SVD to cover rank deficient leadfield Error in ft_sourceanalysis (line 794) dip(i) = beamformer_lcmv(grid, sens, vol, squeeze_avg, squeeze(Cy(i,:,:)), optarg{:}); However, the code does work if it is: cfg = []; cfg.channel = timelock.label; cfg.method = 'lcmv'; cfg.grid.inside = grid.inside; cfg.vol = vol; cfg.keepfilter = 'yes'; source = ft_sourceanalysis( cfg, timelock); However, I run the sourceplot code produces something that looks like the picture attached. What is interesting is that when I run the interp code: the input is source data with 16777216 positions on a [256 256 256] grid not plotting anatomy But when you run the same code from sourcePost_nocon from the beamformer tutorial, you get the following when you run the code: the input is source data with 3042 positions on a [18 13 13] grid the input is volume data with dimensions [256 256 256] I have used the same mri file for both. ? Please help, I cant work out the issue. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.todorovic at fcdonders.ru.nl Tue Apr 8 07:25:18 2014 From: a.todorovic at fcdonders.ru.nl (Todorovic, A.) Date: Tue, 8 Apr 2014 07:25:18 +0200 (CEST) Subject: [FieldTrip] denoising data Message-ID: <818248357.305942.1396934718615.JavaMail.root@monoceros.zimbra.ru.nl> Hi Haiteng, Thanks for your reply. Just to be sure if I understand you correctly - do you use BOTH denoise_pca and denoise_synthetic on the same data? If not, how do you choose which one to use? Cheers, Ana > > Dear Ana, > > > If I understand correctly , we use ft_denoise_synthetic and > ft_denoise_pca to reduce noise due to recording (e.g. environment noise , > thermal noise... ) not the brain signal artefact (e.g eye blink). Normally > ,I use these two functions in the very early stage . > > Best, > Haiteng From marlene.boenstrup at googlemail.com Tue Apr 8 09:07:46 2014 From: marlene.boenstrup at googlemail.com (=?ISO-8859-1?Q?Marlene_B=F6nstrup?=) Date: Tue, 8 Apr 2014 09:07:46 +0200 Subject: [FieldTrip] surfaceplot made by ft_sourceplot sparing the frontal lobes Message-ID: Dear fieldtrip-experts, The plot I generated by ft_sourceplot using cfg.method = 'surface' with either projectionemthod 'nearest' or 'project' looks funny. The frontal lobes don't show any activation, they are just left grey. And also specific activations on the cortex are shifted towards the back (y-axis). I compared the same 3-D- sourceactivation data (interpolated on the standard T1 output of ft_interpolate with ft_interpolate) in an orthoplot and there the sourceactivation is neatly arranged in the whole brain volume, including the frontal lobes. So that the mistake must origin in the ft_sourceplot function. I use the version of the 18th of December 2013. Do you know this problem and can help me with it? If not, do you have an idea to solve it or cirumvent it? Thanks in advance, Marlene -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Tue Apr 8 10:59:00 2014 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Tue, 8 Apr 2014 10:59:00 +0200 Subject: [FieldTrip] surfaceplot made by ft_sourceplot sparing the frontal lobes In-Reply-To: References: Message-ID: Hi Marlene, Could you download today's version of FieldTrip, and let us know whether this problem still occurs? I'm saying because we just made an update to surface plotting, potentially solving your issue. Best, Arjen 2014-04-08 9:07 GMT+02:00 Marlene Bönstrup : > Dear fieldtrip-experts, > > The plot I generated by ft_sourceplot using cfg.method = 'surface' with > either projectionemthod 'nearest' or 'project' looks funny. The frontal > lobes don't show any activation, they are just left grey. And also specific > activations on the cortex are shifted towards the back (y-axis). I compared > the same 3-D- sourceactivation data (interpolated on the standard T1 output > of ft_interpolate with ft_interpolate) in an orthoplot and there the > sourceactivation is neatly arranged in the whole brain volume, including > the frontal lobes. So that the mistake must origin in the ft_sourceplot > function. > I use the version of the 18th of December 2013. > > Do you know this problem and can help me with it? > If not, do you have an idea to solve it or cirumvent it? > > Thanks in advance, > Marlene > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Tue Apr 8 11:01:47 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 8 Apr 2014 09:01:47 +0000 Subject: [FieldTrip] fieldtrip2eeglab Message-ID: <36a06a30eef54304859a734a2deb7153@SIXPR03MB368.apcprd03.prod.outlook.com> ?Hey fieldtrip, Is there a fieldtrip2eeglab function somewhere? It says in the documentation of 'integrating with eeglab', and I was wondering whether there already was one. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Tue Apr 8 11:19:34 2014 From: julian.keil at gmail.com (Julian Keil) Date: Tue, 8 Apr 2014 11:19:34 +0200 Subject: [FieldTrip] fieldtrip2eeglab References: Message-ID: <60EC99B5-A742-420D-84A2-3B86336EB37A@gmail.com> Hi Tyler, there was a mail by Arno Delorme last year containing the function. See below. Best, Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Anfang der weitergeleiteten E-Mail: > Von: Arnaud Delorme > Betreff: Re: [FieldTrip] Channel layout FT to EEGLAB > Datum: 29. Oktober 2013 01:27:53 MEZ > An: FieldTrip discussion list > Antwort an: FieldTrip discussion list > > Dear Rajat, > > this old function transforms EEG data contained in the Fieldtrip structure into an EEGLAB structure. > After you have done that, to transform a channel location file, simply type in > > EEG.chanlocs = struct('labels', cfg.elec.label, 'X', mattocell(cfg.elec.pnt(1,:)), 'Y', mattocell(cfg.elec.pnt(2,:)),'Z', mattocell(cfg.elec.pnt(3,:))); > EEG.chanlocs = convertlocs(EEG.chanlocs, 'cart2all'); > > This code is untested. You might have to switch X, Y and Z to obtain the correct orientation for the electrode cap. > Best, > > Arno > > > > On Oct 28, 2013, at 7:36 AM, Raquel Bibi wrote: > >> Hi Rajat, >> I don't know EEGLAB, but I use the "ordered" option in Fieldtrip to display my time-locked ICA components. >> >> Best, >> >> Raquel >> >> >> On Mon, Oct 28, 2013 at 9:39 AM, Rajat Thomas wrote: >> Dear all, >> >> I made a layout file using the image of the ecog array I had, just like described in the >> tutorial. >> >> I would like to port this to EEGLAB, so that I can use the various ICA options to plot >> the components at the channel locations and so on. >> >> Could anyone either point me to a file that does this conversion? or >> Any way of using ICA within fieldtrip to plot the various components on the different >> channels using the layout file? >> >> I know it is used for channel rejection and so on but any help on plotting the components >> back on the ICA would be appreciated. >> >> Thanks a lot in advance. >> >> Rajat >> >> -- >> Rajat Mani Thomas >> Netherlands Institute for Neuroscience >> Amsterdam, The Netherlands >> http://www.cita.utoronto.ca/~thomas >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fieldtrip2eeglab.m Type: application/octet-stream Size: 1141 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.rombetto at cib.na.cnr.it Tue Apr 8 11:51:12 2014 From: s.rombetto at cib.na.cnr.it (s.rombetto at cib.na.cnr.it) Date: Tue, 8 Apr 2014 11:51:12 +0200 Subject: [FieldTrip] denoising data In-Reply-To: <818248357.305942.1396934718615.JavaMail.root@monoceros.zimbra.ru.nl> References: <818248357.305942.1396934718615.JavaMail.root@monoceros.zimbra.ru.nl> Message-ID: <20140408115112.cn1ddeuo840s8s84@arco.cib.na.cnr.it> Hi I am interested in this topic too. As I have mainly environmental noise I use denoise_pca but I would like to understand if with a different code I couold improve my S/N ratio. Moreover I would ask if there is any difference if you apply first one denoising procedure or the other. Regards Sara Rombetto, PhD > Hi Haiteng, > > Thanks for your reply. > > Just to be sure if I understand you correctly - do you use BOTH > denoise_pca and denoise_synthetic on the same data? > > If not, how do you choose which one to use? > > Cheers, > Ana > >> >> Dear Ana, >> >> >> If I understand correctly , we use ft_denoise_synthetic and >> ft_denoise_pca to reduce noise due to recording (e.g. environment noise , >> thermal noise... ) not the brain signal artefact (e.g eye blink). Normally >> ,I use these two functions in the very early stage . >> >> Best, >> Haiteng > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > ------------------------- Dott.ssa Sara Rombetto Istituto di Cibernetica "E. Caianiello" Via Campi Flegrei, 34 80078 Pozzuoli (NA) Italy mob +39 3401689815 tel +39 0818675361 fax +39 0818675128 Lab MEG 0817483511 -------------------------- "I disapprove of what you say, but I will defend to the death your right to say it." [Evelyn Beatrice Hall, The Friends Of Voltaire] ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. From marlene.boenstrup at googlemail.com Tue Apr 8 13:31:25 2014 From: marlene.boenstrup at googlemail.com (=?ISO-8859-1?Q?Marlene_B=F6nstrup?=) Date: Tue, 8 Apr 2014 13:31:25 +0200 Subject: [FieldTrip] fieldtrip Digest, Vol 41, Issue 16 In-Reply-To: References: Message-ID: Dear Arjen, thanks for your quick reply. With the version of sunday (yesterdays version the file was invalid, my windows couldn't open it and there is not yet a version of today) the misplotting still occurs. I dont know if attachments work in this email list, but attached there is the surface and the orthoplot of exactly the same interploated data. 2014-04-08 12:00 GMT+02:00 : > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: denoising data (Todorovic, A.) > 2. surfaceplot made by ft_sourceplot sparing the frontal lobes > (Marlene B?nstrup) > 3. Re: surfaceplot made by ft_sourceplot sparing the frontal > lobes (Arjen Stolk) > 4. fieldtrip2eeglab (Tyler Grummett) > 5. fieldtrip2eeglab (Julian Keil) > 6. Re: denoising data (s.rombetto at cib.na.cnr.it) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 8 Apr 2014 07:25:18 +0200 (CEST) > From: "Todorovic, A." > To: FieldTrip List > Subject: Re: [FieldTrip] denoising data > Message-ID: > < > 818248357.305942.1396934718615.JavaMail.root at monoceros.zimbra.ru.nl> > Content-Type: text/plain; charset=utf-8 > > Hi Haiteng, > > Thanks for your reply. > > Just to be sure if I understand you correctly - do you use BOTH > denoise_pca and denoise_synthetic on the same data? > > If not, how do you choose which one to use? > > Cheers, > Ana > > > > > Dear Ana, > > > > > > If I understand correctly , we use ft_denoise_synthetic and > > ft_denoise_pca to reduce noise due to recording (e.g. environment > noise , > > thermal noise... ) not the brain signal artefact (e.g eye blink). > Normally > > ,I use these two functions in the very early stage . > > > > Best, > > Haiteng > > > ------------------------------ > > Message: 2 > Date: Tue, 8 Apr 2014 09:07:46 +0200 > From: Marlene B?nstrup > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] surfaceplot made by ft_sourceplot sparing the > frontal lobes > Message-ID: > hQuwNwyu2qf-GFmF84qzVje7ENjq86MSsrpE31_J2vQ at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Dear fieldtrip-experts, > > The plot I generated by ft_sourceplot using cfg.method = 'surface' with > either projectionemthod 'nearest' or 'project' looks funny. The frontal > lobes don't show any activation, they are just left grey. And also specific > activations on the cortex are shifted towards the back (y-axis). I compared > the same 3-D- sourceactivation data (interpolated on the standard T1 output > of ft_interpolate with ft_interpolate) in an orthoplot and there the > sourceactivation is neatly arranged in the whole brain volume, including > the frontal lobes. So that the mistake must origin in the ft_sourceplot > function. > I use the version of the 18th of December 2013. > > Do you know this problem and can help me with it? > If not, do you have an idea to solve it or cirumvent it? > > Thanks in advance, > Marlene > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/80ef0af7/attachment-0001.html > > > > ------------------------------ > > Message: 3 > Date: Tue, 8 Apr 2014 10:59:00 +0200 > From: Arjen Stolk > To: FieldTrip discussion list > Subject: Re: [FieldTrip] surfaceplot made by ft_sourceplot sparing the > frontal lobes > Message-ID: > nRhoRBQ at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Hi Marlene, > > Could you download today's version of FieldTrip, and let us know whether > this problem still occurs? I'm saying because we just made an update to > surface plotting, potentially solving your issue. > > Best, > Arjen > > > 2014-04-08 9:07 GMT+02:00 Marlene B?nstrup < > marlene.boenstrup at googlemail.com > >: > > > Dear fieldtrip-experts, > > > > The plot I generated by ft_sourceplot using cfg.method = 'surface' with > > either projectionemthod 'nearest' or 'project' looks funny. The frontal > > lobes don't show any activation, they are just left grey. And also > specific > > activations on the cortex are shifted towards the back (y-axis). I > compared > > the same 3-D- sourceactivation data (interpolated on the standard T1 > output > > of ft_interpolate with ft_interpolate) in an orthoplot and there the > > sourceactivation is neatly arranged in the whole brain volume, including > > the frontal lobes. So that the mistake must origin in the ft_sourceplot > > function. > > I use the version of the 18th of December 2013. > > > > Do you know this problem and can help me with it? > > If not, do you have an idea to solve it or cirumvent it? > > > > Thanks in advance, > > Marlene > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/842e34a6/attachment-0001.html > > > > ------------------------------ > > Message: 4 > Date: Tue, 8 Apr 2014 09:01:47 +0000 > From: Tyler Grummett > To: FieldTrip discussion list > Subject: [FieldTrip] fieldtrip2eeglab > Message-ID: > < > 36a06a30eef54304859a734a2deb7153 at SIXPR03MB368.apcprd03.prod.outlook.com> > > Content-Type: text/plain; charset="us-ascii" > > ?Hey fieldtrip, > > > Is there a fieldtrip2eeglab function somewhere? > > > It says in the documentation of 'integrating with eeglab', and I was > wondering whether there already was one. > > > Tyler > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/6cd8cccb/attachment-0001.html > > > > ------------------------------ > > Message: 5 > Date: Tue, 8 Apr 2014 11:19:34 +0200 > From: Julian Keil > To: Tyler Grummett , FieldTrip > discussion list > Subject: [FieldTrip] fieldtrip2eeglab > Message-ID: <60EC99B5-A742-420D-84A2-3B86336EB37A at gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Hi Tyler, > > there was a mail by Arno Delorme last year containing the function. > > See below. > > Best, > > Julian > ******************** > Dr. Julian Keil > > AG Multisensorische Integration > Psychiatrische Universit?tsklinik > der Charit? im St. Hedwig-Krankenhaus > Gro?e Hamburger Stra?e 5-11, Raum E 307 > 10115 Berlin > > Telefon: +49-30-2311-1879 > Fax: +49-30-2311-2209 > > http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration > > Anfang der weitergeleiteten E-Mail: > > > Von: Arnaud Delorme > > Betreff: Re: [FieldTrip] Channel layout FT to EEGLAB > > Datum: 29. Oktober 2013 01:27:53 MEZ > > An: FieldTrip discussion list > > Antwort an: FieldTrip discussion list > > > > Dear Rajat, > > > > this old function transforms EEG data contained in the Fieldtrip > structure into an EEGLAB structure. > > After you have done that, to transform a channel location file, simply > type in > > > > EEG.chanlocs = struct('labels', cfg.elec.label, 'X', > mattocell(cfg.elec.pnt(1,:)), 'Y', mattocell(cfg.elec.pnt(2,:)),'Z', > mattocell(cfg.elec.pnt(3,:))); > > EEG.chanlocs = convertlocs(EEG.chanlocs, 'cart2all'); > > > > This code is untested. You might have to switch X, Y and Z to obtain the > correct orientation for the electrode cap. > > Best, > > > > Arno > > > > > > > > On Oct 28, 2013, at 7:36 AM, Raquel Bibi wrote: > > > >> Hi Rajat, > >> I don't know EEGLAB, but I use the "ordered" option in Fieldtrip to > display my time-locked ICA components. > >> > >> Best, > >> > >> Raquel > >> > >> > >> On Mon, Oct 28, 2013 at 9:39 AM, Rajat Thomas > wrote: > >> Dear all, > >> > >> I made a layout file using the image of the ecog array I had, just like > described in the > >> tutorial. > >> > >> I would like to port this to EEGLAB, so that I can use the various ICA > options to plot > >> the components at the channel locations and so on. > >> > >> Could anyone either point me to a file that does this conversion? or > >> Any way of using ICA within fieldtrip to plot the various components on > the different > >> channels using the layout file? > >> > >> I know it is used for channel rejection and so on but any help on > plotting the components > >> back on the ICA would be appreciated. > >> > >> Thanks a lot in advance. > >> > >> Rajat > >> > >> -- > >> Rajat Mani Thomas > >> Netherlands Institute for Neuroscience > >> Amsterdam, The Netherlands > >> http://www.cita.utoronto.ca/~thomas > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0002.html > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: fieldtrip2eeglab.m > Type: application/octet-stream > Size: 1141 bytes > Desc: not available > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0001.obj > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0003.html > > > > ------------------------------ > > Message: 6 > Date: Tue, 8 Apr 2014 11:51:12 +0200 > From: s.rombetto at cib.na.cnr.it > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] denoising data > Message-ID: <20140408115112.cn1ddeuo840s8s84 at arco.cib.na.cnr.it> > Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; > format="flowed" > > Hi > I am interested in this topic too. > As I have mainly environmental noise I use denoise_pca but I would > like to understand if with a different code I couold improve my S/N > ratio. Moreover I would ask if there is any difference if you apply > first one denoising procedure or the other. > > Regards > Sara Rombetto, PhD > > > Hi Haiteng, > > > > Thanks for your reply. > > > > Just to be sure if I understand you correctly - do you use BOTH > > denoise_pca and denoise_synthetic on the same data? > > > > If not, how do you choose which one to use? > > > > Cheers, > > Ana > > > >> > >> Dear Ana, > >> > >> > >> If I understand correctly , we use ft_denoise_synthetic and > >> ft_denoise_pca to reduce noise due to recording (e.g. environment > noise , > >> thermal noise... ) not the brain signal artefact (e.g eye blink). > Normally > >> ,I use these two functions in the very early stage . > >> > >> Best, > >> Haiteng > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > ------------------------- > Dott.ssa Sara Rombetto > Istituto di Cibernetica > "E. Caianiello" > Via Campi Flegrei, 34 > 80078 Pozzuoli (NA) > Italy > mob +39 3401689815 > tel +39 0818675361 > fax +39 0818675128 > Lab MEG 0817483511 > -------------------------- > "I disapprove of what you say, but I will defend to the death your > right to say > it." [Evelyn Beatrice Hall, The Friends Of Voltaire] > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 16 > ***************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ortho.png Type: image/png Size: 48141 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: surface.png Type: image/png Size: 136550 bytes Desc: not available URL: From f.roux at bcbl.eu Tue Apr 8 14:46:22 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Tue, 8 Apr 2014 14:46:22 +0200 (CEST) Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs Message-ID: <591175772.1312154.1396961182187.JavaMail.root@bcbl.eu> Dear all, I have a general question relating to the usage of cfg.runica.pca during the call to ft_componentanalysis. Is it correct to assume that cfg.runica.pca = length(meg_data.label) will force the algorithm to return n = length(meg_data.label) ICs, and that as a result artifacts can be "spread" across several ICs? If that's true, then I imagine that cfg.runica.pac = n/4 will return less components and reduce the "spread" of artifacts over several components. My question is how to choose the number of principal components to which the data is reduced before ICA? Best, Fred --------------------------------------------------------------------------- From Holger.Krause at med.uni-duesseldorf.de Tue Apr 8 15:11:45 2014 From: Holger.Krause at med.uni-duesseldorf.de (Holger Krause) Date: Tue, 08 Apr 2014 15:11:45 +0200 Subject: [FieldTrip] Zip file of yesterday's version seems to be corrupted (2014-04-07) Message-ID: <201404081511.46850.Holger.Krause@med.uni-duesseldorf.de> Hi, Yesterday night my script for downloading the latest fieldtrip version failed. Today I manually downloaded , of which the md5sum is 7ebc176eedc038581d17ecbb46bd0832. zipinfo complains about invalid archive: $ zipinfo fieldtrip-20140407.zip Archive: fieldtrip-20140407.zip Zip file size: 296098459 bytes, number of entries: 8079 error [fieldtrip-20140407.zip]: start of central directory not found; zipfile corrupt. Other users seem to be affected as well (see Marlene Bönstrup's mail from today.) BR, Holger -- Dr. rer. nat. Holger Krause MEG-Labor, Raum 13.54.-1.84 Telefon: +49 211 81-19031 Institut für klinische Neurowissenschaften http://www.uniklinik-duesseldorf.de/klinneurowiss Uniklinik Düsseldorf From haiteng.jiang at gmail.com Tue Apr 8 15:15:01 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Tue, 8 Apr 2014 15:15:01 +0200 Subject: [FieldTrip] denoising data Message-ID: Hi Ana& Sara, denoise_synthetic use linear regression to regress the noise out . The parameters are set by the manufacture company technicians while denoise_pca is a data- driven method by removing reference channels background noise. In principle , either is fine. Personally, I prefer to only use denoise_synthetic. You don't need to denoise twice and you do the component analysis later anyway. Best, Haiteng On 8 April 2014 12:00, wrote: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: denoising data (Todorovic, A.) > 2. surfaceplot made by ft_sourceplot sparing the frontal lobes > (Marlene B?nstrup) > 3. Re: surfaceplot made by ft_sourceplot sparing the frontal > lobes (Arjen Stolk) > 4. fieldtrip2eeglab (Tyler Grummett) > 5. fieldtrip2eeglab (Julian Keil) > 6. Re: denoising data (s.rombetto at cib.na.cnr.it) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 8 Apr 2014 07:25:18 +0200 (CEST) > From: "Todorovic, A." > To: FieldTrip List > Subject: Re: [FieldTrip] denoising data > Message-ID: > < > 818248357.305942.1396934718615.JavaMail.root at monoceros.zimbra.ru.nl> > Content-Type: text/plain; charset=utf-8 > > Hi Haiteng, > > Thanks for your reply. > > Just to be sure if I understand you correctly - do you use BOTH > denoise_pca and denoise_synthetic on the same data? > > If not, how do you choose which one to use? > > Cheers, > Ana > > > > > Dear Ana, > > > > > > If I understand correctly , we use ft_denoise_synthetic and > > ft_denoise_pca to reduce noise due to recording (e.g. environment > noise , > > thermal noise... ) not the brain signal artefact (e.g eye blink). > Normally > > ,I use these two functions in the very early stage . > > > > Best, > > Haiteng > > > ------------------------------ > > Message: 2 > Date: Tue, 8 Apr 2014 09:07:46 +0200 > From: Marlene B?nstrup > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] surfaceplot made by ft_sourceplot sparing the > frontal lobes > Message-ID: > hQuwNwyu2qf-GFmF84qzVje7ENjq86MSsrpE31_J2vQ at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Dear fieldtrip-experts, > > The plot I generated by ft_sourceplot using cfg.method = 'surface' with > either projectionemthod 'nearest' or 'project' looks funny. The frontal > lobes don't show any activation, they are just left grey. And also specific > activations on the cortex are shifted towards the back (y-axis). I compared > the same 3-D- sourceactivation data (interpolated on the standard T1 output > of ft_interpolate with ft_interpolate) in an orthoplot and there the > sourceactivation is neatly arranged in the whole brain volume, including > the frontal lobes. So that the mistake must origin in the ft_sourceplot > function. > I use the version of the 18th of December 2013. > > Do you know this problem and can help me with it? > If not, do you have an idea to solve it or cirumvent it? > > Thanks in advance, > Marlene > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/80ef0af7/attachment-0001.html > > > > ------------------------------ > > Message: 3 > Date: Tue, 8 Apr 2014 10:59:00 +0200 > From: Arjen Stolk > To: FieldTrip discussion list > Subject: Re: [FieldTrip] surfaceplot made by ft_sourceplot sparing the > frontal lobes > Message-ID: > nRhoRBQ at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Hi Marlene, > > Could you download today's version of FieldTrip, and let us know whether > this problem still occurs? I'm saying because we just made an update to > surface plotting, potentially solving your issue. > > Best, > Arjen > > > 2014-04-08 9:07 GMT+02:00 Marlene B?nstrup < > marlene.boenstrup at googlemail.com > >: > > > Dear fieldtrip-experts, > > > > The plot I generated by ft_sourceplot using cfg.method = 'surface' with > > either projectionemthod 'nearest' or 'project' looks funny. The frontal > > lobes don't show any activation, they are just left grey. And also > specific > > activations on the cortex are shifted towards the back (y-axis). I > compared > > the same 3-D- sourceactivation data (interpolated on the standard T1 > output > > of ft_interpolate with ft_interpolate) in an orthoplot and there the > > sourceactivation is neatly arranged in the whole brain volume, including > > the frontal lobes. So that the mistake must origin in the ft_sourceplot > > function. > > I use the version of the 18th of December 2013. > > > > Do you know this problem and can help me with it? > > If not, do you have an idea to solve it or cirumvent it? > > > > Thanks in advance, > > Marlene > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/842e34a6/attachment-0001.html > > > > ------------------------------ > > Message: 4 > Date: Tue, 8 Apr 2014 09:01:47 +0000 > From: Tyler Grummett > To: FieldTrip discussion list > Subject: [FieldTrip] fieldtrip2eeglab > Message-ID: > < > 36a06a30eef54304859a734a2deb7153 at SIXPR03MB368.apcprd03.prod.outlook.com> > > Content-Type: text/plain; charset="us-ascii" > > ?Hey fieldtrip, > > > Is there a fieldtrip2eeglab function somewhere? > > > It says in the documentation of 'integrating with eeglab', and I was > wondering whether there already was one. > > > Tyler > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/6cd8cccb/attachment-0001.html > > > > ------------------------------ > > Message: 5 > Date: Tue, 8 Apr 2014 11:19:34 +0200 > From: Julian Keil > To: Tyler Grummett , FieldTrip > discussion list > Subject: [FieldTrip] fieldtrip2eeglab > Message-ID: <60EC99B5-A742-420D-84A2-3B86336EB37A at gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Hi Tyler, > > there was a mail by Arno Delorme last year containing the function. > > See below. > > Best, > > Julian > ******************** > Dr. Julian Keil > > AG Multisensorische Integration > Psychiatrische Universit?tsklinik > der Charit? im St. Hedwig-Krankenhaus > Gro?e Hamburger Stra?e 5-11, Raum E 307 > 10115 Berlin > > Telefon: +49-30-2311-1879 > Fax: +49-30-2311-2209 > > http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration > > Anfang der weitergeleiteten E-Mail: > > > Von: Arnaud Delorme > > Betreff: Re: [FieldTrip] Channel layout FT to EEGLAB > > Datum: 29. Oktober 2013 01:27:53 MEZ > > An: FieldTrip discussion list > > Antwort an: FieldTrip discussion list > > > > Dear Rajat, > > > > this old function transforms EEG data contained in the Fieldtrip > structure into an EEGLAB structure. > > After you have done that, to transform a channel location file, simply > type in > > > > EEG.chanlocs = struct('labels', cfg.elec.label, 'X', > mattocell(cfg.elec.pnt(1,:)), 'Y', mattocell(cfg.elec.pnt(2,:)),'Z', > mattocell(cfg.elec.pnt(3,:))); > > EEG.chanlocs = convertlocs(EEG.chanlocs, 'cart2all'); > > > > This code is untested. You might have to switch X, Y and Z to obtain the > correct orientation for the electrode cap. > > Best, > > > > Arno > > > > > > > > On Oct 28, 2013, at 7:36 AM, Raquel Bibi wrote: > > > >> Hi Rajat, > >> I don't know EEGLAB, but I use the "ordered" option in Fieldtrip to > display my time-locked ICA components. > >> > >> Best, > >> > >> Raquel > >> > >> > >> On Mon, Oct 28, 2013 at 9:39 AM, Rajat Thomas > wrote: > >> Dear all, > >> > >> I made a layout file using the image of the ecog array I had, just like > described in the > >> tutorial. > >> > >> I would like to port this to EEGLAB, so that I can use the various ICA > options to plot > >> the components at the channel locations and so on. > >> > >> Could anyone either point me to a file that does this conversion? or > >> Any way of using ICA within fieldtrip to plot the various components on > the different > >> channels using the layout file? > >> > >> I know it is used for channel rejection and so on but any help on > plotting the components > >> back on the ICA would be appreciated. > >> > >> Thanks a lot in advance. > >> > >> Rajat > >> > >> -- > >> Rajat Mani Thomas > >> Netherlands Institute for Neuroscience > >> Amsterdam, The Netherlands > >> http://www.cita.utoronto.ca/~thomas > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0002.html > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: fieldtrip2eeglab.m > Type: application/octet-stream > Size: 1141 bytes > Desc: not available > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0001.obj > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0003.html > > > > ------------------------------ > > Message: 6 > Date: Tue, 8 Apr 2014 11:51:12 +0200 > From: s.rombetto at cib.na.cnr.it > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] denoising data > Message-ID: <20140408115112.cn1ddeuo840s8s84 at arco.cib.na.cnr.it> > Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; > format="flowed" > > Hi > I am interested in this topic too. > As I have mainly environmental noise I use denoise_pca but I would > like to understand if with a different code I couold improve my S/N > ratio. Moreover I would ask if there is any difference if you apply > first one denoising procedure or the other. > > Regards > Sara Rombetto, PhD > > > Hi Haiteng, > > > > Thanks for your reply. > > > > Just to be sure if I understand you correctly - do you use BOTH > > denoise_pca and denoise_synthetic on the same data? > > > > If not, how do you choose which one to use? > > > > Cheers, > > Ana > > > >> > >> Dear Ana, > >> > >> > >> If I understand correctly , we use ft_denoise_synthetic and > >> ft_denoise_pca to reduce noise due to recording (e.g. environment > noise , > >> thermal noise... ) not the brain signal artefact (e.g eye blink). > Normally > >> ,I use these two functions in the very early stage . > >> > >> Best, > >> Haiteng > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > ------------------------- > Dott.ssa Sara Rombetto > Istituto di Cibernetica > "E. Caianiello" > Via Campi Flegrei, 34 > 80078 Pozzuoli (NA) > Italy > mob +39 3401689815 > tel +39 0818675361 > fax +39 0818675128 > Lab MEG 0817483511 > -------------------------- > "I disapprove of what you say, but I will defend to the death your > right to say > it." [Evelyn Beatrice Hall, The Friends Of Voltaire] > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 16 > ***************************************** > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Tue Apr 8 15:29:03 2014 From: d.lozanosoldevilla at fcdonders.ru.nl (Lozano Soldevilla, D. (Diego)) Date: Tue, 8 Apr 2014 15:29:03 +0200 (CEST) Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs In-Reply-To: <591175772.1312154.1396961182187.JavaMail.root@bcbl.eu> Message-ID: <477456701.6274998.1396963743697.JavaMail.root@sculptor.zimbra.ru.nl> Hi Fred, I don't know the magical number but I see the following options: a) Before ICA, concatenate all single trials and ask for the rank of your data. Use it as your cfg.runica.pca input. b) Some users notice that when you sort IC by variance, beyond component 30, the IC topo/activation does not look like physiologically meaningfull. It matches with the PCA reduction before ICA with other papers: http://www.ncbi.nlm.nih.gov/pubmed/15219593 http://www.ncbi.nlm.nih.gov/pubmed/19699307 Might be somebody in the forum have tried (by simulations or in real data) on the effects of PCA component reduction on ICA. I hope it helps, Diego ----- Original Message ----- > From: "Frédéric Roux" > To: "FieldTrip discussion list" > Sent: Tuesday, 8 April, 2014 2:46:22 PM > Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs > Dear all, > > I have a general question relating to the usage of cfg.runica.pca > during the call to ft_componentanalysis. > > Is it correct to assume that cfg.runica.pca = length(meg_data.label) > will > force the algorithm to return n = length(meg_data.label) ICs, and that > as a > result artifacts can be "spread" across several ICs? > > If that's true, then I imagine that cfg.runica.pac = n/4 will return > less components > and reduce the "spread" of artifacts over several components. > > My question is how to choose the number of principal components to > which the data > is reduced before ICA? > > Best, > Fred > --------------------------------------------------------------------------- > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- PhD Student Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen NL-6525 EN Nijmegen The Netherlands http://www.ru.nl/people/donders/lozano-soldevilla-d/ From mauricio.antelis at gmail.com Tue Apr 8 15:36:42 2014 From: mauricio.antelis at gmail.com (Mauricio Antelis) Date: Tue, 8 Apr 2014 08:36:42 -0500 Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs In-Reply-To: <477456701.6274998.1396963743697.JavaMail.root@sculptor.zimbra.ru.nl> References: <591175772.1312154.1396961182187.JavaMail.root@bcbl.eu> <477456701.6274998.1396963743697.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: Roberto, Aqui algo sobre el cuentionamiento del numero de componentes para realizar ICA, sin embargo en nuestro caso, creo que no sera un parametro sensible ya que tenemos un numero bajo (21) de mediciones Saludos Mauricio On Tue, Apr 8, 2014 at 8:29 AM, Lozano Soldevilla, D. (Diego) < d.lozanosoldevilla at fcdonders.ru.nl> wrote: > Hi Fred, > > I don't know the magical number but I see the following options: > > a) Before ICA, concatenate all single trials and ask for the rank of your > data. Use it as your cfg.runica.pca input. > > b) Some users notice that when you sort IC by variance, beyond component > 30, the IC topo/activation does not look like physiologically meaningfull. > It matches with the PCA reduction before ICA with other papers: > > http://www.ncbi.nlm.nih.gov/pubmed/15219593 > http://www.ncbi.nlm.nih.gov/pubmed/19699307 > > Might be somebody in the forum have tried (by simulations or in real data) > on the effects of PCA component reduction on ICA. > > I hope it helps, > > Diego > > ----- Original Message ----- > > From: "Frédéric Roux" > > To: "FieldTrip discussion list" > > Sent: Tuesday, 8 April, 2014 2:46:22 PM > > Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs > > Dear all, > > > > I have a general question relating to the usage of cfg.runica.pca > > during the call to ft_componentanalysis. > > > > Is it correct to assume that cfg.runica.pca = length(meg_data.label) > > will > > force the algorithm to return n = length(meg_data.label) ICs, and that > > as a > > result artifacts can be "spread" across several ICs? > > > > If that's true, then I imagine that cfg.runica.pac = n/4 will return > > less components > > and reduce the "spread" of artifacts over several components. > > > > My question is how to choose the number of principal components to > > which the data > > is reduced before ICA? > > > > Best, > > Fred > > > --------------------------------------------------------------------------- > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > PhD Student > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > NL-6525 EN Nijmegen > The Netherlands > http://www.ru.nl/people/donders/lozano-soldevilla-d/ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Javier M. Antelis -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Tue Apr 8 15:38:38 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Tue, 8 Apr 2014 15:38:38 +0200 (CEST) Subject: [FieldTrip] fieldtrip Digest, Vol 41, Issue 16 In-Reply-To: Message-ID: <213148632.6275386.1396964318753.JavaMail.root@sculptor.zimbra.ru.nl> Hi Marlene, The fix was implemented yesterday, so Sunday's version unfortunately does not contain it. It seems there is currently a problem with the ftp file, so please try again as soon as you can download the latest version. If the problem still exists, please file a bug at http://bugzilla.fcdonders.nl/ and we'll try to replicate your issue. Best, Arjen ----- Oorspronkelijk bericht ----- > Van: "Marlene Bönstrup" > Aan: fieldtrip at science.ru.nl > Verzonden: Dinsdag 8 april 2014 13:31:25 > Onderwerp: Re: [FieldTrip] fieldtrip Digest, Vol 41, Issue 16 > Dear Arjen, > thanks for your quick reply. > With the version of sunday (yesterdays version the file was invalid, > my windows couldn't open it and there is not yet a version of today) > the misplotting still occurs. > I dont know if attachments work in this email list, but attached there > is the surface and the orthoplot of exactly the same interploated > data. > 2014-04-08 12:00 GMT+02:00 < fieldtrip-request at science.ru.nl > : > > Send fieldtrip mailing list submissions to > > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > or, via email, send a message with subject or body 'help' to > > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > > than "Re: Contents of fieldtrip digest..." > > Today's Topics: > > 1. Re: denoising data (Todorovic, A.) > > 2. surfaceplot made by ft_sourceplot sparing the frontal lobes > > (Marlene B?nstrup) > > 3. Re: surfaceplot made by ft_sourceplot sparing the frontal > > lobes (Arjen Stolk) > > 4. fieldtrip2eeglab (Tyler Grummett) > > 5. fieldtrip2eeglab (Julian Keil) > > 6. Re: denoising data ( s.rombetto at cib.na.cnr.it ) > > ---------------------------------------------------------------------- > > Message: 1 > > Date: Tue, 8 Apr 2014 07:25:18 +0200 (CEST) > > From: "Todorovic, A." < a.todorovic at fcdonders.ru.nl > > > To: FieldTrip List < fieldtrip at donders.ru.nl > > > Subject: Re: [FieldTrip] denoising data > > Message-ID: > > < > > 818248357.305942.1396934718615.JavaMail.root at monoceros.zimbra.ru.nl > > > > > Content-Type: text/plain; charset=utf-8 > > Hi Haiteng, > > Thanks for your reply. > > Just to be sure if I understand you correctly - do you use BOTH > > denoise_pca and denoise_synthetic on the same data? > > If not, how do you choose which one to use? > > Cheers, > > Ana > > > > > > Dear Ana, > > > > > > > > > If I understand correctly , we use ft_denoise_synthetic and > > > ft_denoise_pca to reduce noise due to recording (e.g. environment > > > noise , > > > thermal noise... ) not the brain signal artefact (e.g eye blink). > > > Normally > > > ,I use these two functions in the very early stage . > > > > > > Best, > > > Haiteng > > ------------------------------ > > Message: 2 > > Date: Tue, 8 Apr 2014 09:07:46 +0200 > > From: Marlene B?nstrup < marlene.boenstrup at googlemail.com > > > To: fieldtrip at science.ru.nl > > Subject: [FieldTrip] surfaceplot made by ft_sourceplot sparing the > > frontal lobes > > Message-ID: > > > > > > Content-Type: text/plain; charset="iso-8859-1" > > Dear fieldtrip-experts, > > The plot I generated by ft_sourceplot using cfg.method = 'surface' > > with > > either projectionemthod 'nearest' or 'project' looks funny. The > > frontal > > lobes don't show any activation, they are just left grey. And also > > specific > > activations on the cortex are shifted towards the back (y-axis). I > > compared > > the same 3-D- sourceactivation data (interpolated on the standard T1 > > output > > of ft_interpolate with ft_interpolate) in an orthoplot and there the > > sourceactivation is neatly arranged in the whole brain volume, > > including > > the frontal lobes. So that the mistake must origin in the > > ft_sourceplot > > function. > > I use the version of the 18th of December 2013. > > Do you know this problem and can help me with it? > > If not, do you have an idea to solve it or cirumvent it? > > Thanks in advance, > > Marlene > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: < > > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/80ef0af7/attachment-0001.html > > > > > ------------------------------ > > Message: 3 > > Date: Tue, 8 Apr 2014 10:59:00 +0200 > > From: Arjen Stolk < a.stolk8 at gmail.com > > > To: FieldTrip discussion list < fieldtrip at science.ru.nl > > > Subject: Re: [FieldTrip] surfaceplot made by ft_sourceplot sparing > > the > > frontal lobes > > Message-ID: > > > > > > Content-Type: text/plain; charset="iso-8859-1" > > Hi Marlene, > > Could you download today's version of FieldTrip, and let us know > > whether > > this problem still occurs? I'm saying because we just made an update > > to > > surface plotting, potentially solving your issue. > > Best, > > Arjen > > 2014-04-08 9:07 GMT+02:00 Marlene B?nstrup < > > marlene.boenstrup at googlemail.com > > >: > > > Dear fieldtrip-experts, > > > > > > The plot I generated by ft_sourceplot using cfg.method = 'surface' > > > with > > > either projectionemthod 'nearest' or 'project' looks funny. The > > > frontal > > > lobes don't show any activation, they are just left grey. And also > > > specific > > > activations on the cortex are shifted towards the back (y-axis). I > > > compared > > > the same 3-D- sourceactivation data (interpolated on the standard > > > T1 > > > output > > > of ft_interpolate with ft_interpolate) in an orthoplot and there > > > the > > > sourceactivation is neatly arranged in the whole brain volume, > > > including > > > the frontal lobes. So that the mistake must origin in the > > > ft_sourceplot > > > function. > > > I use the version of the 18th of December 2013. > > > > > > Do you know this problem and can help me with it? > > > If not, do you have an idea to solve it or cirumvent it? > > > > > > Thanks in advance, > > > Marlene > > > > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: < > > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/842e34a6/attachment-0001.html > > > > > ------------------------------ > > Message: 4 > > Date: Tue, 8 Apr 2014 09:01:47 +0000 > > From: Tyler Grummett < tyler.grummett at flinders.edu.au > > > To: FieldTrip discussion list < fieldtrip at science.ru.nl > > > Subject: [FieldTrip] fieldtrip2eeglab > > Message-ID: > > < > > 36a06a30eef54304859a734a2deb7153 at SIXPR03MB368.apcprd03.prod.outlook.com > > > > > Content-Type: text/plain; charset="us-ascii" > > ?Hey fieldtrip, > > Is there a fieldtrip2eeglab function somewhere? > > It says in the documentation of 'integrating with eeglab', and I was > > wondering whether there already was one. > > Tyler > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > > PhD Candidate > > Brain Signals Laboratory > > Flinders University > > Rm 5A301 > > Ext 66124 > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: < > > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/6cd8cccb/attachment-0001.html > > > > > ------------------------------ > > Message: 5 > > Date: Tue, 8 Apr 2014 11:19:34 +0200 > > From: Julian Keil < julian.keil at gmail.com > > > To: Tyler Grummett < tyler.grummett at flinders.edu.au >, FieldTrip > > discussion list < fieldtrip at science.ru.nl > > > Subject: [FieldTrip] fieldtrip2eeglab > > Message-ID: < 60EC99B5-A742-420D-84A2-3B86336EB37A at gmail.com > > > Content-Type: text/plain; charset="iso-8859-1" > > Hi Tyler, > > there was a mail by Arno Delorme last year containing the function. > > See below. > > Best, > > Julian > > ******************** > > Dr. Julian Keil > > AG Multisensorische Integration > > Psychiatrische Universit?tsklinik > > der Charit? im St. Hedwig-Krankenhaus > > Gro?e Hamburger Stra?e 5-11, Raum E 307 > > 10115 Berlin > > Telefon: +49-30-2311-1879 > > Fax: +49-30-2311-2209 > > http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration > > Anfang der weitergeleiteten E-Mail: > > > Von: Arnaud Delorme < arno at cerco.ups-tlse.fr > > > > Betreff: Re: [FieldTrip] Channel layout FT to EEGLAB > > > Datum: 29. Oktober 2013 01:27:53 MEZ > > > An: FieldTrip discussion list < fieldtrip at science.ru.nl > > > > Antwort an: FieldTrip discussion list < fieldtrip at science.ru.nl > > > > > > > Dear Rajat, > > > > > > this old function transforms EEG data contained in the Fieldtrip > > > structure into an EEGLAB structure. > > > After you have done that, to transform a channel location file, > > > simply type in > > > > > > EEG.chanlocs = struct('labels', cfg.elec.label, 'X', > > > mattocell(cfg.elec.pnt(1,:)), 'Y', > > > mattocell(cfg.elec.pnt(2,:)),'Z', > > > mattocell(cfg.elec.pnt(3,:))); > > > EEG.chanlocs = convertlocs(EEG.chanlocs, 'cart2all'); > > > > > > This code is untested. You might have to switch X, Y and Z to > > > obtain > > > the correct orientation for the electrode cap. > > > Best, > > > > > > Arno > > > > > > > > > > > > On Oct 28, 2013, at 7:36 AM, Raquel Bibi < bibi.raquel at gmail.com > > > > wrote: > > > > > >> Hi Rajat, > > >> I don't know EEGLAB, but I use the "ordered" option in Fieldtrip > > >> to > > >> display my time-locked ICA components. > > >> > > >> Best, > > >> > > >> Raquel > > >> > > >> > > >> On Mon, Oct 28, 2013 at 9:39 AM, Rajat Thomas < > > >> rajatthomas at gmail.com > wrote: > > >> Dear all, > > >> > > >> I made a layout file using the image of the ecog array I had, > > >> just > > >> like described in the > > >> tutorial. > > >> > > >> I would like to port this to EEGLAB, so that I can use the > > >> various > > >> ICA options to plot > > >> the components at the channel locations and so on. > > >> > > >> Could anyone either point me to a file that does this conversion? > > >> or > > >> Any way of using ICA within fieldtrip to plot the various > > >> components on the different > > >> channels using the layout file? > > >> > > >> I know it is used for channel rejection and so on but any help on > > >> plotting the components > > >> back on the ICA would be appreciated. > > >> > > >> Thanks a lot in advance. > > >> > > >> Rajat > > >> > > >> -- > > >> Rajat Mani Thomas > > >> Netherlands Institute for Neuroscience > > >> Amsterdam, The Netherlands > > >> http://www.cita.utoronto.ca/~thomas > > >> > > >> _______________________________________________ > > >> fieldtrip mailing list > > >> fieldtrip at donders.ru.nl > > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > >> > > >> _______________________________________________ > > >> fieldtrip mailing list > > >> fieldtrip at donders.ru.nl > > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: < > > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0002.html > > > > > -------------- next part -------------- > > A non-text attachment was scrubbed... > > Name: fieldtrip2eeglab.m > > Type: application/octet-stream > > Size: 1141 bytes > > Desc: not available > > URL: < > > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0001.obj > > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: < > > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0003.html > > > > > ------------------------------ > > Message: 6 > > Date: Tue, 8 Apr 2014 11:51:12 +0200 > > From: s.rombetto at cib.na.cnr.it > > To: fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] denoising data > > Message-ID: < 20140408115112.cn1ddeuo840s8s84 at arco.cib.na.cnr.it > > > Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; > > format="flowed" > > Hi > > I am interested in this topic too. > > As I have mainly environmental noise I use denoise_pca but I would > > like to understand if with a different code I couold improve my S/N > > ratio. Moreover I would ask if there is any difference if you apply > > first one denoising procedure or the other. > > Regards > > Sara Rombetto, PhD > > > Hi Haiteng, > > > > > > Thanks for your reply. > > > > > > Just to be sure if I understand you correctly - do you use BOTH > > > denoise_pca and denoise_synthetic on the same data? > > > > > > If not, how do you choose which one to use? > > > > > > Cheers, > > > Ana > > > > > >> > > >> Dear Ana, > > >> > > >> > > >> If I understand correctly , we use ft_denoise_synthetic and > > >> ft_denoise_pca to reduce noise due to recording (e.g. environment > > >> noise , > > >> thermal noise... ) not the brain signal artefact (e.g eye blink). > > >> Normally > > >> ,I use these two functions in the very early stage . > > >> > > >> Best, > > >> Haiteng > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > ------------------------- > > Dott.ssa Sara Rombetto > > Istituto di Cibernetica > > "E. Caianiello" > > Via Campi Flegrei, 34 > > 80078 Pozzuoli (NA) > > Italy > > mob +39 3401689815 > > tel +39 0818675361 > > fax +39 0818675128 > > Lab MEG 0817483511 > > -------------------------- > > "I disapprove of what you say, but I will defend to the death your > > right to say > > it." [Evelyn Beatrice Hall, The Friends Of Voltaire] > > ---------------------------------------------------------------- > > This message was sent using IMP, the Internet Messaging Program. > > ------------------------------ > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 16 > > ***************************************** > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Tue Apr 8 15:56:09 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Tue, 8 Apr 2014 15:56:09 +0200 Subject: [FieldTrip] Investigating phase synchronisation in resting state eeg data Message-ID: Dear all, I'm investigating phase synchronisation on resting state eeg data. However, I'm not sure if what I'm doing is appropriate. It will be great if someone could help me on this. So, I've segmented my resting state data into smaller chunks of 10240 timepoints, which is approximately 2s per trial for my dataset. Since I'm mainly interested to know the phase changes at each frequency band, I thought the best way is to perform a mtmfft, using a hanning taper, with 'fourier' as output. I then performed a connectivity analysis on all the channels paired with all channels. Is this appropriate at all? Can one look at phase changes at each frequency band without taking account into time? Or should one look at phase changes at each frequency band along the temporal domain (time, in this case, it would be 2 s per trial)? Also, I noticed that there's the possibility to calculate phase locking value (PLV) and weighted paired wise consistency (WPPC). What are the differences between these two methods? As I'm interested to know which pair of channels are phase synchronised, how should I perform the statistical calculation? Also, how do I represent the data in this case, given that my reference channel is all against all channels? Thanks. Best regards, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.roux at bcbl.eu Tue Apr 8 16:06:36 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Tue, 8 Apr 2014 16:06:36 +0200 (CEST) Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs In-Reply-To: Message-ID: <39462649.1313399.1396965996516.JavaMail.root@bcbl.eu> Hi Diego, thanks for the quick reply. When I compute the rank of the concatenated trials I get rank(concat1) = 202, which is the number of channels that are in the data (planar gradiometers only). So in fact that number corresponds to the default output returned by ft_componentanalysis. Alos, I usually run ICA without PCA component reduction and can identify EOG and ECG quite easily by eye-balling. But, I'd like to figure out what the advantages of PCA reduction are. For instance, will reducing the number of ICs through PCA help to isolate better EOG and ECG components or will the decomposition be the same the only difference being that the algorithm will run faster? Best, Fred Frédéric Roux ----- Original Message ----- From: "Mauricio Antelis" To: "Diego Lozano" , "FieldTrip discussion list" Sent: Tuesday, April 8, 2014 3:36:42 PM Subject: Re: [FieldTrip] using cfg.runica.pca to reduce number of ICs Roberto, Aqui algo sobre el cuentionamiento del numero de componentes para realizar ICA, sin embargo en nuestro caso, creo que no sera un parametro sensible ya que tenemos un numero bajo (21) de mediciones Saludos Mauricio On Tue, Apr 8, 2014 at 8:29 AM, Lozano Soldevilla, D. (Diego) < d.lozanosoldevilla at fcdonders.ru.nl > wrote: Hi Fred, I don't know the magical number but I see the following options: a) Before ICA, concatenate all single trials and ask for the rank of your data. Use it as your cfg.runica.pca input. b) Some users notice that when you sort IC by variance, beyond component 30, the IC topo/activation does not look like physiologically meaningfull. It matches with the PCA reduction before ICA with other papers: http://www.ncbi.nlm.nih.gov/pubmed/15219593 http://www.ncbi.nlm.nih.gov/pubmed/19699307 Might be somebody in the forum have tried (by simulations or in real data) on the effects of PCA component reduction on ICA. I hope it helps, Diego ----- Original Message ----- > From: "Frédéric Roux" < f.roux at bcbl.eu > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > > Sent: Tuesday, 8 April, 2014 2:46:22 PM > Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs > Dear all, > > I have a general question relating to the usage of cfg.runica.pca > during the call to ft_componentanalysis. > > Is it correct to assume that cfg.runica.pca = length(meg_data.label) > will > force the algorithm to return n = length(meg_data.label) ICs, and that > as a > result artifacts can be "spread" across several ICs? > > If that's true, then I imagine that cfg.runica.pac = n/4 will return > less components > and reduce the "spread" of artifacts over several components. > > My question is how to choose the number of principal components to > which the data > is reduced before ICA? > > Best, > Fred > --------------------------------------------------------------------------- > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- PhD Student Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen NL-6525 EN Nijmegen The Netherlands http://www.ru.nl/people/donders/lozano-soldevilla-d/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Javier M. Antelis _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From gopalar.ccf at gmail.com Tue Apr 8 16:14:56 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Tue, 8 Apr 2014 10:14:56 -0400 Subject: [FieldTrip] regressconfound and timefrequency Message-ID: Arjen, Thanks for all your previous help on using regressconfound. It would be great if you can shed light on some questions I asked earlier (See below). Also, when applying regressconfound to time-frequency (TF) data, regressconfound removes variance from TF from individual trials. So, utimately regressconfound helps to improve the induced TF responses rather than evoked responses. (By induced, I mean calculating TF on trial by trial basis and then computing average, But evoked I mean calculating TF on averaged data) If one is interested in only evoked, then regressconfound would not be of much help. Is that correct? Thanks, Raghavan Date: Wed, 26 Feb 2014 11:38:23 -0500 From: Raghavan Gopalakrishnan To: fieldtrip at science.ru.nl Arjen, I agree with your steps and your assumptions about my data, though I am only interested in evoked activity. I am indeed doing the steps 1 and 2 in the correct order. I just kept the 4 blocks and confounds associated with them separate from each other (for book keeping purposes), but I used the mean head position of all 4 blocks to demean the translations and rotations in each block. Technically, I guess this is the same as appending the blocks prior to running regress confound. When I said, "However, the problem is, whatever significance I found earlier (i.e. by comparing means rather than t-statistic) doesn?t test significant now.? I was comparing the means of the data that has been run through regress confound. When I plot (sum square of all gradiometers in each subject in each condition) before and after regress confound, I see some differences. Should I not see any differences at all? But there is one catch. What do I do if I am comparing a condition across different time points, rather than 2 conditions in one time point? MEG collected at two different time points will have different average head positions. In that case, should I use one average head position (computed from time point - 1) and use that to demean the translations and rotations in rest of the time points? Thanks for your support. -- *Raghavan Gopalakrishnan,* *Principal Research Engineer, * *Cleveland Clinic* -------------- next part -------------- An HTML attachment was scrubbed... URL: From gopalar.ccf at gmail.com Mon Apr 7 18:59:33 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Mon, 7 Apr 2014 12:59:33 -0400 Subject: [FieldTrip] regressconfound Message-ID: Arjen, Thanks for all your previous help on using regressconfound. It would be great if you can shed light on some questions I asked earlier (See below). Also, when applying regressconfound to time-frequency (TF) data, regressconfound removes variance from TF from individual trials. So, utimately regressconfound helps to improve the induced TF responses rather than evoked responses. (By induced, I mean calculating TF on trial by trial basis and then computing average, But evoked I mean calculating TF on averaged data) If one is interested in only evoked, then regressconfound would not be of much help. Is that correct? Thanks, Raghavan Date: Wed, 26 Feb 2014 11:38:23 -0500 From: Raghavan Gopalakrishnan To: fieldtrip at science.ru.nl Subject: [FieldTrip] regressconfound and statistics Message-ID: Content-Type: text/plain; charset=windows-1252 Arjen, I agree with your steps and your assumptions about my data, though I am only interested in evoked activity. I am indeed doing the steps 1 and 2 in the correct order. I just kept the 4 blocks and confounds associated with them separate from each other (for book keeping purposes), but I used the mean head position of all 4 blocks to demean the translations and rotations in each block. Technically, I guess this is the same as appending the blocks prior to running regress confound. When I said, "However, the problem is, whatever significance I found earlier (i.e. by comparing means rather than t-statistic) doesn?t test significant now.? I was comparing the means of the data that has been run through regress confound. When I plot (sum square of all gradiometers in each subject in each condition) before and after regress confound, I see some differences. Should I not see any differences at all? But there is one catch. What do I do if I am comparing a condition across different time points, rather than 2 conditions in one time point? MEG collected at two different time points will have different average head positions. In that case, should I use one average head position (computed from time point - 1) and use that to demean the translations and rotations in rest of the time points? Thanks for your support. Raghavan -- -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Tue Apr 8 17:45:19 2014 From: d.lozanosoldevilla at fcdonders.ru.nl (Lozano Soldevilla, D. (Diego)) Date: Tue, 8 Apr 2014 17:45:19 +0200 (CEST) Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs In-Reply-To: <39462649.1313399.1396965996516.JavaMail.root@bcbl.eu> Message-ID: <2014237779.6280165.1396971919021.JavaMail.root@sculptor.zimbra.ru.nl> Hi Fred, This is a difficult question and I don't know the answer. Searching a bit more, I've found that some experts strongly do not recommend PCA before ICA with very good reasons: http://sccn.ucsd.edu/pipermail/eeglablist/2010/003339.html http://sccn.ucsd.edu/pipermail/eeglablist/2013/006101.html Another possibility (the one I'm using in my data) is to correlate the vertical EOG time courses (or the horizontal EOG) with all ICs. The rationale is that you want to find the independent component whose time courses are more similar to the EOG time courses. Then you can reduce the potential IC candidates that contain the prototypical artifacts using prior knowledge. You'll see that 2/3 of them show high correlations (in comparison with other ICs) with topographies that resemble blinks (or eye movements respectively). For ECG you can try the same strategy or use a very similar approach using coherence: http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts However, you should had recorded the ECG, vertical and horizontal EOGs, butI don't know if this is the case. If not, I'd recommend you to record them in future experiments (just by my own experience). Best, Diego ----- Original Message ----- > From: "Frédéric Roux" > To: "FieldTrip discussion list" > Sent: Tuesday, 8 April, 2014 4:06:36 PM > Subject: Re: [FieldTrip] using cfg.runica.pca to reduce number of ICs > Hi Diego, > > thanks for the quick reply. > > When I compute the rank of the concatenated trials I get rank(concat1) > = 202, which is the number of > channels that are in the data (planar gradiometers only). So in fact > that number corresponds to the default > output returned by ft_componentanalysis. > > Alos, I usually run ICA without PCA component reduction and can > identify EOG and ECG quite easily by > eye-balling. But, I'd like to figure out what the advantages of PCA > reduction are. > > For instance, will reducing the number of ICs through PCA help to > isolate better EOG and ECG components > or will the decomposition be the same the only difference being that > the algorithm will run faster? > > Best, > > Fred > > Frédéric Roux > > ----- Original Message ----- > From: "Mauricio Antelis" > To: "Diego Lozano" , "FieldTrip > discussion list" > Sent: Tuesday, April 8, 2014 3:36:42 PM > Subject: Re: [FieldTrip] using cfg.runica.pca to reduce number of ICs > > > > Roberto, > > > Aqui algo sobre el cuentionamiento del numero de componentes para > realizar ICA, sin embargo en nuestro caso, creo que no sera un > parametro sensible ya que tenemos un numero bajo (21) de mediciones > > > Saludos > > > Mauricio > > > > > > On Tue, Apr 8, 2014 at 8:29 AM, Lozano Soldevilla, D. (Diego) < > d.lozanosoldevilla at fcdonders.ru.nl > wrote: > > > Hi Fred, > > I don't know the magical number but I see the following options: > > a) Before ICA, concatenate all single trials and ask for the rank of > your data. Use it as your cfg.runica.pca input. > > b) Some users notice that when you sort IC by variance, beyond > component 30, the IC topo/activation does not look like > physiologically meaningfull. It matches with the PCA reduction before > ICA with other papers: > > http://www.ncbi.nlm.nih.gov/pubmed/15219593 > http://www.ncbi.nlm.nih.gov/pubmed/19699307 > > Might be somebody in the forum have tried (by simulations or in real > data) on the effects of PCA component reduction on ICA. > > I hope it helps, > > Diego > > ----- Original Message ----- > > From: "Frédéric Roux" < f.roux at bcbl.eu > > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > > > Sent: Tuesday, 8 April, 2014 2:46:22 PM > > Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs > > Dear all, > > > > I have a general question relating to the usage of cfg.runica.pca > > during the call to ft_componentanalysis. > > > > Is it correct to assume that cfg.runica.pca = length(meg_data.label) > > will > > force the algorithm to return n = length(meg_data.label) ICs, and > > that > > as a > > result artifacts can be "spread" across several ICs? > > > > If that's true, then I imagine that cfg.runica.pac = n/4 will return > > less components > > and reduce the "spread" of artifacts over several components. > > > > My question is how to choose the number of principal components to > > which the data > > is reduced before ICA? > > > > Best, > > Fred > > --------------------------------------------------------------------------- > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > PhD Student > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > NL-6525 EN Nijmegen > The Netherlands > http://www.ru.nl/people/donders/lozano-soldevilla-d/ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > > Javier M. Antelis > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- PhD Student Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen NL-6525 EN Nijmegen The Netherlands http://www.ru.nl/people/donders/lozano-soldevilla-d/ From a.stolk at fcdonders.ru.nl Tue Apr 8 18:16:37 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Tue, 8 Apr 2014 18:16:37 +0200 (CEST) Subject: [FieldTrip] regressconfound In-Reply-To: Message-ID: <1308756546.6280583.1396973797760.JavaMail.root@sculptor.zimbra.ru.nl> Hey Raghavan, You're welcome. A quick solution to set you in the right direction would be to point you to the respective documentation: http://www.sciencedirect.com/science/article/pii/S1053811912011597 I believe some, maybe most, of your points are addressed by that paper (saving some copy&pasting in here). best, Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: "fieldtrip" > Verzonden: Maandag 7 april 2014 18:59:33 > Onderwerp: [FieldTrip] regressconfound > Arjen, > Thanks for all your previous help on using regressconfound. > It would be great if you can shed light on some questions I asked > earlier (See below). > Also, when applying regressconfound to time-frequency (TF) data, > regressconfound removes variance from TF from individual trials. So, > utimately regressconfound helps to improve the induced TF responses > rather than evoked responses. (By induced, I mean calculating TF on > trial by trial basis and then computing average, But evoked I mean > calculating TF on averaged data) > If one is interested in only evoked, then regressconfound would not be > of much help. Is that correct? > Thanks, > Raghavan > Date: Wed, 26 Feb 2014 11:38:23 -0500 > From: Raghavan Gopalakrishnan < gopalar.ccf at gmail.com > > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] regressconfound and statistics > Message-ID: < A36DB35E-1C8A-4C8A-A0F3-083B8E1131C1 at gmail.com > > Content-Type: text/plain; charset=windows-1252 > Arjen , > I agree with your steps and your assumptions about my data, though I > am only interested in evoked activity. I am indeed doing the steps 1 > and 2 in the correct order. I just kept the 4 blocks and confounds > associated with them separate from each other (for book keeping > purposes), but I used the mean head position of all 4 blocks to demean > the translations and rotations in each block. Technically, I guess > this is the same as appending the blocks prior to running regress > confound. > When I said, "However, the problem is, whatever significance I found > earlier (i.e. by comparing means rather than t-statistic) doesn?t test > significant now.? I was comparing the means of the data that has been > run through regress confound. When I plot (sum square of all > gradiometers in each subject in each condition) before and after > regress confound, I see some differences. Should I not see any > differences at all? > But there is one catch. What do I do if I am comparing a condition > across different time points, rather than 2 conditions in one time > point? MEG collected at two different time points will have different > average head positions. In that case, should I use one average head > position (computed from time point - 1) and use that to demean the > translations and rotations in rest of the time points? > Thanks for your support. > Raghavan > -- > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Tue Apr 8 18:31:41 2014 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Tue, 8 Apr 2014 12:31:41 -0400 Subject: [FieldTrip] regressconfound In-Reply-To: References: Message-ID: Hello Raghavan, I am actually looking at GLM head motion correction method (FieldTrip regressconfound) with some phantom MEG data and found a few things that might be of interest to you: - the method is best for Evoked Response analysis as it requires trial averaging at the end of the correction (you want to average motion corrected data not data that has motion); the method works for the resting state too but with an error linearly increasing with the amount of motion - you should see differences in before and after regressconfound correction as the method re-aligns the waveforms for one (initial=averaged) head position; you will even see the differences if comparing true recordings (no motions) to recordings with the motion (which I did with the phantom) as the method is not perfect and can't possibly remove all motion confounds/effects completely - your question: "What do I do if I am comparing a condition across different time points, rather than 2 conditions in one time point?", my answer: I would use one (initial) averaged head position (for 1st trail for example) to compare, because you want to convert/correct your measurements for *relative comparison* and they should represent the same head position (for better statistical sensitivity). Arjen, Please correct me if I am mistaking. Cheers, Inna Wake Forest Baptist Health MEG lab Inna McGowin On Mon, Apr 7, 2014 at 12:59 PM, Raghavan Gopalakrishnan < gopalar.ccf at gmail.com> wrote: > Arjen, > > Thanks for all your previous help on using regressconfound. > It would be great if you can shed light on some questions I asked earlier > (See below). > Also, when applying regressconfound to time-frequency (TF) data, > regressconfound removes variance from TF from individual trials. So, > utimately regressconfound helps to improve the induced TF responses rather > than evoked responses. (By induced, I mean calculating TF on trial by trial > basis and then computing average, But evoked I mean calculating TF on > averaged data) > If one is interested in only evoked, then regressconfound would not be of > much help. Is that correct? > > Thanks, > Raghavan > > > > > > > Date: Wed, 26 Feb 2014 11:38:23 -0500 > From: Raghavan Gopalakrishnan > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] regressconfound and statistics > Message-ID: > Content-Type: text/plain; charset=windows-1252 > > Arjen, > > I agree with your steps and your assumptions about my data, though I am > only interested in evoked activity. I am indeed doing the steps 1 and 2 in > the correct order. I just kept the 4 blocks and confounds associated with > them separate from each other (for book keeping purposes), but I used the > mean head position of all 4 blocks to demean the translations and rotations > in each block. Technically, I guess this is the same as appending the > blocks prior to running regress confound. > > When I said, "However, the problem is, whatever significance I found > earlier (i.e. by comparing means rather than t-statistic) doesn?t test > significant now.? I was comparing the means of the data that has been run > through regress confound. When I plot (sum square of all gradiometers in > each subject in each condition) before and after regress confound, I see > some differences. Should I not see any differences at all? > > But there is one catch. What do I do if I am comparing a condition across > different time points, rather than 2 conditions in one time point? MEG > collected at two different time points will have different average head > positions. In that case, should I use one average head position (computed > from time point - 1) and use that to demean the translations and rotations > in rest of the time points? > > > Thanks for your support. > Raghavan > -- > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Wed Apr 9 09:21:24 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Wed, 9 Apr 2014 09:21:24 +0200 Subject: [FieldTrip] =?utf-8?q?Re=EF=BC=9AInvestigating_phase_synchronisat?= =?utf-8?q?ion_in_resting_state_eeg_data?= Message-ID: > > Dear Hwee, > In your case, you can calculate the phase consistency across trials at each frequency, thus , you don't temporal domain information within each trial. I recommend you to use imagery part of coherence since it is insensitive to the volume conduction . In FT . you can specify ft_connectivityanalysis with cfg.output = 'imag'. After this , you get chan*Chan connectivity matrix . Regarding to the statistic, you can do permutation test by randomize the time sequence within each trial 1000 times then calculate randomized chan*chan connectivity distribution. In the end ,you can use cluster-statistic framework to find the synchronized channel clusters. I don't know how to incorporate within FT. Hope it helps, Haiteng > Message: 7 > Date: Tue, 8 Apr 2014 15:56:09 +0200 > From: Hwee Ling Lee > To: FieldTrip discussion list > Subject: [FieldTrip] Investigating phase synchronisation in resting > state eeg data > Message-ID: > Z-zVfb2S-Zovo8_k9pw at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Dear all, > > I'm investigating phase synchronisation on resting state eeg data. However, > I'm not sure if what I'm doing is appropriate. It will be great if someone > could help me on this. > > So, I've segmented my resting state data into smaller chunks of 10240 > timepoints, which is approximately 2s per trial for my dataset. > > Since I'm mainly interested to know the phase changes at each frequency > band, I thought the best way is to perform a mtmfft, using a hanning taper, > with 'fourier' as output. I then performed a connectivity analysis on all > the channels paired with all channels. Is this appropriate at all? Can one > look at phase changes at each frequency band without taking account into > time? Or should one look at phase changes at each frequency band along the > temporal domain (time, in this case, it would be 2 s per trial)? > > > Also, I noticed that there's the possibility to calculate phase locking > value (PLV) and weighted paired wise consistency (WPPC). What are the > differences between these two methods? As I'm interested to know which pair > of channels are phase synchronised, how should I perform the statistical > calculation? Also, how do I represent the data in this case, given that my > reference channel is all against all channels? > > Thanks. > > Best regards, > Hweeling > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/96bf9c22/attachment.html > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 18 > ***************************************** > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From marlene.boenstrup at googlemail.com Wed Apr 9 10:35:16 2014 From: marlene.boenstrup at googlemail.com (=?ISO-8859-1?Q?Marlene_B=F6nstrup?=) Date: Wed, 9 Apr 2014 10:35:16 +0200 Subject: [FieldTrip] surfaceplot made by ft_sourceplot sparing the frontal lobes Message-ID: Dear Arjen, I followed your advice to use the most recent version of fieldtrip again for checking the update on ft_sourceplot . But the one of Monday and Tuesday (7th and 8th) don't seem to work. I can't unzip them, the file is apparently invalid. Would it be possible to send me the updated ft_sourceplot function until the problem with the serverversion is fixed? Best, Marlene -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Wed Apr 9 11:12:52 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Wed, 9 Apr 2014 11:12:52 +0200 (CEST) Subject: [FieldTrip] surfaceplot made by ft_sourceplot sparing the frontal lobes In-Reply-To: Message-ID: <94880540.6290098.1397034772571.JavaMail.root@sculptor.zimbra.ru.nl> Hi Marlene, Yes, that would be a good idea indeed, see attached. However, no guarantee that it would work as functions typically depend on other functionalities. But have a try, and see if it fixes your issue. If the issue is still there, it might be unrelated to that particular fix, and it may be worth reporting its as a potential bug, with sufficient information for replicating your steps . See some useful documentation below. where to report: http://bugzilla.fcdonders.nl/ how to report: http://fieldtrip.fcdonders.nl/bugzilla best, Arjen ----- Oorspronkelijk bericht ----- > Van: "Marlene Bönstrup" > Aan: fieldtrip at science.ru.nl > Verzonden: Woensdag 9 april 2014 10:35:16 > Onderwerp: [FieldTrip] surfaceplot made by ft_sourceplot sparing the > frontal lobes > Dear Arjen, > I followed your advice to use the most recent version of fieldtrip > again for checking the update on ft_sourceplot . But the one of Monday > and Tuesday (7th and 8th) don't seem to work. I can't unzip them, the > file is apparently invalid. Would it be possible to send me the > updated ft_sourceplot function until the problem with the > serverversion is fixed? > Best, Marlene > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ft_sourceplot.m Type: text/x-matlab Size: 62372 bytes Desc: not available URL: From r.oostenveld at donders.ru.nl Wed Apr 9 14:32:42 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 9 Apr 2014 14:32:42 +0200 Subject: [FieldTrip] Zip file of yesterday's version seems to be corrupted (2014-04-07) In-Reply-To: <201404081511.46850.Holger.Krause@med.uni-duesseldorf.de> References: <201404081511.46850.Holger.Krause@med.uni-duesseldorf.de> Message-ID: Hi Holger and Marlene The zip file was indeed corrupt, due to the file system getting too full. I have removed the zipfile and checked all others that are now there, they all seem fine to me. I hope you can live without the 20140407 and that the later versions work. For all people that do very regular updates of fieldtrip, please do consider svn or git as alternatives to ftp. Those are shortly described (with additional pointes to other documentation) on http://fieldtrip.fcdonders.nl/faq/i_am_having_problems_downloading_from_the_ftp_server. best regards, Robert On 08 Apr 2014, at 15:11, Holger Krause wrote: > Hi, > > Yesterday night my script for downloading the latest fieldtrip version failed. > Today I manually downloaded > , of which the > md5sum is 7ebc176eedc038581d17ecbb46bd0832. > > zipinfo complains about invalid archive: > > $ zipinfo fieldtrip-20140407.zip > Archive: fieldtrip-20140407.zip > Zip file size: 296098459 bytes, number of entries: 8079 > error [fieldtrip-20140407.zip]: start of central directory not found; > zipfile corrupt. > > Other users seem to be affected as well (see Marlene Bönstrup's mail from > today.) > > BR, > > Holger > > -- > Dr. rer. nat. Holger Krause MEG-Labor, Raum 13.54.-1.84 > Telefon: +49 211 81-19031 Institut für klinische Neurowissenschaften > http://www.uniklinik-duesseldorf.de/klinneurowiss Uniklinik Düsseldorf > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From r.vandermeij at donders.ru.nl Thu Apr 10 12:01:29 2014 From: r.vandermeij at donders.ru.nl (Roemer van der Meij) Date: Thu, 10 Apr 2014 12:01:29 +0200 Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs In-Reply-To: <591175772.1312154.1396961182187.JavaMail.root@bcbl.eu> References: <591175772.1312154.1396961182187.JavaMail.root@bcbl.eu> Message-ID: Hi Fred, cfg.runica.pca sets cfg.numcomponent for runica (corrected in revision on ft tonight). If you use ICA to remove artifacts for subsequent analyses, please keep in mind that any structure not covered by the extracted components is lost. As such, I would advice you to extract the maximum number of components, or if to computationally expensive, the number of components that explain, say, 99% of the variance of the covariance matrix. You can do this for example by: % determine cfg.numcomponent by doing an eig on the covariance matrix covar = zeros(numel(data.label)); for itrial = 1:numel(data.trial) currtrial = data.trial{itrial}; covar = covar + currtrial*currtrial.'; end [V, D] = eig(covar); D = sort(diag(D),'descend'); D = D ./ sum(D); Dcum = cumsum(D); cfg.numcomponent = find(Dcum>.99,1,'first'); Best, Roemer On Tue, Apr 8, 2014 at 2:46 PM, Frédéric Roux wrote: > Dear all, > > I have a general question relating to the usage of cfg.runica.pca > during the call to ft_componentanalysis. > > Is it correct to assume that cfg.runica.pca = length(meg_data.label) will > force the algorithm to return n = length(meg_data.label) ICs, and that as a > result artifacts can be "spread" across several ICs? > > If that's true, then I imagine that cfg.runica.pac = n/4 will return less > components > and reduce the "spread" of artifacts over several components. > > My question is how to choose the number of principal components to which > the data > is reduced before ICA? > > Best, > Fred > --------------------------------------------------------------------------- > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Roemer van der Meij M.Sc. PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3655932 E-mail: r.vandermeij at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From gopalar.ccf at gmail.com Thu Apr 10 22:15:44 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Thu, 10 Apr 2014 16:15:44 -0400 Subject: [FieldTrip] artifact routines - cfg.trl Message-ID: Dear all, When detecting artifacts in EEG data, all the folllowing routines requires cfg.trl to be specified ft_artifact_eog, ft_artifact_muscle and ft_artifact_threshold. However, if I have the data already parsed into trials, i.e. run through ft_preprocessing, can I run these above mentioned routines? I see ft_artifact_zvalue does not require the cfg.trl field, but all others (mentioned above) do? Can this be addressed. Please advise. Thanks, Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Fri Apr 11 00:28:28 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Thu, 10 Apr 2014 22:28:28 +0000 Subject: [FieldTrip] artifact routines - cfg.trl In-Reply-To: References: Message-ID: <6C755E38-CB80-403F-A2EC-8DE32DF1AE6D@flinders.edu.au> I don't know I this will help but I found that the making cfg.trl = [data.sample info, 0] to work fine. How have you found the artefact correction algorithms? I've noticed that some take out unnecessary segments of EEG. Kin regards, Tyler > On 11 Apr 2014, at 5:47 am, "Raghavan Gopalakrishnan" wrote: > > Dear all, > > When detecting artifacts in EEG data, all the folllowing routines requires cfg.trl to be specified > ft_artifact_eog, ft_artifact_muscle and ft_artifact_threshold. > However, if I have the data already parsed into trials, i.e. run through ft_preprocessing, can I run these above mentioned routines? > I see ft_artifact_zvalue does not require the cfg.trl field, but all others (mentioned above) do? Can this be addressed. > Please advise. > > Thanks, > Raghavan > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tyler.grummett at flinders.edu.au Fri Apr 11 04:38:01 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Fri, 11 Apr 2014 02:38:01 +0000 Subject: [FieldTrip] TRENTOOL bad channel combinations Message-ID: ?Hello fieldtrip, Has anyone worked out how to handle bad channel combinations in TRENTOOL using TEprepare? In my experience it just crashes. I am hoping for a way to calculate the bad channel combinations before running TEprepare. If anyone can help, that will be greatly appreciated!! Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patricia.Wollstadt at gmx.de Fri Apr 11 11:12:23 2014 From: Patricia.Wollstadt at gmx.de (Patricia Wollstadt) Date: Fri, 11 Apr 2014 11:12:23 +0200 Subject: [FieldTrip] TRENTOOL bad channel combinations In-Reply-To: References: Message-ID: <5347B1F7.1080303@gmx.de> Hello Tyler, TRENTOOL does not support the exclusion of channels like FieldTrip does (e.g. {'all', '-MLx', '-EOG'}), you have to explicitly specify channels OR combinations of channels for analysis in the cfg structure passed to TEprepare: % cfg.sgncmb = list of channelpairs cell array (Nx(source, target)) % or % cfg.channel = list of channels cell array - testing will be done all-by-all If you provide a list of channel combinations in cfg.sgncmb, TRENTOOL will analyze these combinations only; if you provide a list of channels in cfg.channel, TEprepare will build all possible channel combinations from the list and TRENTOOL will analyze these combinations. (Also, channel names have to match the channel labels in data.label.) So, a way to exclude bad channel combinations would be to provide a list of all channels that should be included in the analysis in cfg.channel and let TEprepare build the channel combinations from that. I hope this answers your question. Please let me know if you encounter any more problems. Best, Patricia On 04/11/2014 04:38 AM, Tyler Grummett wrote: > > Hello fieldtrip, > > > Has anyone worked out how to handle bad channel combinations in > TRENTOOL using TEprepare? > > > In my experience it just crashes. I am hoping for a way to calculate > the bad channel combinations before running TEprepare. > > > If anyone can help, that will be greatly appreciated!! > > > Tyler > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip ------------------------------------------------------------ Patricia Wollstadt, PhD Student MEG Unit, Brain Imaging Center Goethe University, Frankfurt, Germany Heinrich Hoffmann Strasse 10, Haus 93 B D - 60528 Frankfurt am Main -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Fri Apr 11 11:36:29 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Fri, 11 Apr 2014 09:36:29 +0000 Subject: [FieldTrip] append trials after artefact correction Message-ID: <1e1f1c2ba0864d8c86dd3dd6a22a106c@SIXPR03MB368.apcprd03.prod.outlook.com> ?Hello everyone, Is there any way to append trials after running artefact correction algorithms that break the data up into trials. It has issues in later calculations, such as transfer entropy in TRENTOOL Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Fri Apr 11 12:44:45 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Fri, 11 Apr 2014 10:44:45 +0000 Subject: [FieldTrip] TRENTOOL bad channel combinations In-Reply-To: <5347B1F7.1080303@gmx.de> References: , <5347B1F7.1080303@gmx.de> Message-ID: ?Hello Patricia, I have previously selected the channels that are EEG, I am not entering in 'EEG' or anything. cfgTEP = []; cfgTEP.Path2TSTOOL = fullfile( matlabrootpath, 'Matlab', 'OpenTSTOOL'); % dont add this to matlab path cfgTEP.toi = [ min( [vchan.time{ :}]), max( [vchan.time{ :}])]; cfgTEP.channel = vchan.label( comps);? After playing around with it for a bit I dont think it is the channel combinations, but the data. If I can ask a separate question, what is an optimal length for the trials? My trials are about 500 ms long and it gives me the following error: Error using TEprepare (line 710) TRENTOOL ERROR: Not enough points in timeseries for current analysis settings: cfg.repPred too big, or max(cfg.ragdim)*max(cfg.ragtaurange) too big, or maximum u to big It is recommended that the cfgTEP.repPred is size(data.trial{1,1},2)*(3/4) However it only works for me if it is size(data.trial{1,1},2)*(3/9)?. Then it runs fine, but Im worried about changing this. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Patricia Wollstadt Sent: Friday, 11 April 2014 6:42 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] TRENTOOL bad channel combinations Hello Tyler, TRENTOOL does not support the exclusion of channels like FieldTrip does (e.g. {'all', '-MLx', '-EOG'}), you have to explicitly specify channels OR combinations of channels for analysis in the cfg structure passed to TEprepare: % cfg.sgncmb = list of channelpairs cell array (Nx(source, target)) % or % cfg.channel = list of channels cell array - testing will be done all-by-all If you provide a list of channel combinations in cfg.sgncmb, TRENTOOL will analyze these combinations only; if you provide a list of channels in cfg.channel, TEprepare will build all possible channel combinations from the list and TRENTOOL will analyze these combinations. (Also, channel names have to match the channel labels in data.label.) So, a way to exclude bad channel combinations would be to provide a list of all channels that should be included in the analysis in cfg.channel and let TEprepare build the channel combinations from that. I hope this answers your question. Please let me know if you encounter any more problems. Best, Patricia On 04/11/2014 04:38 AM, Tyler Grummett wrote: ?Hello fieldtrip, Has anyone worked out how to handle bad channel combinations in TRENTOOL using TEprepare? In my experience it just crashes. I am hoping for a way to calculate the bad channel combinations before running TEprepare. If anyone can help, that will be greatly appreciated!! Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip ------------------------------------------------------------ Patricia Wollstadt, PhD Student MEG Unit, Brain Imaging Center Goethe University, Frankfurt, Germany Heinrich Hoffmann Strasse 10, Haus 93 B D - 60528 Frankfurt am Main -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at fcdonders.ru.nl Fri Apr 11 12:48:11 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Fri, 11 Apr 2014 12:48:11 +0200 (CEST) Subject: [FieldTrip] Question re: TMS-EEG FT Tutorial In-Reply-To: References: Message-ID: <003701cf5573$886ba630$9942f290$@herring@fcdonders.ru.nl> Dear Bingshuo, I am forwarding your e-mail to the Fieldtrip mailinglist so that others can benefit and/or contribute from our discussion. The reason why I like to postpone the interpolation to after the ICA is that I noticed that when interpolating before ICA the interpolated data would load onto one component. Removing this component did not make sense as it would leave a flat line in the TEP, keeping it in did not make sense either because the interpolation was done with, for example, the decay artifact still in the data. After removing the decay artifact with ICA you would be left with a sharp peak in the interpolated segment. I see that it is difficult to reject trials and channels before interpolation but keep in mind that before having done ICA large amounts of variance of the data can be explained by the TMS related artifacts, these will most likely cloud the detection of other types of artifacts with functions such as ft_rejectvisual. In my experience bad channels show up as separate independent components anyway and can be removed after having run the ICA, but that may depend on a number of factors I'm not aware of. If you would like to reject bad channels prior to running ICA you could also try to run ft_rejectvisual and specify cfg.latency to contain only your pre-TMS period or a period post-TMS that does not contain any large artifacts. That way you should at least be able to run metrics on your data to remove bad channels. In any case you can always run ft_databrowser on your data to visually inspect your channel time courses for bad channels prior to running the ICA. In any case you are of course free to try running the ICA after interpolation yourself and share your experiences, perhaps this works fine for you J Best, Jim From: Bingshuo Li [mailto:bingshuo.li at cin.uni-tuebingen.de] Sent: donderdag 10 april 2014 16:36 To: j.herring at fcdonders.ru.nl Subject: Question re: TMS-EEG FT Tutorial Dear Jim, I inquired you about a TMS-EEG question a while ago and you referred me to the TMS-EEG tutorial on Fieldtrip's website. As I was following the steps of the tutorial, there is a new question that come up to me -- Is it really necessary to postpone the interpolation of the TMS artifact until the ICA is done? Would there be any bad consequences if I interpolate first and then run the ICA over the entire interpolated trial(s)? The reason I am asking this question is that I would like to visually inspect my data first and remove bad channels or trials (if any) prior to ICA. If the artifact is not interpolated, it is really difficult to run visual inspection or metrics on the data.. Following the logic of the tutorial, I can only visual inspection after the ICA, which I think might not be a good idea as I was told that a bad channel can easily bias the ICA result.. Do you have any insights in this? Thank you very much for your time in advance! Sincerely, ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at cin.uni-tuebingen.de +49-7071-29-89029 On Mon, Feb 10, 2014 at 3:24 PM, Herring, J.D. (Jim) wrote: Dear Bingshuo, Please have a look at the following tutorial: http://fieldtrip.fcdonders.nl/tutorial/tms-eeg It deals with a number of TMS-EEG related artifacts including the 'evil' decay artifact. Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Bingshuo Li Sent: maandag 10 februari 2014 15:06 To: FieldTrip discussion list Subject: [FieldTrip] TMS-EEG Decay Artifact Dear FT users and developers, Does anyone have any experience in dealing with the so-called decay artifacts found in TMS-EEG? It is a relatively long lasting (up to 100ms) artifact that follows a waveform similar to exponential decay and it occurs sporadically in certain recording channels. Any tips/hints/recommendations are greatly appreciated! Thank you! Regards, ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at student.uni-tuebingen.de +49-152-06054831 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.hasanzadeh22 at yahoo.com Fri Apr 11 15:09:04 2014 From: f.hasanzadeh22 at yahoo.com (=?utf-8?B?4oCqRi5IYXNhbnphZGXigKwg4oCq?=) Date: Fri, 11 Apr 2014 14:09:04 +0100 (BST) Subject: [FieldTrip] (no subject) Message-ID: <1397221744.51555.YahooMailNeo@web171305.mail.ir2.yahoo.com> f.hasanzadeh22 at yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.hasanzadeh22 at yahoo.com Fri Apr 11 15:24:54 2014 From: f.hasanzadeh22 at yahoo.com (=?utf-8?B?4oCqRi5IYXNhbnphZGXigKwg4oCq?=) Date: Fri, 11 Apr 2014 14:24:54 +0100 (BST) Subject: [FieldTrip] a question Message-ID: <1397222694.1541.YahooMailNeo@web171304.mail.ir2.yahoo.com> Dear community, My name is Fateme Hasanzade and I am working on EEG signals. Currently I am analysing data of a project, where we recorded using EEG.I have a data such that every channel has 1 value that is result of some calculation(I mean I have 14 channel thus a data vector of length14).I want to plot map of head how  every channel has a color corresponding its  value... I tried using  ft_topoplotER to assess my data and I made the true layout but when I want to use ft_topoplotER receive the following error message:  Subscript indices must either be real positive integers or logicals. Error in topoplot_common (line 79) data = varargin{indx}; Error in ft_topoplotER (line 169) cfg = topoplot_common(cfg, varargin{:}); Error in top (line 19) figure; ft_topoplotER(cfg,data); colorbar;  my quetion is how should I give this data  to function to  have true topographic plot of my data? Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patricia.Wollstadt at gmx.de Fri Apr 11 17:36:21 2014 From: Patricia.Wollstadt at gmx.de (Patricia Wollstadt) Date: Fri, 11 Apr 2014 17:36:21 +0200 Subject: [FieldTrip] TRENTOOL bad channel combinations In-Reply-To: References: , <5347B1F7.1080303@gmx.de> Message-ID: <53480BF5.1020800@gmx.de> Hello Tyler, okay, I'd say the script should run like this (regarding channel selection). Maybe it's really the data then. If you keep getting errors, you can send me those as well. Regarding the number of data points: The error you are getting depends on a number of parameters TEprepare uses to determine the optimal embedding dimension and embedding delay. TEprepare checks whether you have enough samples in one trial after taking into account the ACT, cfg.actthrvalue, cfg.ragdim, cfg.ragtau and the assumed interaction delay (these parameters determine the maximum possible length, i.e. the worst case, of your embedding). Could you tell me the sampling rate of your data? If your data was sampled at 1000Hz, 3/9th of 500 ms should give you about 167 sample points for cfg.repPred, which would be okay. Otherwise, you may alter the parameters mentioned above, e.g. you can check whether you could lower the actthrvalue. The actthrvalue is used to exclude all trials with an ACT higher than the threshold. The value you put in there should be based on the filtering of the data prior to TE analysis (e.g. if you highpass filter your data at 10 Hz and have a sampling rate of 1000Hz, you shouldn't find any autocorrelation above 100 samples. In that case, you may use 100 as a threshold). What values do you enter for the other parameters (assumed interaction delay u, specified in cfg.predicttimemin_u/cfg.predicttimemax_u, embedding parameters to be scanned in cfg.ragdim and cfg.ragtau)? Maybe you can adjust those as well, to be able to enter a higher value for .repPred. Best, Patricia On 04/11/2014 12:44 PM, Tyler Grummett wrote: > > Hello Patricia, > > > I have previously selected the channels that are EEG, I am not > entering in 'EEG' or anything. > > > cfgTEP = []; > cfgTEP.Path2TSTOOL = fullfile( matlabrootpath, 'Matlab', > 'OpenTSTOOL'); % dont add this to matlab path > cfgTEP.toi = [ min( [vchan.time{ :}]), max( [vchan.time{ > :}])]; > cfgTEP.channel = vchan.label( comps); > > > After playing around with it for a bit I dont think it is the channel > combinations, but the data. > > > If I can ask a separate question, what is an optimal length for the > trials? My trials are about 500 ms long and it gives me the following > error: > > > Error using TEprepare (line 710) > TRENTOOL ERROR: Not enough points in timeseries for current analysis > settings: cfg.repPred too big, or > max(cfg.ragdim)*max(cfg.ragtaurange) too big, or maximum u to big > > It is recommended that the cfgTEP.repPred is size(data.trial{1,1},2)*(3/4) > > However it only works for me if it is size(data.trial{1,1},2)*(3/9) . > > Then it runs fine, but Im worried about changing this. > > Tyler > > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > ------------------------------------------------------------------------ > *From:* fieldtrip-bounces at science.ru.nl > on behalf of Patricia Wollstadt > > *Sent:* Friday, 11 April 2014 6:42 PM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] TRENTOOL bad channel combinations > > Hello Tyler, > > TRENTOOL does not support the exclusion of channels like FieldTrip > does (e.g. {'all', '-MLx', '-EOG'}), you have to explicitly specify > channels OR combinations of channels for analysis in the cfg structure > passed to TEprepare: > > % cfg.sgncmb = list of channelpairs cell array (Nx(source, target)) > % or > % cfg.channel = list of channels cell array - testing will be > done all-by-all > > If you provide a list of channel combinations in cfg.sgncmb, TRENTOOL > will analyze these combinations only; if you provide a list of > channels in cfg.channel, TEprepare will build all possible channel > combinations from the list and TRENTOOL will analyze these > combinations. (Also, channel names have to match the channel labels in > data.label.) > > So, a way to exclude bad channel combinations would be to provide a > list of all channels that should be included in the analysis in > cfg.channel and let TEprepare build the channel combinations from that. > > I hope this answers your question. Please let me know if you encounter > any more problems. > > Best, > Patricia > > > > On 04/11/2014 04:38 AM, Tyler Grummett wrote: >> >> Hello fieldtrip, >> >> >> Has anyone worked out how to handle bad channel combinations in >> TRENTOOL using TEprepare? >> >> >> In my experience it just crashes. I am hoping for a way to calculate >> the bad channel combinations before running TEprepare. >> >> >> If anyone can help, that will be greatly appreciated!! >> >> >> Tyler >> >> >> ************************* >> >> /Tyler Grummett ( BBSc, BSc(Hons I))/ >> /PhD Candidate/ >> /Brain Signals Laboratory/ >> /Flinders University/ >> /Rm 5A301/ >> /Ext 66124/ >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > ------------------------------------------------------------ > > Patricia Wollstadt, PhD Student > > MEG Unit, Brain Imaging Center > > Goethe University, Frankfurt, Germany > > Heinrich Hoffmann Strasse 10, Haus 93 B > > D - 60528 Frankfurt am Main > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- ------------------------------------------------------------ Patricia Wollstadt, PhD Student MEG Unit, Brain Imaging Center Goethe University, Frankfurt, Germany Heinrich Hoffmann Strasse 10, Haus 93 B D - 60528 Frankfurt am Main -------------- next part -------------- An HTML attachment was scrubbed... URL: From politzerahless at gmail.com Sat Apr 12 12:24:32 2014 From: politzerahless at gmail.com (Stephen Politzer-Ahles) Date: Sat, 12 Apr 2014 14:24:32 +0400 Subject: [FieldTrip] a question Message-ID: Hello Fateme, I believe ft_topoplotER needs its input to be a Fieldtrip data structure that is the output of ft_timelockanalysis (i.e., the structure includes an 'avg' field that is a channels x timepoints matrix, and in the fall to ft_topoplotER you specify cfg.param='avg'). It sounds like your pinput is not a structure like this, but is a 1-dimensional vector. You can plot a vector like this pretty easily using the topoplot() function of the EEGLAB toolbox. (There may also be ways to do it in Fieldtrip but I'm not aware of them; I've only ever used ft_topoplotER with a timelock structure. Someone else on the list might know some tricks, though). Best, Steve Stephen Politzer-Ahles New York University, Abu Dhabi Neuroscience of Language Lab http://www.nyu.edu/projects/politzer-ahles/ > > ------------------------------ > > Message: 4 > Date: Fri, 11 Apr 2014 14:24:54 +0100 (BST) > From: ?F.Hasanzade? ? > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] a question > Message-ID: > <1397222694.1541.YahooMailNeo at web171304.mail.ir2.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Dear community, > My name is Fateme Hasanzade and I am working on EEG signals. > Currently I am analysing data of a project, where we recorded using EEG.I > have a data such that every channel has 1 value that is result of some > calculation(I mean I have 14 channel thus a data vector of length14).I want > to plot map of head how? every channel has a color corresponding its? > value... > > > I tried using? ft_topoplotER to assess my data and I made the true layout > but when I want to use ft_topoplotER receive the following error message:? > > Subscript indices must either be real positive integers or logicals. > > Error in topoplot_common (line 79) > data = varargin{indx}; > > Error in ft_topoplotER (line 169) > cfg = topoplot_common(cfg, varargin{:}); > > Error in top (line 19) > figure; ft_topoplotER(cfg,data); colorbar;? > > my quetion is how should I give this data? to function to? have true > topographic plot of my data? > > > Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Sat Apr 12 13:18:00 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Sat, 12 Apr 2014 13:18:00 +0200 Subject: [FieldTrip] a question In-Reply-To: References: Message-ID: <534920E8.8060003@donders.ru.nl> Hi Fateme, in addition to what Stephen said, it might help if you provide more insight into what you are doing by including the function call, this includes: * The cfg you used * The fields of your data structure * The line you called that gave an error / that you would like to ask a question on * The exact error message you got see also http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community also, check out our wiki and make use of the search functionality. There might be some FAQs and example scripts that are useful for you, e.g. http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat?s[]=import Hope any of this helps! Best, Jörn On 4/12/2014 12:24 PM, Stephen Politzer-Ahles wrote: > > Hello Fateme, > > I believe ft_topoplotER needs its input to be a Fieldtrip data > structure that is the output of ft_timelockanalysis (i.e., the > structure includes an 'avg' field that is a channels x timepoints > matrix, and in the fall to ft_topoplotER you specify cfg.param='avg'). > It sounds like your pinput is not a structure like this, but is a > 1-dimensional vector. > > You can plot a vector like this pretty easily using the topoplot() > function of the EEGLAB toolbox. (There may also be ways to do it in > Fieldtrip but I'm not aware of them; I've only ever used ft_topoplotER > with a timelock structure. Someone else on the list might know some > tricks, though). > > Best, > Steve > > > Stephen Politzer-Ahles > New York University, Abu Dhabi > Neuroscience of Language Lab > http://www.nyu.edu/projects/politzer-ahles/ > > > ------------------------------ > > Message: 4 > Date: Fri, 11 Apr 2014 14:24:54 +0100 (BST) > From: ?F.Hasanzade? ? > > To: "fieldtrip at science.ru.nl " > > > Subject: [FieldTrip] a question > Message-ID: > <1397222694.1541.YahooMailNeo at web171304.mail.ir2.yahoo.com > > > Content-Type: text/plain; charset="utf-8" > > Dear community, > My name is Fateme Hasanzade and I am working on EEG signals. > Currently I am analysing data of a project, where we recorded > using EEG.I have a data such that every channel has 1 value that > is result of some calculation(I mean I have 14 channel thus a data > vector of length14).I want to plot map of head how? every channel > has a color corresponding its? value... > > > I tried using? ft_topoplotER to assess my data and I made the true > layout but when I want to use ft_topoplotER receive the following > error message:? > > Subscript indices must either be real positive integers or logicals. > > Error in topoplot_common (line 79) > data = varargin{indx}; > > Error in ft_topoplotER (line 169) > cfg = topoplot_common(cfg, varargin{:}); > > Error in top (line 19) > figure; ft_topoplotER(cfg,data); colorbar;? > > my quetion is how should I give this data? to function to? have > true topographic plot of my data? > > > Thank you > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jan.schoffelen at donders.ru.nl Sat Apr 12 21:03:52 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Sat, 12 Apr 2014 21:03:52 +0200 Subject: [FieldTrip] ft_sourceplot: issue with cfg.method = 'surface' Message-ID: <752EAE5A-22C3-4050-AEEA-E2FF07E81042@donders.ru.nl> Dear fieldtrippers, Despite our best efforts, there has been an inconvenient bug in ft_sourceplot, which has been present in r9031-r9400 (Dec 13, 2013-April 12,2014). In particular, the images constructed when using cfg.method = 'surface' were incorrect. The issue pertains to the on-the-fly interpolation onto a cortical sheet of volumetrically (i.e. on a 3D grid) source-reconstructed data. I updated the cortical sheets last December, and replaced the handcrafted exemplars by the ones from the SPM surfrend toolbox. The motivation for all this would be to have a better reference to the actual data used. The bottom line of all this is that I made a mistake, and directly used the surfaces loaded from the Freesurfer file format, without taking into account the fact that in the Freesurfer convention the coordinate system in these files is slightly different than standard space. As a consequence these surfaces were misregistered to the 3D anatomical image in standard space, and thus to incorrect interpolations of the functional data onto these surfaces. This issue has been identified thanks to Marlene Bönstrup and has been fixed today. Any sourceplots with cfg.method = 'surface' that have been made with FieldTrip versions originating from between the dates mentioned above will incorrectly represent the source reconstructed data, and may need to be re-done. More info can be found on http://fieldtrip.fcdonders.nl/template/anatomy. I am very sorry for any inconvenience this may have caused. Best wishes, Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Mon Apr 14 03:53:10 2014 From: v.piai.research at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Piai?=) Date: Sun, 13 Apr 2014 18:53:10 -0700 Subject: [FieldTrip] freqstatistics with sbj_chan_freq Message-ID: <534B3F86.9070904@gmail.com> Hi all, I'm kinda stuck not being able to figure out what's going wrong with my freqstats, so I thought I could share it here and see if anyone can see where I'm going wrong. When I run freqstatistics on TFRs, I get a negative cluster (p = .001) between 8 and 25 Hz with the topography very similar to the one in the figure. But I just want non-time-resolved spectra. So I have power spectra calculated with mtmfft (dpss tapers) between 1 and 50 Hz (5 Hz smoothing) and this is the one for which I've been trying to run freqstatistics, unsuccessfully. I'm using a pretty standard cfg for freqstats (basically, the same I use for the TFRs, which give me the negative cluster with p =.001) and the data in the comparison are structured as sbj_chan_freq. With this time-unresolved data, only posclusters are detected, with ps > .4! If I plot the stat output, it has the exact same negative cluster as I get for the TFRs (see Figure), and as far as I can see, no real positive cluster, but the function doesn't even detect any negative clusters. I must be doing something wrong because the time-resolved and -unresolved effects are pretty much the same in the descriptives. I remember running stats on time-unresolved data before and getting a reasonable output, so I guess my ft_freqstatistics isn't working well right now. I just can't figure out why. Does anyone have any tips for how I could go about to find out why the negative clusters are being disregarded? Thanks a lot, Vitória -------------- next part -------------- A non-text attachment was scrubbed... Name: freqstats.gif Type: image/gif Size: 28839 bytes Desc: not available URL: From tyler.grummett at flinders.edu.au Mon Apr 14 04:54:16 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 14 Apr 2014 02:54:16 +0000 Subject: [FieldTrip] automatic artifact correction after virtual channels/beamformer Message-ID: ?Hello all, I was just wondering whether it is necessary to use the artifact corrected data when creating virtual channels from beamformer sources or whether you are able to use original, non-artifact corrected data. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Mon Apr 14 06:37:45 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 14 Apr 2014 04:37:45 +0000 Subject: [FieldTrip] TRENTOOL bad channel combinations In-Reply-To: <53480BF5.1020800@gmx.de> References: , <5347B1F7.1080303@gmx.de> , <53480BF5.1020800@gmx.de> Message-ID: Hello Patricia, To answer your questions, yes my sampling rate is 1000Hz. Some additional details about my data: I am analysing continuous data from 10 subjects (as a test). One of the tasks they did is approximately 3 minutes. I have been marking out the data ( which breaks the data up into trials) and then taking a one second epoch from each of the trials. What is the smallest length of data (in seconds) that transfer entropy can be run on? ​Should I leave it as one long length of data? The inherent problem with that is the various trial lengths, I am fairly sure that TEprepare crashes if the trials are of a various length. Interestingly, the function doesnt crash on data that I have artefact corrected (1-second trials) and on sources that explain more than 95% of the variance (after applying beamformer and PCA). For example, if I had 1400 brain sources (after beamformer and virtual channel calculation), and only 12 of the brain sources explain up to 95% of the variance then I pick those 12 and run TEprepare on it and it runs without issue. So I havent needed to change many of the configuration settings around after that. Its only the length of trial and the number of trials that concern me now. One last note, is that there has been discussions on the eeglab discussion list about applying a 1-Hz highpass filter to your data. They think that it may interfere with the 'future' of the signal, ultimately disrupting the transfer entropy calculation (or any other connectivity measure). Tyler. ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Patricia Wollstadt Sent: Saturday, 12 April 2014 1:06 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] TRENTOOL bad channel combinations Hello Tyler, okay, I'd say the script should run like this (regarding channel selection). Maybe it's really the data then. If you keep getting errors, you can send me those as well. Regarding the number of data points: The error you are getting depends on a number of parameters TEprepare uses to determine the optimal embedding dimension and embedding delay. TEprepare checks whether you have enough samples in one trial after taking into account the ACT, cfg.actthrvalue, cfg.ragdim, cfg.ragtau and the assumed interaction delay (these parameters determine the maximum possible length, i.e. the worst case, of your embedding). Could you tell me the sampling rate of your data? If your data was sampled at 1000Hz, 3/9th of 500 ms should give you about 167 sample points for cfg.repPred, which would be okay. Otherwise, you may alter the parameters mentioned above, e.g. you can check whether you could lower the actthrvalue. The actthrvalue is used to exclude all trials with an ACT higher than the threshold. The value you put in there should be based on the filtering of the data prior to TE analysis (e.g. if you highpass filter your data at 10 Hz and have a sampling rate of 1000Hz, you shouldn't find any autocorrelation above 100 samples. In that case, you may use 100 as a threshold). What values do you enter for the other parameters (assumed interaction delay u, specified in cfg.predicttimemin_u/cfg.predicttimemax_u, embedding parameters to be scanned in cfg.ragdim and cfg.ragtau)? Maybe you can adjust those as well, to be able to enter a higher value for .repPred. Best, Patricia On 04/11/2014 12:44 PM, Tyler Grummett wrote: ​Hello Patricia, I have previously selected the channels that are EEG, I am not entering in 'EEG' or anything. cfgTEP = []; cfgTEP.Path2TSTOOL = fullfile( matlabrootpath, 'Matlab', 'OpenTSTOOL'); % dont add this to matlab path cfgTEP.toi = [ min( [vchan.time{ :}]), max( [vchan.time{ :}])]; cfgTEP.channel = vchan.label( comps);​ After playing around with it for a bit I dont think it is the channel combinations, but the data. If I can ask a separate question, what is an optimal length for the trials? My trials are about 500 ms long and it gives me the following error: Error using TEprepare (line 710) TRENTOOL ERROR: Not enough points in timeseries for current analysis settings: cfg.repPred too big, or max(cfg.ragdim)*max(cfg.ragtaurange) too big, or maximum u to big It is recommended that the cfgTEP.repPred is size(data.trial{1,1},2)*(3/4) However it only works for me if it is size(data.trial{1,1},2)*(3/9)​ . Then it runs fine, but Im worried about changing this. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Patricia Wollstadt Sent: Friday, 11 April 2014 6:42 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] TRENTOOL bad channel combinations Hello Tyler, TRENTOOL does not support the exclusion of channels like FieldTrip does (e.g. {'all', '-MLx', '-EOG'}), you have to explicitly specify channels OR combinations of channels for analysis in the cfg structure passed to TEprepare: % cfg.sgncmb = list of channelpairs cell array (Nx(source, target)) % or % cfg.channel = list of channels cell array - testing will be done all-by-all If you provide a list of channel combinations in cfg.sgncmb, TRENTOOL will analyze these combinations only; if you provide a list of channels in cfg.channel, TEprepare will build all possible channel combinations from the list and TRENTOOL will analyze these combinations. (Also, channel names have to match the channel labels in data.label.) So, a way to exclude bad channel combinations would be to provide a list of all channels that should be included in the analysis in cfg.channel and let TEprepare build the channel combinations from that. I hope this answers your question. Please let me know if you encounter any more problems. Best, Patricia On 04/11/2014 04:38 AM, Tyler Grummett wrote: ​Hello fieldtrip, Has anyone worked out how to handle bad channel combinations in TRENTOOL using TEprepare? In my experience it just crashes. I am hoping for a way to calculate the bad channel combinations before running TEprepare. If anyone can help, that will be greatly appreciated!! Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip ------------------------------------------------------------ Patricia Wollstadt, PhD Student MEG Unit, Brain Imaging Center Goethe University, Frankfurt, Germany Heinrich Hoffmann Strasse 10, Haus 93 B D - 60528 Frankfurt am Main _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- ------------------------------------------------------------ Patricia Wollstadt, PhD Student MEG Unit, Brain Imaging Center Goethe University, Frankfurt, Germany Heinrich Hoffmann Strasse 10, Haus 93 B D - 60528 Frankfurt am Main -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Mon Apr 14 08:08:34 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Mon, 14 Apr 2014 08:08:34 +0200 Subject: [FieldTrip] freqstatistics with sbj_chan_freq (Vit?ria Piai) Message-ID: Hi Viotira, If you don't care about time information , you can average it by specifying cfg.avgovertime = 'yes' on the TFR , then the cluster will be formed in channel-frequency format. If you use mtmfft , you should pre-select effect interval . Otherwise, it could be not consistent . Best, Haiteng > Message: 1 > Date: Sun, 13 Apr 2014 18:53:10 -0700 > From: Vit?ria Piai > To: FieldTrip discussion list > Subject: [FieldTrip] freqstatistics with sbj_chan_freq > Message-ID: <534B3F86.9070904 at gmail.com> > Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" > > Hi all, > > I'm kinda stuck not being able to figure out what's going wrong with my > freqstats, so I thought I could share it here and see if anyone can see > where I'm going wrong. > When I run freqstatistics on TFRs, I get a negative cluster (p = .001) > between 8 and 25 Hz with the topography very similar to the one in the > figure. But I just want non-time-resolved spectra. > So I have power spectra calculated with mtmfft (dpss tapers) between 1 > and 50 Hz (5 Hz smoothing) and this is the one for which I've been > trying to run freqstatistics, unsuccessfully. > I'm using a pretty standard cfg for freqstats (basically, the same I use > for the TFRs, which give me the negative cluster with p =.001) and the > data in the comparison are structured as sbj_chan_freq. With this > time-unresolved data, only posclusters are detected, with ps > .4! If I > plot the stat output, it has the exact same negative cluster as I get > for the TFRs (see Figure), and as far as I can see, no real positive > cluster, but the function doesn't even detect any negative clusters. > I must be doing something wrong because the time-resolved and > -unresolved effects are pretty much the same in the descriptives. I > remember running stats on time-unresolved data before and getting a > reasonable output, so I guess my ft_freqstatistics isn't working well > right now. I just can't figure out why. > Does anyone have any tips for how I could go about to find out why the > negative clusters are being disregarded? > > Thanks a lot, Vit?ria > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Mon Apr 14 08:23:30 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Mon, 14 Apr 2014 08:23:30 +0200 Subject: [FieldTrip] automatic artifact correction after virtual channels/beamformer Message-ID: Hi Tyler, It is always nice to computate virtual MEG channels based on artifact-corrected CLEAN data . Note that we use clean data to get the inverse spatial filter by DICS. Regrading to how to create virtual channel , please have a look at tutorial: http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors Best, Haiteng > Message: 2 > Date: Mon, 14 Apr 2014 02:54:16 +0000 > From: Tyler Grummett > To: FieldTrip discussion list > Subject: [FieldTrip] automatic artifact correction after virtual > channels/beamformer > Message-ID: > < > d9f26aff9ba640b29bfa36febf84e9cc at SIXPR03MB368.apcprd03.prod.outlook.com> > > Content-Type: text/plain; charset="us-ascii" > > ?Hello all, > > > I was just wondering whether it is necessary to use the artifact corrected > data when creating virtual channels from beamformer sources > > or whether you are able to use original, non-artifact corrected data. > > > Tyler > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140414/dca251ee/attachment-0001.html > > > > ------------------------------ > > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Mon Apr 14 09:26:44 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 14 Apr 2014 07:26:44 +0000 Subject: [FieldTrip] automatic artifact correction after virtual channels/beamformer In-Reply-To: References: Message-ID: <149bb27d65e749c5b37bb3bfab16e87b@SIXPR03MB368.apcprd03.prod.outlook.com> Hello Haiteng, Thankyou for the response. Yes I have gone through the tutorial. I use clean data to make the inverse spatial filter. But do then apply it to marked out data or can apply it to non-marked out data. Also, is there a way to append trials after you run an automatic artefact rejection algorithm over it? At the moment, I am trying to use a function that requires equal trial lengths. I can use ft_redefinetrial to grab a 2 second epoch from each 'trial'. However that feel a little crude as I am throwing out a lot of data. Your help will be greatly appreciated. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Haiteng Jiang Sent: Monday, 14 April 2014 3:53 PM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] automatic artifact correction after virtual channels/beamformer Hi Tyler, It is always nice to computate virtual MEG channels based on artifact-corrected CLEAN data . Note that we use clean data to get the inverse spatial filter by DICS. Regrading to how to create virtual channel , please have a look at tutorial: http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors Best, Haiteng Message: 2 Date: Mon, 14 Apr 2014 02:54:16 +0000 From: Tyler Grummett > To: FieldTrip discussion list > Subject: [FieldTrip] automatic artifact correction after virtual channels/beamformer Message-ID: > Content-Type: text/plain; charset="us-ascii" ?Hello all, I was just wondering whether it is necessary to use the artifact corrected data when creating virtual channels from beamformer sources or whether you are able to use original, non-artifact corrected data. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Mon Apr 14 13:34:11 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Mon, 14 Apr 2014 13:34:11 +0200 Subject: [FieldTrip] automatic artifact correction after virtual channels/beamformer Message-ID: > > Hi Tyler , > I think it makes sense to apply the inverse spatial filter on the the marked out data since you build it on this interval. In other words, non-marked out intervals data has different inverse filter. I don't understand appending trials after automatic artefact detection. Do you mean keep trials after automatic artefact detection ? Best, Haiteng > > Message: 3 > Date: Mon, 14 Apr 2014 07:26:44 +0000 > From: Tyler Grummett > To: FieldTrip discussion list > Subject: Re: [FieldTrip] automatic artifact correction after virtual > channels/beamformer > Message-ID: > < > 149bb27d65e749c5b37bb3bfab16e87b at SIXPR03MB368.apcprd03.prod.outlook.com> > > Content-Type: text/plain; charset="us-ascii" > > Hello Haiteng, > > > Thankyou for the response. Yes I have gone through the tutorial. I use > clean data to make the inverse spatial filter. But do then apply it to > > marked out data or can apply it to non-marked out data. Also, is there a > way to append trials after you run an automatic artefact > > rejection algorithm over it? At the moment, I am trying to use a function > that requires equal trial lengths. I can use ft_redefinetrial > > to grab a 2 second epoch from each 'trial'. However that feel a little > crude as I am throwing out a lot of data. > > > Your help will be greatly appreciated. > > > Tyler > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > ________________________________ > From: fieldtrip-bounces at science.ru.nl > on behalf of Haiteng Jiang > Sent: Monday, 14 April 2014 3:53 PM > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] automatic artifact correction after virtual > channels/beamformer > > Hi Tyler, > It is always nice to computate virtual MEG channels based on > artifact-corrected CLEAN data . Note that we use clean data to get the > inverse spatial filter by DICS. Regrading to how to create virtual > channel , please have a look at tutorial: > http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors > > Best, > Haiteng > > > > Message: 2 > Date: Mon, 14 Apr 2014 02:54:16 +0000 > From: Tyler Grummett tyler.grummett at flinders.edu.au>> > To: FieldTrip discussion list fieldtrip at science.ru.nl>> > Subject: [FieldTrip] automatic artifact correction after virtual > channels/beamformer > Message-ID: > < > d9f26aff9ba640b29bfa36febf84e9cc at SIXPR03MB368.apcprd03.prod.outlook.com > d9f26aff9ba640b29bfa36febf84e9cc at SIXPR03MB368.apcprd03.prod.outlook.com>> > > Content-Type: text/plain; charset="us-ascii" > > ?Hello all, > > > I was just wondering whether it is necessary to use the artifact corrected > data when creating virtual channels from beamformer sources > > or whether you are able to use original, non-artifact corrected data. > > > Tyler > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140414/dca251ee/attachment-0001.html > > > > ------------------------------ > > > > > -- > Haiteng Jiang > PhD candidate > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Visiting address > Room 2.32 > Donders Centre for Cognitive Neuroimaging > Kapittelweg 29 > 6525 EN Nijmegen > the Netherlands > > Tel.: +31 (0)243668291 > Web: https://sites.google.com/site/haitengjiang/ > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140414/c2da1c20/attachment-0001.html > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 25 > ***************************************** > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Mon Apr 14 17:45:05 2014 From: v.piai.research at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Piai?=) Date: Mon, 14 Apr 2014 08:45:05 -0700 Subject: [FieldTrip] freqstatistics with sbj_chan_freq (Vit?ria Piai) In-Reply-To: References: Message-ID: <534C0281.6010807@gmail.com> Thanks a lot, Haiteng, but that was not really the issue. I have a specific interval I'm interested in and by using dpss over that interval, my frequency resolution is better than if I use TFRs and then average. The problem really was in my cfg for the stats and I've just found out what it was. Don't know why (stupid me!!), but I set cfg.tail = 1 and that of course will only give me the right tail (posclusters!!) Thanks anyways, Vitória On 4/13/2014 11:08 PM, Haiteng Jiang wrote: > Hi Viotira, > If you don't care about time information , you can average it by > specifying cfg.avgovertime = 'yes' on the TFR , then the cluster will > be formed in channel-frequency format. If you use mtmfft , you > should pre-select effect interval . Otherwise, it could be not > consistent . > Best, > Haiteng > > > > > Message: 1 > Date: Sun, 13 Apr 2014 18:53:10 -0700 > From: Vit?ria Piai > > To: FieldTrip discussion list > > Subject: [FieldTrip] freqstatistics with sbj_chan_freq > Message-ID: <534B3F86.9070904 at gmail.com > > > Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" > > Hi all, > > I'm kinda stuck not being able to figure out what's going wrong > with my > freqstats, so I thought I could share it here and see if anyone > can see > where I'm going wrong. > When I run freqstatistics on TFRs, I get a negative cluster (p = .001) > between 8 and 25 Hz with the topography very similar to the one in the > figure. But I just want non-time-resolved spectra. > So I have power spectra calculated with mtmfft (dpss tapers) between 1 > and 50 Hz (5 Hz smoothing) and this is the one for which I've been > trying to run freqstatistics, unsuccessfully. > I'm using a pretty standard cfg for freqstats (basically, the same > I use > for the TFRs, which give me the negative cluster with p =.001) and the > data in the comparison are structured as sbj_chan_freq. With this > time-unresolved data, only posclusters are detected, with ps > .4! > If I > plot the stat output, it has the exact same negative cluster as I get > for the TFRs (see Figure), and as far as I can see, no real positive > cluster, but the function doesn't even detect any negative clusters. > I must be doing something wrong because the time-resolved and > -unresolved effects are pretty much the same in the descriptives. I > remember running stats on time-unresolved data before and getting a > reasonable output, so I guess my ft_freqstatistics isn't working well > right now. I just can't figure out why. > Does anyone have any tips for how I could go about to find out why the > negative clusters are being disregarded? > > Thanks a lot, Vit?ria > > -- > Haiteng Jiang > PhD candidate > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Visiting address > Room 2.32 > Donders Centre for Cognitive Neuroimaging > Kapittelweg 29 > 6525 EN Nijmegen > the Netherlands > > Tel.: +31 (0)243668291 > Web: https://sites.google.com/site/haitengjiang/ > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Tue Apr 15 08:13:18 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 15 Apr 2014 06:13:18 +0000 Subject: [FieldTrip] plotting virtual channels on TRENTOOL's TEplot2D Message-ID: ?Hello TRENTOOL and fieldtrip users, Has anyone been able to plot virtual channels using TRENTOOL's TEplot2D function? It requires a layout file that is prepared in ft_prepare_layout, but I cant seem to work it out with virtual channels. Tyler. ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Tue Apr 15 08:22:59 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 15 Apr 2014 06:22:59 +0000 Subject: [FieldTrip] TRENTOOL no edges Message-ID: Hello fieldtrip and TRENTOOL users, I have just finished running some TE analyses on a subject and when I have run TEgraphanalysis, it has told me that I have 16 vertexes (channels) and no edges. I had a look at the permutation values and they are pretty much all: 1.0000 0 0 NaN 1.0000 ?I must be going wrong somewhere because I find it hard to think that the channels I have chosen have no functional relationship. Can anyone help? Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Tue Apr 15 09:03:00 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 15 Apr 2014 07:03:00 +0000 Subject: [FieldTrip] automatic artifact correction after virtual channels/beamformer In-Reply-To: References: Message-ID: Hi Haiteng, Basically the automatic artefact detection algorithms removes some EEG (if artefactual) and splits the data into two trials. These trials are not the same size. TRENTOOL can only work on trials that are the same length. So I determined what the biggest trial length was and redefined the trials. ie cfg = [] cfg.length = x length ​ft_redefinetrial( cfg, data) However this is causing computational errors later on. So I was wondering whether you could append the trials together and place a discontinuation marker between them. The other thing I tried was to pass in the argument 'nan' into the reject artefact function, but then this causes an issue with the virtual channel procedure. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Haiteng Jiang Sent: Monday, 14 April 2014 9:04 PM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] automatic artifact correction after virtual channels/beamformer Hi Tyler , I think it makes sense to apply the inverse spatial filter on the the marked out data since you build it on this interval. In other words, non-marked out intervals data has different inverse filter. I don't understand appending trials after automatic artefact detection. Do you mean keep trials after automatic artefact detection ? Best, Haiteng Message: 3 Date: Mon, 14 Apr 2014 07:26:44 +0000 From: Tyler Grummett > To: FieldTrip discussion list > Subject: Re: [FieldTrip] automatic artifact correction after virtual channels/beamformer Message-ID: <149bb27d65e749c5b37bb3bfab16e87b at SIXPR03MB368.apcprd03.prod.outlook.com> Content-Type: text/plain; charset="us-ascii" Hello Haiteng, Thankyou for the response. Yes I have gone through the tutorial. I use clean data to make the inverse spatial filter. But do then apply it to marked out data or can apply it to non-marked out data. Also, is there a way to append trials after you run an automatic artefact rejection algorithm over it? At the moment, I am trying to use a function that requires equal trial lengths. I can use ft_redefinetrial to grab a 2 second epoch from each 'trial'. However that feel a little crude as I am throwing out a lot of data. Your help will be greatly appreciated. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl > on behalf of Haiteng Jiang > Sent: Monday, 14 April 2014 3:53 PM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] automatic artifact correction after virtual channels/beamformer Hi Tyler, It is always nice to computate virtual MEG channels based on artifact-corrected CLEAN data . Note that we use clean data to get the inverse spatial filter by DICS. Regrading to how to create virtual channel , please have a look at tutorial: http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors Best, Haiteng Message: 2 Date: Mon, 14 Apr 2014 02:54:16 +0000 From: Tyler Grummett >> To: FieldTrip discussion list >> Subject: [FieldTrip] automatic artifact correction after virtual channels/beamformer Message-ID: >> Content-Type: text/plain; charset="us-ascii" ?Hello all, I was just wondering whether it is necessary to use the artifact corrected data when creating virtual channels from beamformer sources or whether you are able to use original, non-artifact corrected data. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip End of fieldtrip Digest, Vol 41, Issue 25 ***************************************** -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Apr 15 11:47:13 2014 From: jm.horschig at donders.ru.nl (=?UTF-8?B?IkrDtnJuIE0uIEhvcnNjaGlnIg==?=) Date: Tue, 15 Apr 2014 11:47:13 +0200 Subject: [FieldTrip] automatic artifact correction after virtual channels/beamformer In-Reply-To: References: Message-ID: <534D0021.401@donders.ru.nl> Hi Tyler, the only way to keep the trial as a whole and still 'mark' artifactual periods is by calling ft_rejectartifact on your preprocessed data (i.e. original data incl. artifacts) using cfg.artctdef.reject = 'nan'. This will sets periods in which an artifact was detected to nan. However, there might be several downsides with this, as not all fieldtrip functions work with nans in your data. I have absolutely no clue how trentool is handling this. The only other alternative you have is to remove the whole trial, so that all your trials are of equal lengths. Maybe you can achieve a similar thing (nan-ing of artifacts) by ft_redefinetrial and specify the original .trl-matrix (given that you have not resampled). Not exactly sure, but you can give it a try if you do not have the original preprocessed data at hand anymore. Best, Jörn On 4/15/2014 9:03 AM, Tyler Grummett wrote: > > Hi Haiteng, > > > Basically the automatic artefact detection algorithms removes some EEG > (if artefactual) and splits the data into two trials. These trials are > not the same size. > > > TRENTOOL can only work on trials that are the same length. So I > determined what the biggest trial length was and redefined the trials. > > > ie cfg = [] > > cfg.length = x length > > ​ft_redefinetrial( cfg, data) > > > However this is causing computational errors later on. So I was > wondering whether you could append the trials together and place a > discontinuation marker between them. > > > The other thing I tried was to pass in the argument 'nan' into the > reject artefact function, but then this causes an issue with the > virtual channel procedure. > > > Tyler > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > ------------------------------------------------------------------------ > *From:* fieldtrip-bounces at science.ru.nl > on behalf of Haiteng Jiang > > *Sent:* Monday, 14 April 2014 9:04 PM > *To:* fieldtrip at science.ru.nl > *Subject:* Re: [FieldTrip] automatic artifact correction after virtual > channels/beamformer > > Hi Tyler , > > I think it makes sense to apply the inverse spatial filter on the the > marked out data since you build it on this interval. In other words, > non-marked out intervals data has different inverse filter. I don't > understand appending trials after automatic artefact detection. Do you > mean keep trials after automatic artefact detection ? > > Best, > Haiteng > > > Message: 3 > Date: Mon, 14 Apr 2014 07:26:44 +0000 > From: Tyler Grummett > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] automatic artifact correction after virtual > channels/beamformer > Message-ID: > <149bb27d65e749c5b37bb3bfab16e87b at SIXPR03MB368.apcprd03.prod.outlook.com > > > > Content-Type: text/plain; charset="us-ascii" > > Hello Haiteng, > > > Thankyou for the response. Yes I have gone through the tutorial. I > use clean data to make the inverse spatial filter. But do then > apply it to > > marked out data or can apply it to non-marked out data. Also, is > there a way to append trials after you run an automatic artefact > > rejection algorithm over it? At the moment, I am trying to use a > function that requires equal trial lengths. I can use ft_redefinetrial > > to grab a 2 second epoch from each 'trial'. However that feel a > little crude as I am throwing out a lot of data. > > > Your help will be greatly appreciated. > > > Tyler > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > ________________________________ > From: fieldtrip-bounces at science.ru.nl > > > on behalf of Haiteng > Jiang > > Sent: Monday, 14 April 2014 3:53 PM > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] automatic artifact correction after > virtual channels/beamformer > > Hi Tyler, > It is always nice to computate virtual MEG channels based on > artifact-corrected CLEAN data . Note that we use clean data to get > the inverse spatial filter by DICS. Regrading to how to create > virtual channel , please have a look at tutorial: > http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors > > Best, > Haiteng > > > > Message: 2 > Date: Mon, 14 Apr 2014 02:54:16 +0000 > From: Tyler Grummett >> > To: FieldTrip discussion list >> > Subject: [FieldTrip] automatic artifact correction after virtual > channels/beamformer > Message-ID: > >> > > Content-Type: text/plain; charset="us-ascii" > > ?Hello all, > > > I was just wondering whether it is necessary to use the artifact > corrected data when creating virtual channels from beamformer sources > > or whether you are able to use original, non-artifact corrected data. > > > Tyler > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > > > > -- > Haiteng Jiang > PhD candidate > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Visiting address > Room 2.32 > Donders Centre for Cognitive Neuroimaging > Kapittelweg 29 > 6525 EN Nijmegen > the Netherlands > > Tel.: +31 (0)243668291 > Web: https://sites.google.com/site/haitengjiang/ > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 25 > ***************************************** > > > > > -- > Haiteng Jiang > PhD candidate > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Visiting address > Room 2.32 > Donders Centre for Cognitive Neuroimaging > Kapittelweg 29 > 6525 EN Nijmegen > the Netherlands > > Tel.: +31 (0)243668291 > Web: https://sites.google.com/site/haitengjiang/ > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From bingshuo.li at student.uni-tuebingen.de Tue Apr 15 13:22:09 2014 From: bingshuo.li at student.uni-tuebingen.de (Bingshuo Li) Date: Tue, 15 Apr 2014 13:22:09 +0200 Subject: [FieldTrip] Question re: TMS-EEG FT Tutorial In-Reply-To: <5347ccb3.05c60e0a.716a.fffffe45SMTPIN_ADDED_BROKEN@mx.google.com> References: <5347ccb3.05c60e0a.716a.fffffe45SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: Hi Jim, Thank you very much again for your thoughtful response! I truly appreciate it! I see your point now why you interpolate after ICA. It makes sense and I think your argument is very valid. Indeed, bad channels always come up fairly independently anyways. I can for sure do my channel inspection after the ICA. Another question along the same line: Would you suggest to categorize all the IC with more than, say 30 uV, on the time-locked averaged IC, as muscle artifacts as suggested by Korhonen et al. (2011)? I often feel very puzzled when it comes to picking up ICs for removal. I feel that if I remove those high amplitude ICs, my averaged TEPs look worse. However, by keeping those high amplitude ICs, I am letting in signals with no biological plausibility. Any thoughts on that? Thanks very much! Regards, Bingshuo ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at student.uni-tuebingen.de +49-7071-29-89029 On Fri, Apr 11, 2014 at 12:48 PM, Herring, J.D. (Jim) < j.herring at fcdonders.ru.nl> wrote: > Dear Bingshuo, > > > > I am forwarding your e-mail to the Fieldtrip mailinglist so that others > can benefit and/or contribute from our discussion. > > > > The reason why I like to postpone the interpolation to after the ICA is > that I noticed that when interpolating before ICA the interpolated data > would load onto one component. Removing this component did not make sense > as it would leave a flat line in the TEP, keeping it in did not make sense > either because the interpolation was done with, for example, the decay > artifact still in the data. After removing the decay artifact with ICA you > would be left with a sharp peak in the interpolated segment. > > > > I see that it is difficult to reject trials and channels before > interpolation but keep in mind that before having done ICA large amounts of > variance of the data can be explained by the TMS related artifacts, these > will most likely cloud the detection of other types of artifacts with > functions such as ft_rejectvisual. > > > > In my experience bad channels show up as separate independent components > anyway and can be removed after having run the ICA, but that may depend on > a number of factors I’m not aware of. > > > > If you would like to reject bad channels prior to running ICA you could > also try to run ft_rejectvisual and specify cfg.latency to contain only > your pre-TMS period or a period post-TMS that does not contain any large > artifacts. That way you should at least be able to run metrics on your data > to remove bad channels. In any case you can always run ft_databrowser on > your data to visually inspect your channel time courses for bad channels > prior to running the ICA. > > > > In any case you are of course free to try running the ICA after > interpolation yourself and share your experiences, perhaps this works fine > for you J > > > > Best, > > > > Jim > > > > *From:* Bingshuo Li [mailto:bingshuo.li at cin.uni-tuebingen.de] > *Sent:* donderdag 10 april 2014 16:36 > *To:* j.herring at fcdonders.ru.nl > *Subject:* Question re: TMS-EEG FT Tutorial > > > > Dear Jim, > > I inquired you about a TMS-EEG question a while ago and you referred me to > the TMS-EEG tutorial on Fieldtrip's website. As I was following the steps > of the tutorial, there is a new question that come up to me -- Is it really > necessary to postpone the interpolation of the TMS artifact until the ICA > is done? Would there be any bad consequences if I interpolate first and > then run the ICA over the entire interpolated trial(s)? The reason I am > asking this question is that I would like to visually inspect my data first > and remove bad channels or trials (if any) prior to ICA. If the artifact is > not interpolated, it is really difficult to run visual inspection or > metrics on the data.. Following the logic of the tutorial, I can only > visual inspection after the ICA, which I think might not be a good idea as > I was told that a bad channel can easily bias the ICA result.. > > Do you have any insights in this? Thank you very much for your time in > advance! > > Sincerely, > > > ----- > Bingshuo Li (MSc. candidate) > Systems Neurophysiology Group > Centre for Integrative Neuroscience > University of Tuebingen > Otfried-Mueller-Str. 25 > D-72076 Tuebingen, Germany > > bingshuo.li at cin.uni-tuebingen.de > > +49-7071-29-89029 > > > > On Mon, Feb 10, 2014 at 3:24 PM, Herring, J.D. (Jim) < > j.herring at fcdonders.ru.nl> wrote: > > Dear Bingshuo, > > > > Please have a look at the following tutorial: > http://fieldtrip.fcdonders.nl/tutorial/tms-eeg > > > > It deals with a number of TMS-EEG related artifacts including the ‘evil’ > decay artifact. > > > > Best, > > > > Jim > > > > *From:* fieldtrip-bounces at science.ru.nl [mailto: > fieldtrip-bounces at science.ru.nl] *On Behalf Of *Bingshuo Li > *Sent:* maandag 10 februari 2014 15:06 > *To:* FieldTrip discussion list > *Subject:* [FieldTrip] TMS-EEG Decay Artifact > > > > Dear FT users and developers, > > Does anyone have any experience in dealing with the so-called decay > artifacts found in TMS-EEG? It is a relatively long lasting (up to 100ms) > artifact that follows a waveform similar to exponential decay and it occurs > sporadically in certain recording channels. > > Any tips/hints/recommendations are greatly appreciated! Thank you! > > Regards, > > > > ----- > Bingshuo Li (MSc. candidate) > Systems Neurophysiology Group > Centre for Integrative Neuroscience > University of Tuebingen > Otfried-Mueller-Str. 25 > D-72076 Tuebingen, Germany > bingshuo.li at student.uni-tuebingen.de > +49-152-06054831 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Tue Apr 15 16:03:00 2014 From: roeysc at gmail.com (Roey Schurr) Date: Tue, 15 Apr 2014 17:03:00 +0300 Subject: [FieldTrip] Resting State Data Source Reconstruction - covriance matrix in beamformer, and "avg" field in eLORETA Message-ID: Dear Fieldtrippers, First of all, a big thank you to all members of the community – it is a wonderful place to learn in and share ideas, thoughts and solutions to common problems we all face. I am writing you since I fear I might be missing something trivial: I am trying to compute an inverse solution to to resting-state EEG data. Two question arise, depending on the method I am trying to use: 1) Using a beamformer technique such as LCMV, a covariance matrix is needed. However, since the data is not time-locked (like ERP), the covariance matrix cannot be easily computed over the averaged trials. Can it be estimated using different resting-state trials? 2) Using eLORETA as the source reconstruction method (since my goal is a time-domain source reconstruction), it seems the the "avg" field is neeed in the data. Once again, no such average is available, since these are not ERP trials. Would you advise me to revise the code and try to fit it to non-ERP data, or is there some easier way I'm missing? Thank you all, Best, roey -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at fcdonders.ru.nl Wed Apr 16 09:44:46 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Wed, 16 Apr 2014 09:44:46 +0200 (CEST) Subject: [FieldTrip] Question re: TMS-EEG FT Tutorial In-Reply-To: References: <5347ccb3.05c60e0a.716a.fffffe45SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: <01e901cf5947$bcc80950$36581bf0$@herring@fcdonders.ru.nl> Hi Bingshuo, Be careful with categorizing IC’s based on their amplitudes alone. The kind people on the mailinglist may correct me if I am wrong but the exact amplitude of sources cannot be extracted using ICA. A very nice introduction to ICA by Arnaud Delorme can be found here: http://sccn.ucsd.edu/~arno/indexica.html. It contains a nice example where you can mix two sources and decompose them using fastICA (make sure to add the fastica toolbox to your matlab path, e.g. fieldtrip/external/fastica): % Create source time course A = sin(linspace(0,50, 1000)); % A B = sin(linspace(0,37, 1000)+5); % B figure; subplot(2,1,1); plot(A); % plot A subplot(2,1,2); plot(B, 'r'); % plot B % Mix sources M1 = A - 2*B; % mixing 1 M2 = 1.73*A+3.41*B; % mixing 2 figure; subplot(2,1,1); plot(M1); % plot mixing 1 subplot(2,1,2); plot(M2, 'r'); % plot mixing 2 % Decompose using ICA figure; c = fastica([M1;M2]); % compute and plot unminxing using fastICA subplot(1,2,1); plot(c(1,:)); subplot(1,2,2); plot(c(2,:)); Using the above line of code you can change the amplitude of the source time courses (e.g. by multiplying A and/or B by a constant) and you can see that the amplitude of the independent components remains unchanged. I am not 100% certain but what I think Korhonen et al. are doing is transforming the individual IC components back to sensor level and then looking at the EEG amplitudes, which would be valid. In fieldtrip you could realize this be using ft_rejectcomponent with ‘cfg.component’ set to all components except the one you would like to keep. I personally prefer to see whether the topography matches the location of areas that are stimulated by the coil and to check whether the averaged IC time courses contains the large exponential decay I would like to remove. Could it be that after removing these high amplitude ICs your TEPs only look more noisy because the vertical scaling changes while plotting? In other words, the noise was already there before but you are just zooming in more because the plotting function does not have to fit the high amplitude components in the figure? Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Bingshuo Li Sent: dinsdag 15 april 2014 13:22 To: FieldTrip discussion list Subject: Re: [FieldTrip] Question re: TMS-EEG FT Tutorial Hi Jim, Thank you very much again for your thoughtful response! I truly appreciate it! I see your point now why you interpolate after ICA. It makes sense and I think your argument is very valid. Indeed, bad channels always come up fairly independently anyways. I can for sure do my channel inspection after the ICA. Another question along the same line: Would you suggest to categorize all the IC with more than, say 30 uV, on the time-locked averaged IC, as muscle artifacts as suggested by Korhonen et al. (2011)? I often feel very puzzled when it comes to picking up ICs for removal. I feel that if I remove those high amplitude ICs, my averaged TEPs look worse. However, by keeping those high amplitude ICs, I am letting in signals with no biological plausibility. Any thoughts on that? Thanks very much! Regards, Bingshuo ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at student.uni-tuebingen.de +49-7071-29-89029 On Fri, Apr 11, 2014 at 12:48 PM, Herring, J.D. (Jim) wrote: Dear Bingshuo, I am forwarding your e-mail to the Fieldtrip mailinglist so that others can benefit and/or contribute from our discussion. The reason why I like to postpone the interpolation to after the ICA is that I noticed that when interpolating before ICA the interpolated data would load onto one component. Removing this component did not make sense as it would leave a flat line in the TEP, keeping it in did not make sense either because the interpolation was done with, for example, the decay artifact still in the data. After removing the decay artifact with ICA you would be left with a sharp peak in the interpolated segment. I see that it is difficult to reject trials and channels before interpolation but keep in mind that before having done ICA large amounts of variance of the data can be explained by the TMS related artifacts, these will most likely cloud the detection of other types of artifacts with functions such as ft_rejectvisual. In my experience bad channels show up as separate independent components anyway and can be removed after having run the ICA, but that may depend on a number of factors I’m not aware of. If you would like to reject bad channels prior to running ICA you could also try to run ft_rejectvisual and specify cfg.latency to contain only your pre-TMS period or a period post-TMS that does not contain any large artifacts. That way you should at least be able to run metrics on your data to remove bad channels. In any case you can always run ft_databrowser on your data to visually inspect your channel time courses for bad channels prior to running the ICA. In any case you are of course free to try running the ICA after interpolation yourself and share your experiences, perhaps this works fine for you J Best, Jim From: Bingshuo Li [mailto:bingshuo.li at cin.uni-tuebingen.de] Sent: donderdag 10 april 2014 16:36 To: j.herring at fcdonders.ru.nl Subject: Question re: TMS-EEG FT Tutorial Dear Jim, I inquired you about a TMS-EEG question a while ago and you referred me to the TMS-EEG tutorial on Fieldtrip's website. As I was following the steps of the tutorial, there is a new question that come up to me -- Is it really necessary to postpone the interpolation of the TMS artifact until the ICA is done? Would there be any bad consequences if I interpolate first and then run the ICA over the entire interpolated trial(s)? The reason I am asking this question is that I would like to visually inspect my data first and remove bad channels or trials (if any) prior to ICA. If the artifact is not interpolated, it is really difficult to run visual inspection or metrics on the data.. Following the logic of the tutorial, I can only visual inspection after the ICA, which I think might not be a good idea as I was told that a bad channel can easily bias the ICA result.. Do you have any insights in this? Thank you very much for your time in advance! Sincerely, ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at cin.uni-tuebingen.de +49-7071-29-89029 On Mon, Feb 10, 2014 at 3:24 PM, Herring, J.D. (Jim) wrote: Dear Bingshuo, Please have a look at the following tutorial: http://fieldtrip.fcdonders.nl/tutorial/tms-eeg It deals with a number of TMS-EEG related artifacts including the ‘evil’ decay artifact. Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Bingshuo Li Sent: maandag 10 februari 2014 15:06 To: FieldTrip discussion list Subject: [FieldTrip] TMS-EEG Decay Artifact Dear FT users and developers, Does anyone have any experience in dealing with the so-called decay artifacts found in TMS-EEG? It is a relatively long lasting (up to 100ms) artifact that follows a waveform similar to exponential decay and it occurs sporadically in certain recording channels. Any tips/hints/recommendations are greatly appreciated! Thank you! Regards, ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at student.uni-tuebingen.de +49-152-06054831 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.reinhart at vanderbilt.edu Wed Apr 16 14:42:14 2014 From: robert.reinhart at vanderbilt.edu (Rob Reinhart) Date: Wed, 16 Apr 2014 07:42:14 -0500 Subject: [FieldTrip] Beamforming Message-ID: Hello, I implemented your beamforming routine using the code that appears online ( http://fieldtrip.fcdonders.nl/tutorial/beamformer#preprocessing) and received this error, below. Can you advise? I appreciate your help. Best regards, Rob Reinhart ??? Error using ==> ft_read_headshape at 888 unknown fileformat "unknown" for head shape information Error in ==> ft_sourceplot at 890 surf = ft_read_headshape(cfg.surffile); Error in ==> FreqSourceAnalysis at 290 ft_sourceplot(cfg, sourceDiffIntNorm); -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Apr 16 16:50:38 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Wed, 16 Apr 2014 16:50:38 +0200 Subject: [FieldTrip] Beamforming In-Reply-To: References: Message-ID: Hi Rob, What's cfg.surffile in your case? It should read 'surface_white_both'. I just updated the tutorial documentation yesterday, because the old specification: 'surface_l4_both' yielded the error you report. If you indeed use 'surface_white_both' it means we have to look into it further. Best, Jan-Mathijs On Apr 16, 2014, at 2:42 PM, Rob Reinhart wrote: > Hello, > > I implemented your beamforming routine using the code that appears online (http://fieldtrip.fcdonders.nl/tutorial/beamformer#preprocessing) and received this error, below. Can you advise? I appreciate your help. > > Best regards, > > Rob Reinhart > > > ??? Error using ==> ft_read_headshape at 888 > unknown fileformat "unknown" for head shape information > > Error in ==> ft_sourceplot at 890 > surf = ft_read_headshape(cfg.surffile); > > Error in ==> FreqSourceAnalysis at 290 > ft_sourceplot(cfg, sourceDiffIntNorm); > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.reinhart at vanderbilt.edu Wed Apr 16 18:20:27 2014 From: robert.reinhart at vanderbilt.edu (Rob Reinhart) Date: Wed, 16 Apr 2014 11:20:27 -0500 Subject: [FieldTrip] Beamforming In-Reply-To: References: Message-ID: Hi Jan-Mathijs, Thanks for your speedy reply. Unfortunately, in the code I'm implementing cfg.surffile = 'surface_white_both.mat' . What do you suggest? Thanks again. Best, Rob On Wed, Apr 16, 2014 at 9:50 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > > Hi Rob, > What's cfg.surffile in your case? It should read 'surface_white_both'. I just updated the tutorial documentation yesterday, because the old specification: 'surface_l4_both' yielded the error you report. If you indeed use 'surface_white_both' it means we have to look into it further. > Best, > Jan-Mathijs > > On Apr 16, 2014, at 2:42 PM, Rob Reinhart wrote: > > Hello, > > I implemented your beamforming routine using the code that appears online (http://fieldtrip.fcdonders.nl/tutorial/beamformer#preprocessing) and received this error, below. Can you advise? I appreciate your help. > > Best regards, > > Rob Reinhart > > > ??? Error using ==> ft_read_headshape at 888 > unknown fileformat "unknown" for head shape information > > Error in ==> ft_sourceplot at 890 > surf = ft_read_headshape(cfg.surffile); > > Error in ==> FreqSourceAnalysis at 290 > ft_sourceplot(cfg, sourceDiffIntNorm); > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From luke.bloy at gmail.com Wed Apr 16 21:29:24 2014 From: luke.bloy at gmail.com (Luke Bloy) Date: Wed, 16 Apr 2014 15:29:24 -0400 Subject: [FieldTrip] covariance computation from ft_timelockanalysis Message-ID: Hi All, I'm interested in using lcmv to do a common mode differential beamformer. My understanding, please correct me if I'm incorrect, is that the best way forward would be to 1) compute a covariance matrix from a time window combining both active and control windows. 2) use this combined covariance to make a common mode lcmv beamformer 3) apply this to both active and control windows separately 4) combine into some sort of psuedo T or NAI. does this sound correct? If so the main thing I'm unclear on is how to compute the covariance for 2 distinct time intervals? is this possible? Thanks, Luke -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.m.groppe at gmail.com Thu Apr 17 04:40:35 2014 From: david.m.groppe at gmail.com (David Groppe) Date: Wed, 16 Apr 2014 22:40:35 -0400 Subject: [FieldTrip] Research Assistant Position Available in Human Brain Mapping at New York's Feinstein Institute for Medical Research Message-ID: The Laboratory for Multimodal Human Brain Mapping at the Feinstein Institute for Medical Research is looking for a research assistant to help with their research into (1) improving the identification of functional and pathological brain regions in individuals suffering from epilepsy, (2) the neural mechanisms of cognition, and (3) characterizing macroscale human brain networks. The lab works exclusively with patients being evaluated for epilepsy surgery using methods such as electrocorticography, MRI, fMRI, and direct electrical brain stimulation. The responsibilities of the research assistant include assisting with the collection and analysis of the aforementioned data, managing data archives and lab equipment, working with a research coordinator on IRB matters, and helping to present lab findings at conferences and in journals. This unique position will expose the successful applicant to basic and clinical neuroscience as well as neurosurgery and neurology. It is a great opportunity for recent post-bacs interested in medical school or graduate school in neuroscience/biomedical engineering. Past research assistants in the lab have been co-authors on lab publications and have gone on to MD or PhD programs after spending 1-2 years in the lab. ------------- Qualifications ------------- Minimum: -B.A./B.S./B.E. in an appropriate discipline (e.g., neuroscience, psychology, biomedical engineering, computer science, physics) -1 year commitment Highly Desirable: -Experience with at least one programming language (preferably MATLAB) and statistical analyses -Prior experience working with neuroimaging, EEG/MEG, or brain stimulation data -Previous experience working with patients -Previous work in a research laboratory that shows evidence of independent scholarship, problem solving, and motivation -2 year commitment preferred For more information about the lab see: http://www.feinsteininstitute.org/faculty/ashesh-mehta-md-phd/ For more information about the position please send curriculum vitae and cover letter to Dr. David Groppe (david.m.groppe at gmail.com) -- David Groppe, Ph.D. Postdoctoral Researcher Laboratory for Multimodal Human Brain Mapping Feinstein Institute for Medical Research Manhasset, New York http://www.cogsci.ucsd.edu/~dgroppe/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Apr 17 10:24:54 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Thu, 17 Apr 2014 10:24:54 +0200 Subject: [FieldTrip] Beamforming In-Reply-To: References: Message-ID: Rob, I cannot reproduce your error. The (rather uninformative) error message you get refers to the fact that FT cannot find the default surffile, which should be in ~/fieldtrip/template/anatomy. This folder should be added automatically to your matlab path if you start fieldtrip in the recommended way, i.e. using the ft_defaults function. Please update your ft-version to a recent version, start matlab and fieldtrip in the recommended way and try again. Best wishes, Jan-Mathijs On Apr 16, 2014, at 6:20 PM, Rob Reinhart wrote: > Hi Jan-Mathijs, > Thanks for your speedy reply. Unfortunately, in the code I'm implementing cfg.surffile = 'surface_white_both.mat' . What do you suggest? Thanks again. > Best, > Rob > > On Wed, Apr 16, 2014 at 9:50 AM, jan-mathijs schoffelen wrote: > > > > Hi Rob, > > What's cfg.surffile in your case? It should read 'surface_white_both'. I just updated the tutorial documentation yesterday, because the old specification: 'surface_l4_both' yielded the error you report. If you indeed use 'surface_white_both' it means we have to look into it further. > > Best, > > Jan-Mathijs > > > > On Apr 16, 2014, at 2:42 PM, Rob Reinhart wrote: > > > > Hello, > > > > I implemented your beamforming routine using the code that appears online (http://fieldtrip.fcdonders.nl/tutorial/beamformer#preprocessing) and received this error, below. Can you advise? I appreciate your help. > > > > Best regards, > > > > Rob Reinhart > > > > > > ??? Error using ==> ft_read_headshape at 888 > > unknown fileformat "unknown" for head shape information > > > > Error in ==> ft_sourceplot at 890 > > surf = ft_read_headshape(cfg.surffile); > > > > Error in ==> FreqSourceAnalysis at 290 > > ft_sourceplot(cfg, sourceDiffIntNorm); > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > Jan-Mathijs Schoffelen, MD PhD > > > > Donders Institute for Brain, Cognition and Behaviour, > > Centre for Cognitive Neuroimaging, > > Radboud University Nijmegen, The Netherlands > > > > Max Planck Institute for Psycholinguistics, > > Nijmegen, The Netherlands > > > > J.Schoffelen at donders.ru.nl > > Telephone: +31-24-3614793 > > > > http://www.hettaligebrein.nl > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Apr 17 10:27:09 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Thu, 17 Apr 2014 10:27:09 +0200 Subject: [FieldTrip] covariance computation from ft_timelockanalysis In-Reply-To: References: Message-ID: Hi Luke, On Apr 16, 2014, at 9:29 PM, Luke Bloy wrote: > Hi All, > > I'm interested in using lcmv to do a common mode differential beamformer. My understanding, please correct me if I'm incorrect, is that the best way forward would be to > 1) compute a covariance matrix from a time window combining both active and control windows. > 2) use this combined covariance to make a common mode lcmv beamformer > 3) apply this to both active and control windows separately > 4) combine into some sort of psuedo T or NAI. > > does this sound correct? Yes it does. > If so the main thing I'm unclear on is how to compute the covariance for 2 distinct time intervals? is this possible? What you could do is call ft_timelockanalysis twice: each time with a different cfg.covariancewindow. Assuming you have an equal number of trials for both time windows, averaging the two covariance matrices will give you the combined covariance matrix. Best, Jan-Mathijs > > Thanks, > Luke > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From walshc11 at tcd.ie Thu Apr 17 11:35:05 2014 From: walshc11 at tcd.ie (Christian Walsh) Date: Thu, 17 Apr 2014 10:35:05 +0100 Subject: [FieldTrip] Problem with unwanted 'normalisation' of data using ft_realtime_signalviewer Message-ID: Dear community, My name is Christian Walsh and I am doing a Neural Engineering MSc. in TCD in Ireland. My thesis is on the effects of timed auditory stimulation on sleep quality. A sort of dumbed down and scaled down version of a recent enough study by Ngo et al. (2013) entitled: Auditory Closed-Loop Stimulation of the Sleep Slow Oscillations Enhances Memory. For this, I detect peaks and troughs in the ongoing EEG data in realtime. On detecting a trough, a sound is played back after an initial delay. This is done so that the sound playback coincides with the peak of the ongoing EEG data. Before I can actually perform this experiment I need to setup the apparatus. To do this I have simulated realtime streaming and analysis using the ft_realtime_signalproxy function in one MATLAB session and an edited_ft_realtime_powerestimate and psychtoolbox function in another session. This is all working fine. The problem is that the data that is streamed in is normalised, scaled or something. i.e. the y-values of the streamed data should range from around -150 uV to 150uV but the edited_ft_realtime_powerestimate function only displays y-values between around -2 and 2??? I'm new to programming so apologies if this is a stupid question. I have looked into editing some of the ft_read_data and ft_preproc_baselinecorrect functions but have not found a solution. Advice would be appreciated, Cheers, Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: From luke.bloy at gmail.com Thu Apr 17 20:16:30 2014 From: luke.bloy at gmail.com (Luke Bloy) Date: Thu, 17 Apr 2014 14:16:30 -0400 Subject: [FieldTrip] covariance computation from ft_timelockanalysis In-Reply-To: References: Message-ID: Dear Jan-Mathijs Thank you for the quick response. Computing the covariance seems to be working fine now. I'm curious what you would suggest for computing the differential power? at the moment I'm not keeping any trial measures (cfg.keeptrials='no') in either ft_timelockanalysis or ft_sourceanalysis. I'm then computing a psuedoT as act_sourceAnalysis.avg.pseudoT = (act_sourceAnalysis.avg.pow - cnt_sourceAnalysis.avg.pow)./(act_sourceAnalysis.avg.noise + cnt_sourceAnalysis.avg.noise); I wanted to compare this pseudoT to a standard T score. I can get trial by trial power estimates by using cfg.keeptrials='yes' in ft_timelockanalysis and cfg.keeptrials='yes' and ctf.rawtrial='yes' in ft_sourceanalysis. but ft_sourcestatistics doesn't seem to let me do a paired T the way I would hope. Is there an alternative route that you might take or is there another method that could be useful? Thanks, Luke On Thu, Apr 17, 2014 at 4:27 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi Luke, > > On Apr 16, 2014, at 9:29 PM, Luke Bloy wrote: > > Hi All, > > I'm interested in using lcmv to do a common mode differential beamformer. > My understanding, please correct me if I'm incorrect, is that the best way > forward would be to > 1) compute a covariance matrix from a time window combining both active > and control windows. > 2) use this combined covariance to make a common mode lcmv beamformer > 3) apply this to both active and control windows separately > 4) combine into some sort of psuedo T or NAI. > > does this sound correct? > > > Yes it does. > > If so the main thing I'm unclear on is how to compute the covariance for 2 > distinct time intervals? is this possible? > > > What you could do is call ft_timelockanalysis twice: each time with a > different cfg.covariancewindow. Assuming you have an equal number of trials > for both time windows, averaging the two covariance matrices will give you > the combined covariance matrix. > > Best, > Jan-Mathijs > > > > Thanks, > Luke > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Fri Apr 18 11:38:12 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Fri, 18 Apr 2014 11:38:12 +0200 Subject: [FieldTrip] Resting State Data Source Reconstruction - covriance matrix in beamformer, and "avg" field in eLORETA Message-ID: > > Dear Roey, > I don't have answer to your question but I have some thoughts. Firstly , you can cut your EEG resting state data into trials (2s per trial) . Since the dominant frequency of resting state is alpha , you can build frequency domain beamformer 'DICS' with (cfg.normalize='yes') to normalize the lead field , which will avoid bias toward the center of the head (http://fieldtrip.fcdonders.nl/tutorial/beamformer). After that , you can use virtual channel (all voxels) to extract the time series ( http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors). However, I am not sure whether it makes sense or not . Maybe the experts can comment on it. Best, Haiteng > > > Message: 2 > Date: Tue, 15 Apr 2014 17:03:00 +0300 > From: Roey Schurr > To: FieldTrip discussion list > Subject: [FieldTrip] Resting State Data Source Reconstruction - > covriance matrix in beamformer, and "avg" field in eLORETA > Message-ID: > zYfDVYjg at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Dear Fieldtrippers, > > > First of all, a big thank you to all members of the community ? it is a > wonderful place to learn in and share ideas, thoughts and solutions to > common problems we all face. > > > I am writing you since I fear I might be missing something trivial: I am > trying to compute an inverse solution to to resting-state EEG data. Two > question arise, depending on the method I am trying to use: > > > 1) Using a beamformer technique such as LCMV, a covariance matrix is > needed. However, since the data is not time-locked (like ERP), the > covariance matrix cannot be easily computed over the averaged trials. Can > it be estimated using different resting-state trials? > > 2) Using eLORETA as the source reconstruction method (since my goal is > a time-domain source reconstruction), it seems the the "avg" field is neeed > in the data. Once again, no such average is available, since these are not > ERP trials. > > Would you advise me to revise the code and try to fit it to non-ERP data, > or is there some easier way I'm missing? > > > Thank you all, > > Best, > > roey > > > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Apr 22 09:01:25 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 22 Apr 2014 09:01:25 +0200 Subject: [FieldTrip] Problem with unwanted 'normalisation' of data using ft_realtime_signalviewer In-Reply-To: References: Message-ID: <535613C5.4040209@donders.ru.nl> Hi Christian, I had a quick look at these function. I think these values are a result of the fact that a) power corresponds to the squared magnitude of a signal b) is line 157 of ft_realtime_powerestimate, the power is divided by the number of channels. Maybe put a breakpoint somewhere around line 130 and check step by step what happens to your data? Note also that this is just an example function, so it might not be practical for real experiment. Best, Jörn On 4/17/2014 11:35 AM, Christian Walsh wrote: > Dear community, > > My name is Christian Walsh and I am doing a Neural Engineering MSc. in > TCD in Ireland. My thesis is on the effects of timed auditory > stimulation on sleep quality. A sort of dumbed down and scaled down > version of a recent enough study by Ngo et al. (2013) entitled: > Auditory Closed-Loop Stimulation of the Sleep Slow Oscillations > Enhances Memory. > > For this, I detect peaks and troughs in the ongoing EEG data in > realtime. On detecting a trough, a sound is played back after an > initial delay. This is done so that the sound playback coincides with > the peak of the ongoing EEG data. Before I can actually perform this > experiment I need to setup the apparatus. > > To do this I have simulated realtime streaming and analysis using the > ft_realtime_signalproxy function in one MATLAB session and an > edited_ft_realtime_powerestimate and psychtoolbox function in another > session. This is all working fine. The problem is that the data that > is streamed in is normalised, scaled or something. i.e. the y-values > of the streamed data should range from around -150 uV to 150uV but the > edited_ft_realtime_powerestimate function only displays y-values > between around -2 and 2??? > > I'm new to programming so apologies if this is a stupid question. I > have looked into editing some of the ft_read_data and > ft_preproc_baselinecorrect functions but have not found a solution. > > Advice would be appreciated, > > Cheers, > > Christian > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From haiteng.jiang at gmail.com Wed Apr 23 07:13:13 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Wed, 23 Apr 2014 07:13:13 +0200 Subject: [FieldTrip] DecMeg2014 competition: decoding the human brain Message-ID: Biomag 2014 Decoding Challenge - Brain Decoding Across Subjects https://www.kaggle.com/c/decoding-the-human-brain Decoding mental states from functional neuroimaging data is a data analysis paradigm adopted both in neuroscience studies and in brain-computer interface applications. Decoding means determining, from the recorded brain activity, what stimulus was provided to a subject. In this competition, a large number of trials, from a face vs. scrambled face visual task, are available from multiple subjects. The brain activity was recorded by means of magnetoencephalography (MEG). MEG recordings from various subjects and the category of the associated visual stimuli are given to the participants of the competition in order to train their prediction algorithms. With their algorithms, the participants will have to predict the category of the stimulus of a different set of MEG recordings, from other subjects. Each submission to the competition will be scored according to the accuracy of prediction. Decoding across subjects is a difficult task because of the variability in head shape, cortical folding and functional organisation. For MEG data, the literature on decoding across subjects is still in early stages and competition aims at raising the awareness about this complex scientific problem. This competition is associated with the the 19th International Conference on Biomagnetism, Biomag 2014, Halifax (Canada), August 24-28, 2014. The competition begins: April 21st, 2014. The competition ends: July 27th, 2014. Prizes: 1st 3,000 USD, 2nd 1,500 USD, 3rd 500 USD. Organizers: Emanuele Olivetti, Seyed Mostafa Kia and Paolo Avesani (NeuroInformatics Lab, Bruno Kessler Foundation and University of Trento, IT), e-mail: decmeg2014 at list.fbk.eu. Scientific steering committee: Ole Jensen (Donders Institute, NL),> Nathan Weisz (University of Trento, IT), Richard Henson (MRC/CBU, UK) and Alexandre Gramfort (Telecom ParisTech, CNRS, CEA / Neurospin). We would also like to thank Daniel Wakeman (Martinos Center, MGH, USA). The awards for this competition are funded by Elekta Oy, MEG International Services Ltd (MISL), Fondazione Bruno Kessler and Besa Gmbh. Relevant links: - competition website: https://www.kaggle.com/c/decoding-the-human-brain - Biomag 2014: http://www.biomag2014.org - NeuroInformatics Lab: http://nilab.fbk.eu - Elekta Oy: http://www.elekta.com - MISL (CTF MEG): http://www.ctfmeg.com - Fondazione Bruno Kessler: http://www.fbk.eu - Besa GmbH: http://www.besa.de Please feel free to forward this message to your colleagues or contacts who might be interested in this competition. -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmontefusco at med.uchile.cl Wed Apr 23 16:46:54 2014 From: rmontefusco at med.uchile.cl (Rodrigo Montefusco) Date: Wed, 23 Apr 2014 10:46:54 -0400 Subject: [FieldTrip] Bug 2010 Message-ID: Hi Fieldtripers, I have an issue with Fieldtrip, calling ft_timelockanalysis in a Mac with matlab 32bit. I found this bug reported around a year ago and I don't know if someone has the compiled file they mention. http://bugzilla.fcdonders.nl/show_bug.cgi?id=2010 Thanks a lot! Best Rodrigo -- Y ================================ *Dr. Rodrigo A. Montefusco-Siegmund, Ph.D.* Postdoctoral Fellow, York University Centre for Vision Research Department of Psychology +1 647 975 3847+1 647 975 3847+1 647 975 3847+1 647 975 3847 yoguito at gmail.com Call Send SMS Add to Skype You'll need Skype CreditFree via Skype Call Send SMS Add to Skype You'll need Skype CreditFree via Skype -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Wed Apr 23 16:54:20 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 23 Apr 2014 16:54:20 +0200 Subject: [FieldTrip] Bug 2010 In-Reply-To: References: Message-ID: <5357D41C.5070407@donders.ru.nl> Hi Rodrigo, does it work for you when you compile the file locally? The source is in FieldTrip/external/fileexchange Just try to call >> mex CalcMD5.c If it works, Matlab creates a mexmaci file and from then one, you should never have such problems again. Btw, if it does work, it would be nice if you sent us the CalcMD5.mexmaci file, so that we can add it to FieldTrip :) If you have trouble doing so, or any other questions, feel free to ask. Best, Jörn On 4/23/2014 4:46 PM, Rodrigo Montefusco wrote: > Hi Fieldtripers, > > I have an issue with Fieldtrip, calling ft_timelockanalysis in a Mac > with matlab 32bit. I found this bug reported around a year ago and I > don't know if someone has the compiled file they mention. > http://bugzilla.fcdonders.nl/show_bug.cgi?id=2010 > > Thanks a lot! > > Best > > Rodrigo > > -- > > > Y > > > ================================ > *Dr. Rodrigo A. Montefusco-Siegmund, Ph.D.* > Postdoctoral Fellow, York University > Centre for Vision Research > Department of Psychology > +1 647 975 3847+1 647 975 3847+1 647 975 3847+1 647 975 3847 > yoguito at gmail.com > Call > Send SMS > Add to Skype > You'll need Skype CreditFree via Skype > Call > Send SMS > Add to Skype > You'll need Skype CreditFree via Skype > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From file.balint at ttk.mta.hu Thu Apr 24 16:23:52 2014 From: file.balint at ttk.mta.hu (Balint File) Date: Thu, 24 Apr 2014 16:23:52 +0200 Subject: [FieldTrip] cluster based permutation test - cfg.clusteralpha threshold Message-ID: <53591E78.5020208@ttk.mta.hu> Dear Fieldtrip experts, Recently I started to apply the spatial dimension (electrode neighborhood) of the cluster based permutation test. My question is: it's a valid way to choose a more permissive threshold (cfg.clusteralpha) at the level of the clusters identifying t-tests? According to the publication of Maris et al., 2007 ("this threshold does not affect the FA rate of the statistical test. However, this threshold does affect the sensitivity of the test. For example, weak but long-lasting effects are not detected when the threshold is large") it seems to me, that this threshold depends on the nature of the data.For lower cfg.clusteralpha threshold (<0.15) I get more extensive (and more explainable) results and the clusters still show high significance (<<0.025) at the permutation test. Thanks in advance for your help. Best regards, Bálint File -------------- next part -------------- An HTML attachment was scrubbed... URL: From guofashou at gmail.com Thu Apr 24 16:54:10 2014 From: guofashou at gmail.com (guofa shou) Date: Thu, 24 Apr 2014 09:54:10 -0500 Subject: [FieldTrip] between subject permutation test Message-ID: Hi, Fieldtripers, I have a question about the parameters setting about running cluster-based permutation test on group-level frequency data. Specifically, I have two groups, one is 12 subjects (i.e., 12 averaged powers), the other is 10 subjects (10 averaged powers), I want to do comparison on the sensor powers between these two groups. so how can I set cfg.statistic, cfg.design. Thanks! Guofa -- Guofa Shou PhD Research fellow, Computational Neuroimaging and Neuroengineering Laboratory, University of Oklahoma 3100 Monitor Ave. Suit 280 phone: 405-496-8661 -------------- next part -------------- An HTML attachment was scrubbed... URL: From aaron.schurger at gmail.com Thu Apr 24 18:24:44 2014 From: aaron.schurger at gmail.com (Aaron Schurger) Date: Thu, 24 Apr 2014 18:24:44 +0200 Subject: [FieldTrip] cluster based permutation test - cfg.clusteralpha threshold In-Reply-To: <53591E78.5020208@ttk.mta.hu> References: <53591E78.5020208@ttk.mta.hu> Message-ID: Dear Balint, It was difficult to parse your question: "it’s a valid way to choose a more permissive threshold (cfg.clusteralpha) at the level of the clusters identifying t-tests?" If you are asking whether or not it is valid to use a lower point-wise threshold, then it is technically valid, but if, for example, you try every possible point-wise threshold from 0.01 to 0.20 in steps of 0.01, and you manage to find one that gives you a significant result - well that should be avoided. Otherwise it is OK. You might also try this: http://www.biomedcentral.com/1471-2202/14/122 with code available here: https://bitbucket.org/emsf/emsf_matlab Instead of trying to find clusters of points that covary with an experimental effect, you try to find a temporo-spatial weighting that maximizes the experimental effect, and then look at the spatial patterns (clusters) that give you the effect. Best, Aaron On Thu, Apr 24, 2014 at 4:23 PM, Balint File wrote: > Dear Fieldtrip experts, > > Recently I started to apply the spatial dimension (electrode neighborhood) > of the cluster based permutation test. My question is: it’s a valid way to > choose a more permissive threshold (cfg.clusteralpha) at the level of the > clusters identifying t-tests? According to the publication of Maris et al., > 2007 („this threshold does not affect the FA rate of the statistical test. > However, this threshold does affect the sensitivity of the test. For > example, weak but long-lasting effects are not detected when the threshold > is large”) it seems to me, that this threshold depends on the nature of the > data. For lower cfg.clusteralpha threshold (<0.15) I get more extensive > (and more explainable) results and the clusters still show high > significance (<<0.025) at the permutation test. > > Thanks in advance for your help. > > Best regards, > > Bálint File > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Aaron Schurger, PhD Senior researcher Laboratory of Cognitive Neuroscience Brain-Mind Institute, Department of Life Sciences École Polytechnique Fédérale de Lausanne Station 19, AI 2101 1015 Lausanne, Switzerland +41 21 693 1771 aaron.schurger at epfl.ch http://lnco.epfl.ch/ From haiteng.jiang at gmail.com Fri Apr 25 13:35:40 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Fri, 25 Apr 2014 13:35:40 +0200 Subject: [FieldTrip] between subject permutation test (guofa shou) Message-ID: Hi Guofa, This is quite similar to between trial experiment ( http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq). In your case, you could specify something like this: cfg.statistic = 'indepsamplesT'; design = zeros(1,22); design(1,10) = 1; % group 1 design(1,11:22) = 2; % group 2 cfg.design = design; cfg.ivar = 1; Best, Haiteng > > Message: 2 > Date: Thu, 24 Apr 2014 09:54:10 -0500 > From: guofa shou > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] between subject permutation test > Message-ID: > < > CAC4CbVLP176SnaPyBDfwqOkdO-jqQnMNFHRTytaQjk5Hsiuaog at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi, Fieldtripers, > I have a question about the parameters setting about running > cluster-based permutation test on group-level frequency data. Specifically, > I have two groups, one is 12 subjects (i.e., 12 averaged powers), the other > is 10 subjects (10 averaged powers), I want to do comparison on the sensor > powers between these two groups. so how can I set cfg.statistic, > cfg.design. > Thanks! > Guofa > > -- > Guofa Shou PhD > Research fellow, > Computational Neuroimaging and Neuroengineering Laboratory, > University of Oklahoma > 3100 Monitor Ave. Suit 280 > phone: 405-496-8661 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140424/5199110d/attachment-0001.html > > > > ------------------------------ > > Message: 3 > Date: Thu, 24 Apr 2014 18:24:44 +0200 > From: Aaron Schurger > To: FieldTrip discussion list > Subject: Re: [FieldTrip] cluster based permutation test - > cfg.clusteralpha threshold > Message-ID: > 8HFQpK3HHf6-Ba0g at mail.gmail.com> > Content-Type: text/plain; charset=UTF-8 > > Dear Balint, > It was difficult to parse your question: "it?s a valid way to choose a > more permissive threshold (cfg.clusteralpha) at the level of the > clusters identifying t-tests?" If you are asking whether or not it is > valid to use a lower point-wise threshold, then it is technically > valid, but if, for example, you try every possible point-wise > threshold from 0.01 to 0.20 in steps of 0.01, and you manage to find > one that gives you a significant result - well that should be avoided. > Otherwise it is OK. You might also try this: > http://www.biomedcentral.com/1471-2202/14/122 with code available > here: https://bitbucket.org/emsf/emsf_matlab > > Instead of trying to find clusters of points that covary with an > experimental effect, you try to find a temporo-spatial weighting that > maximizes the experimental effect, and then look at the spatial > patterns (clusters) that give you the effect. > > Best, > Aaron > > On Thu, Apr 24, 2014 at 4:23 PM, Balint File > wrote: > > Dear Fieldtrip experts, > > > > Recently I started to apply the spatial dimension (electrode > neighborhood) > > of the cluster based permutation test. My question is: it?s a valid way > to > > choose a more permissive threshold (cfg.clusteralpha) at the level of the > > clusters identifying t-tests? According to the publication of Maris et > al., > > 2007 (?this threshold does not affect the FA rate of the statistical > test. > > However, this threshold does affect the sensitivity of the test. For > > example, weak but long-lasting effects are not detected when the > threshold > > is large?) it seems to me, that this threshold depends on the nature of > the > > data. For lower cfg.clusteralpha threshold (<0.15) I get more extensive > > (and more explainable) results and the clusters still show high > > significance (<<0.025) at the permutation test. > > > > Thanks in advance for your help. > > > > Best regards, > > > > B?lint File > > > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Aaron Schurger, PhD > Senior researcher > Laboratory of Cognitive Neuroscience > Brain-Mind Institute, Department of Life Sciences > ?cole Polytechnique F?d?rale de Lausanne > Station 19, AI 2101 > 1015 Lausanne, Switzerland > +41 21 693 1771 > aaron.schurger at epfl.ch > http://lnco.epfl.ch/ > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 33 > ***************************************** > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Mon Apr 28 13:12:03 2014 From: pgoodin at swin.edu.au (Peter Goodin) Date: Mon, 28 Apr 2014 11:12:03 +0000 Subject: [FieldTrip] Sizing problems using SPM'd cortex mesh Message-ID: Dear Fieldtrippers, I've been using SPM to make the tessellated cortex mesh and then trying to use the outputted cortex gifti file as the source model. I've been making the head model via the method outlined in the tutorial (segmented MRI image etc). Everything appears to go fine except the size of the source model is slightly smaller than the head model (see attached image). I'm not really sure how to get around this or how much it'll affect the accuracy of the localisation Any help would be greatly appreciated! Peter __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 http://www.swinburne.edu.au/swinburneresearchers/index.php?fuseaction=profile&pid=4149 Monash Alfred Psychiatry Research Centre (MAPrc) Level 4, 607 St Kilda Road, Melbourne 3004 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: small_brain.tif Type: image/tiff Size: 83960 bytes Desc: small_brain.tif URL: From elisa at csl.psychol.cam.ac.uk Mon Apr 28 16:52:56 2014 From: elisa at csl.psychol.cam.ac.uk (Elisa Carrus) Date: Mon, 28 Apr 2014 15:52:56 +0100 Subject: [FieldTrip] problem with ft_resampledata after ft_preprocessing (inc. Hilbert) Message-ID: <535E6B48.4050401@csl.psychol.cam.ac.uk> Hi FT users, I am having some problems with resampling (downsampling) the data. Here is what I'm doing: I preprocess the continuous data to obtain band-pass filtered signal in several frequencies (4-8,8-12,12-30, etc), also taking the abs value of the Hilbert transform. The absolute value of the Hilbert is ultimately what I need. I have used the following code: / //cfg = [];// //cfg.channel = 'MEG';// //cfg.demean = 'yes';// //cfg.detrend = 'yes';// //cfg.lpfilter = 'yes';// //cfg.hilbert = 'abs';// //cfg.hpfilter = 'yes';// //cfg.hilbert = 'abs';// //cfg.lpfreq = 30;// //cfg.hpfreq = 12;// //cfg.dataset = '0061_syntask_02_raw_ssst_td.fif';// //cfg.continuous = 'yes';// //beta = ft_preprocessing(cfg);// / After this, I epoch the data as follows /cfg = [];// //cfg.trl = trl2; % this is a trial definition previously created// //beta_ep = ft_redefinetrial(cfg,beta);/ and then I downsample as follows: /cfg = [];// //cfg.resamplefs = 500;// //beta_epdw = ft_resampledata(cfg, beta_ep)/ I don't encounter any errors, but the strange thing is that the data looks fine up to before I downsample (i.e.g. if I plot one trial, it's all positive values, as I would expect from the abs of the Hilbert), but if I plot the downsampled data, the signal has both negative and positive values. Is there something I'm missing? Thanks a lot if you can help, Elisa -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Mon Apr 28 17:32:07 2014 From: julian.keil at gmail.com (Julian Keil) Date: Mon, 28 Apr 2014 17:32:07 +0200 Subject: [FieldTrip] problem with ft_resampledata after ft_preprocessing (inc. Hilbert) In-Reply-To: <535E6B48.4050401@csl.psychol.cam.ac.uk> References: <535E6B48.4050401@csl.psychol.cam.ac.uk> Message-ID: Hi Elisa, did you check your .cfg of the output for demean and detrend? Depending on the FT-Version you use, the defaults may be to demean and detrend your data which might center the data around 0. See the help of your fr_resampledata-function for more info. Best, Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 28.04.2014 um 16:52 schrieb Elisa Carrus: > Hi FT users, > > I am having some problems with resampling (downsampling) the data. > > Here is what I'm doing: > > I preprocess the continuous data to obtain band-pass filtered signal in several frequencies (4-8,8-12,12-30, etc), also taking the abs value of the Hilbert transform. The absolute value of the Hilbert is ultimately what I need. > > I have used the following code: > > cfg = []; > cfg.channel = 'MEG'; > cfg.demean = 'yes'; > cfg.detrend = 'yes'; > cfg.lpfilter = 'yes'; > cfg.hilbert = 'abs'; > cfg.hpfilter = 'yes'; > cfg.hilbert = 'abs'; > cfg.lpfreq = 30; > cfg.hpfreq = 12; > cfg.dataset = '0061_syntask_02_raw_ssst_td.fif'; > cfg.continuous = 'yes'; > beta = ft_preprocessing(cfg); > > After this, I epoch the data as follows > > cfg = []; > cfg.trl = trl2; % this is a trial definition previously created > beta_ep = ft_redefinetrial(cfg,beta); > > and then I downsample as follows: > > cfg = []; > cfg.resamplefs = 500; > beta_epdw = ft_resampledata(cfg, beta_ep) > > I don't encounter any errors, but the strange thing is that the data looks fine up to before I downsample (i.e.g. if I plot one trial, it's all positive values, as I would expect from the abs of the Hilbert), but if I plot the downsampled data, the signal has both negative and positive values. > > Is there something I'm missing? > > Thanks a lot if you can help, > > Elisa > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From elisa at csl.psychol.cam.ac.uk Mon Apr 28 17:45:28 2014 From: elisa at csl.psychol.cam.ac.uk (Elisa Carrus) Date: Mon, 28 Apr 2014 16:45:28 +0100 Subject: [FieldTrip] problem with ft_resampledata after ft_preprocessing (inc. Hilbert) In-Reply-To: References: <535E6B48.4050401@csl.psychol.cam.ac.uk> Message-ID: <535E7798.8090201@csl.psychol.cam.ac.uk> Ah, that's it! I should have set demean to 'no'. Thanks! On 28/04/2014 16:32, Julian Keil wrote: > Hi Elisa, > > did you check your .cfg of the output for demean and detrend? > Depending on the FT-Version you use, the defaults may be to demean and > detrend your data which might center the data around 0. > > See the help of your fr_resampledata-function for more info. > > Best, > > Julian > > > ******************** > *Dr. Julian Keil* > * > * > AG Multisensorische Integration > Psychiatrische Universitätsklinik > der Charité im St. Hedwig-Krankenhaus > Große Hamburger Straße 5-11, Raum E 307 > 10115 Berlin > > Telefon: +49-30-2311-1879 > Fax: +49-30-2311-2209 > http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration > > Am 28.04.2014 um 16:52 schrieb Elisa Carrus: > >> Hi FT users, >> >> I am having some problems with resampling (downsampling) the data. >> >> Here is what I'm doing: >> >> I preprocess the continuous data to obtain band-pass filtered signal >> in several frequencies (4-8,8-12,12-30, etc), also taking the abs >> value of the Hilbert transform. The absolute value of the Hilbert is >> ultimately what I need. >> >> I have used the following code: >> / >> //cfg = [];// >> //cfg.channel = 'MEG';// >> //cfg.demean = 'yes';// >> //cfg.detrend = 'yes';// >> //cfg.lpfilter = 'yes';// >> //cfg.hilbert = 'abs';// >> //cfg.hpfilter = 'yes';// >> //cfg.hilbert = 'abs';// >> //cfg.lpfreq = 30;// >> //cfg.hpfreq = 12;// >> //cfg.dataset = '0061_syntask_02_raw_ssst_td.fif';// >> //cfg.continuous = 'yes';// >> //beta = ft_preprocessing(cfg);// >> / >> After this, I epoch the data as follows >> >> /cfg = [];// >> //cfg.trl = trl2; % this is a trial definition previously created// >> //beta_ep = ft_redefinetrial(cfg,beta);/ >> >> and then I downsample as follows: >> >> /cfg = [];// >> //cfg.resamplefs = 500;// >> //beta_epdw = ft_resampledata(cfg, beta_ep)/ >> >> I don't encounter any errors, but the strange thing is that the data >> looks fine up to before I downsample (i.e.g. if I plot one trial, >> it's all positive values, as I would expect from the abs of the >> Hilbert), but if I plot the downsampled data, the signal has both >> negative and positive values. >> >> Is there something I'm missing? >> >> Thanks a lot if you can help, >> >> Elisa >> >> >> >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From guofashou at gmail.com Tue Apr 29 04:15:15 2014 From: guofashou at gmail.com (guofa shou) Date: Mon, 28 Apr 2014 21:15:15 -0500 Subject: [FieldTrip] fieldtrip Digest, Vol 41, Issue 34 In-Reply-To: References: Message-ID: Thanks, Haiteng. And I have one more question about which coherence equation was used in Fieldtrip? I have checked the code, it seems it is different compared to the following equation (from Srinivasan, Ramesh, et al. "EEG and MEG coherence: measures of functional connectivity at distinct spatial scales of neocortical dynamics." *Journal of neuroscience methods* 166.1 (2007): 41-52.): [image: Inline image 2] [image: Inline image 1] Thanks, On Sat, Apr 26, 2014 at 5:00 AM, wrote: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: between subject permutation test (guofa shou) (Haiteng Jiang) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 25 Apr 2014 13:35:40 +0200 > From: Haiteng Jiang > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] between subject permutation test (guofa shou) > Message-ID: > ESHa93x8hXXP2LaqRGrA at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi Guofa, > This is quite similar to between trial experiment ( > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq). In your > case, you could specify something like this: > > cfg.statistic = 'indepsamplesT'; > design = zeros(1,22); > design(1,10) = 1; % group 1 > design(1,11:22) = 2; % group 2 > cfg.design = design; > cfg.ivar = 1; > > Best, > > Haiteng > > > > > > > Message: 2 > > Date: Thu, 24 Apr 2014 09:54:10 -0500 > > From: guofa shou > > To: fieldtrip at science.ru.nl > > Subject: [FieldTrip] between subject permutation test > > Message-ID: > > < > > CAC4CbVLP176SnaPyBDfwqOkdO-jqQnMNFHRTytaQjk5Hsiuaog at mail.gmail.com> > > Content-Type: text/plain; charset="utf-8" > > > > Hi, Fieldtripers, > > I have a question about the parameters setting about running > > cluster-based permutation test on group-level frequency data. > Specifically, > > I have two groups, one is 12 subjects (i.e., 12 averaged powers), the > other > > is 10 subjects (10 averaged powers), I want to do comparison on the > sensor > > powers between these two groups. so how can I set cfg.statistic, > > cfg.design. > > Thanks! > > Guofa > > > > -- > > Guofa Shou PhD > > Research fellow, > > Computational Neuroimaging and Neuroengineering Laboratory, > > University of Oklahoma > > 3100 Monitor Ave. Suit 280 > > phone: 405-496-8661 > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: < > > > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140424/5199110d/attachment-0001.html > > > > > > > ------------------------------ > > > > Message: 3 > > Date: Thu, 24 Apr 2014 18:24:44 +0200 > > From: Aaron Schurger > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] cluster based permutation test - > > cfg.clusteralpha threshold > > Message-ID: > > > 8HFQpK3HHf6-Ba0g at mail.gmail.com> > > Content-Type: text/plain; charset=UTF-8 > > > > Dear Balint, > > It was difficult to parse your question: "it?s a valid way to choose a > > more permissive threshold (cfg.clusteralpha) at the level of the > > clusters identifying t-tests?" If you are asking whether or not it is > > valid to use a lower point-wise threshold, then it is technically > > valid, but if, for example, you try every possible point-wise > > threshold from 0.01 to 0.20 in steps of 0.01, and you manage to find > > one that gives you a significant result - well that should be avoided. > > Otherwise it is OK. You might also try this: > > http://www.biomedcentral.com/1471-2202/14/122 with code available > > here: https://bitbucket.org/emsf/emsf_matlab > > > > Instead of trying to find clusters of points that covary with an > > experimental effect, you try to find a temporo-spatial weighting that > > maximizes the experimental effect, and then look at the spatial > > patterns (clusters) that give you the effect. > > > > Best, > > Aaron > > > > On Thu, Apr 24, 2014 at 4:23 PM, Balint File > > wrote: > > > Dear Fieldtrip experts, > > > > > > Recently I started to apply the spatial dimension (electrode > > neighborhood) > > > of the cluster based permutation test. My question is: it?s a valid way > > to > > > choose a more permissive threshold (cfg.clusteralpha) at the level of > the > > > clusters identifying t-tests? According to the publication of Maris et > > al., > > > 2007 (?this threshold does not affect the FA rate of the statistical > > test. > > > However, this threshold does affect the sensitivity of the test. For > > > example, weak but long-lasting effects are not detected when the > > threshold > > > is large?) it seems to me, that this threshold depends on the nature of > > the > > > data. For lower cfg.clusteralpha threshold (<0.15) I get more > extensive > > > (and more explainable) results and the clusters still show high > > > significance (<<0.025) at the permutation test. > > > > > > Thanks in advance for your help. > > > > > > Best regards, > > > > > > B?lint File > > > > > > > > > > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > > > -- > > Aaron Schurger, PhD > > Senior researcher > > Laboratory of Cognitive Neuroscience > > Brain-Mind Institute, Department of Life Sciences > > ?cole Polytechnique F?d?rale de Lausanne > > Station 19, AI 2101 > > 1015 Lausanne, Switzerland > > +41 21 693 1771 > > aaron.schurger at epfl.ch > > http://lnco.epfl.ch/ > > > > > > > > ------------------------------ > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > End of fieldtrip Digest, Vol 41, Issue 33 > > ***************************************** > > > > > > -- > Haiteng Jiang > PhD candidate > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Visiting address > Room 2.32 > Donders Centre for Cognitive Neuroimaging > Kapittelweg 29 > 6525 EN Nijmegen > the Netherlands > > Tel.: +31 (0)243668291 > Web: https://sites.google.com/site/haitengjiang/ > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140425/3a4d8ea8/attachment-0001.html > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 34 > ***************************************** > -- Guofa Shou PhD Research associate, Computational Neuroimaging and Neuroengineering Laboratory, University of Oklahoma 3100 Monitor Ave. Suit 280 phone: 405-443-0133 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 2394 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 3697 bytes Desc: not available URL: From mbj0310 at gmail.com Tue Apr 29 04:40:04 2014 From: mbj0310 at gmail.com (Beom Jun Min) Date: Tue, 29 Apr 2014 11:40:04 +0900 Subject: [FieldTrip] Clustering analysis with One way ANOVA design Message-ID: Dear trippers, I am not sure about my script for one-way ANOVA design. I have searched in the discussion list, but I cannot find. What I want to compare is F-statistics with different three groups, not interaction effect by now. cfg = []; cfg.channel = 'all'; cfg.neighbours = neighbours; cfg.latency = [0.2 0.3]; cfg.trials = 'all'; cfg.frequency = [32 32]; cfg.avgoverchan = 'no'; cfg.avgovertime = 'no'; cfg.avgoverfreq = 'no'; cfg.parameter = 'powspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'indepsamplesF'; cfg.alpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfg.tail = 1; cfg.clustertail = 1; cfg.correctm = 'cluster'; cfg.numrandomization = 1000; cfg.design = [ones(1,36), ones(1,34)*2, ones(1,28)*3] ; % N x num of observations cfg.ivar = 1; stat = ft_freqstatistics(cfg, A_zscore{1:36}, B_zscore{1:34}, C_zscore{1:28}); Is that script right? Especially, I am not sure that the design, and tail parameters (right-sided tail in the code) are correct. With regards -- BeomJun Min, M.D. Department of Medical System Engineering (DMSE) Gwangju Institute of Science and Technology (GIST) 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju 500-712, Republic of Korea (South) Phone: +82-62-715-3266 / Fax: +82-62-715-3244 E-mail: mbj0310 at gmail.com, http://bmssa.gist.ac.kr -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Apr 29 11:17:20 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 29 Apr 2014 11:17:20 +0200 Subject: [FieldTrip] problem with ft_resampledata after ft_preprocessing (inc. Hilbert) In-Reply-To: <535E7798.8090201@csl.psychol.cam.ac.uk> References: <535E6B48.4050401@csl.psychol.cam.ac.uk> <535E7798.8090201@csl.psychol.cam.ac.uk> Message-ID: <535F6E20.1070006@donders.ru.nl> Hi Elisa, please note the following things: 1) Using an up-to-date version is always good (in a more recent FT version, you are forced to specify cfg.detrend when applying ft_resampledata). 2) Find out whether the version you are using detrending is applied by default (it used to be, but we changed this default. If you want to know why, check the help of ft_resampledata in one of the newer versions). 3) In ft_resampledata, we now suggest to apply demeaning before resampling. You can always add back the mean after resampling (given that you saved it beforehands) Best, Jörn On 4/28/2014 5:45 PM, Elisa Carrus wrote: > Ah, that's it! I should have set demean to 'no'. > > Thanks! > > On 28/04/2014 16:32, Julian Keil wrote: >> Hi Elisa, >> >> did you check your .cfg of the output for demean and detrend? >> Depending on the FT-Version you use, the defaults may be to demean >> and detrend your data which might center the data around 0. >> >> See the help of your fr_resampledata-function for more info. >> >> Best, >> >> Julian >> >> >> ******************** >> *Dr. Julian Keil* >> * >> * >> AG Multisensorische Integration >> Psychiatrische Universitätsklinik >> der Charité im St. Hedwig-Krankenhaus >> Große Hamburger Straße 5-11, Raum E 307 >> 10115 Berlin >> >> Telefon: +49-30-2311-1879 >> Fax: +49-30-2311-2209 >> http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration >> >> Am 28.04.2014 um 16:52 schrieb Elisa Carrus: >> >>> Hi FT users, >>> >>> I am having some problems with resampling (downsampling) the data. >>> >>> Here is what I'm doing: >>> >>> I preprocess the continuous data to obtain band-pass filtered signal >>> in several frequencies (4-8,8-12,12-30, etc), also taking the abs >>> value of the Hilbert transform. The absolute value of the Hilbert is >>> ultimately what I need. >>> >>> I have used the following code: >>> / >>> //cfg = [];// >>> //cfg.channel = 'MEG';// >>> //cfg.demean = 'yes';// >>> //cfg.detrend = 'yes';// >>> //cfg.lpfilter = 'yes';// >>> //cfg.hilbert = 'abs';// >>> //cfg.hpfilter = 'yes';// >>> //cfg.hilbert = 'abs';// >>> //cfg.lpfreq = 30;// >>> //cfg.hpfreq = 12;// >>> //cfg.dataset = '0061_syntask_02_raw_ssst_td.fif';// >>> //cfg.continuous = 'yes';// >>> //beta = ft_preprocessing(cfg);// >>> / >>> After this, I epoch the data as follows >>> >>> /cfg = [];// >>> //cfg.trl = trl2; % this is a trial definition previously created// >>> //beta_ep = ft_redefinetrial(cfg,beta);/ >>> >>> and then I downsample as follows: >>> >>> /cfg = [];// >>> //cfg.resamplefs = 500;// >>> //beta_epdw = ft_resampledata(cfg, beta_ep)/ >>> >>> I don't encounter any errors, but the strange thing is that the data >>> looks fine up to before I downsample (i.e.g. if I plot one trial, >>> it's all positive values, as I would expect from the abs of the >>> Hilbert), but if I plot the downsampled data, the signal has both >>> negative and positive values. >>> >>> Is there something I'm missing? >>> >>> Thanks a lot if you can help, >>> >>> Elisa >>> >>> >>> >>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Tue Apr 29 11:32:35 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 29 Apr 2014 11:32:35 +0200 Subject: [FieldTrip] fieldtrip Digest, Vol 41, Issue 34 In-Reply-To: References: Message-ID: <535F71B3.6020703@donders.ru.nl> Hi Guofa, What you copied looks to me like squared coherence, whereas FieldTrip computes absolute coherence. In essence, there is not much difference (as you can probably infer from the name). In my opinion, it depends mostly on what statistics you are using and what other methods to find out what makes most sense. Most papers that I know report coherence, so I personally prefer coherence because I know what values do make sense. But that's a matter of choice. You can check Maris, Schoffelen & Oostenveld, 2007 in JNM for formula that Fieldtrip uses (see also http://fieldtrip.fcdonders.nl/references_to_implemented_methods) Best, Jörn On 4/29/2014 4:15 AM, guofa shou wrote: > Thanks, Haiteng. > And I have one more question about which coherence equation was used > in Fieldtrip? I have checked the code, it seems it is different > compared to the following equation (from Srinivasan, Ramesh, et al. > "EEG and MEG coherence: measures of functional connectivity at > distinct spatial scales of neocortical dynamics." /Journal of > neuroscience methods/ 166.1 (2007): 41-52.): > Inline image 2 > Inline image 1 > Thanks, > > > > On Sat, Apr 26, 2014 at 5:00 AM, > wrote: > > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: between subject permutation test (guofa shou) (Haiteng > Jiang) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 25 Apr 2014 13:35:40 +0200 > From: Haiteng Jiang > > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] between subject permutation test (guofa shou) > Message-ID: > > > > Content-Type: text/plain; charset="utf-8" > > Hi Guofa, > This is quite similar to between trial experiment ( > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq). > In your > case, you could specify something like this: > > cfg.statistic = 'indepsamplesT'; > design = zeros(1,22); > design(1,10) = 1; % group 1 > design(1,11:22) = 2; % group 2 > cfg.design = design; > cfg.ivar = 1; > > Best, > > Haiteng > > > > > > > Message: 2 > > Date: Thu, 24 Apr 2014 09:54:10 -0500 > > From: guofa shou > > > To: fieldtrip at science.ru.nl > > Subject: [FieldTrip] between subject permutation test > > Message-ID: > > < > > > CAC4CbVLP176SnaPyBDfwqOkdO-jqQnMNFHRTytaQjk5Hsiuaog at mail.gmail.com > > > > Content-Type: text/plain; charset="utf-8" > > > > Hi, Fieldtripers, > > I have a question about the parameters setting about running > > cluster-based permutation test on group-level frequency data. > Specifically, > > I have two groups, one is 12 subjects (i.e., 12 averaged > powers), the other > > is 10 subjects (10 averaged powers), I want to do comparison on > the sensor > > powers between these two groups. so how can I set cfg.statistic, > > cfg.design. > > Thanks! > > Guofa > > > > -- > > Guofa Shou PhD > > Research fellow, > > Computational Neuroimaging and Neuroengineering Laboratory, > > University of Oklahoma > > 3100 Monitor Ave. Suit 280 > > phone: 405-496-8661 > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: < > > > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140424/5199110d/attachment-0001.html > > > > > > > ------------------------------ > > > > Message: 3 > > Date: Thu, 24 Apr 2014 18:24:44 +0200 > > From: Aaron Schurger > > > To: FieldTrip discussion list > > > Subject: Re: [FieldTrip] cluster based permutation test - > > cfg.clusteralpha threshold > > Message-ID: > > > 8HFQpK3HHf6-Ba0g at mail.gmail.com > > > > Content-Type: text/plain; charset=UTF-8 > > > > Dear Balint, > > It was difficult to parse your question: "it?s a valid way to > choose a > > more permissive threshold (cfg.clusteralpha) at the level of the > > clusters identifying t-tests?" If you are asking whether or not > it is > > valid to use a lower point-wise threshold, then it is technically > > valid, but if, for example, you try every possible point-wise > > threshold from 0.01 to 0.20 in steps of 0.01, and you manage to find > > one that gives you a significant result - well that should be > avoided. > > Otherwise it is OK. You might also try this: > > http://www.biomedcentral.com/1471-2202/14/122 with code available > > here: https://bitbucket.org/emsf/emsf_matlab > > > > Instead of trying to find clusters of points that covary with an > > experimental effect, you try to find a temporo-spatial weighting > that > > maximizes the experimental effect, and then look at the spatial > > patterns (clusters) that give you the effect. > > > > Best, > > Aaron > > > > On Thu, Apr 24, 2014 at 4:23 PM, Balint File > > > > wrote: > > > Dear Fieldtrip experts, > > > > > > Recently I started to apply the spatial dimension (electrode > > neighborhood) > > > of the cluster based permutation test. My question is: it?s a > valid way > > to > > > choose a more permissive threshold (cfg.clusteralpha) at the > level of the > > > clusters identifying t-tests? According to the publication of > Maris et > > al., > > > 2007 (?this threshold does not affect the FA rate of the > statistical > > test. > > > However, this threshold does affect the sensitivity of the > test. For > > > example, weak but long-lasting effects are not detected when the > > threshold > > > is large?) it seems to me, that this threshold depends on the > nature of > > the > > > data. For lower cfg.clusteralpha threshold (<0.15) I get more > extensive > > > (and more explainable) results and the clusters still show high > > > significance (<<0.025) at the permutation test. > > > > > > Thanks in advance for your help. > > > > > > Best regards, > > > > > > B?lint File > > > > > > > > > > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > > > -- > > Aaron Schurger, PhD > > Senior researcher > > Laboratory of Cognitive Neuroscience > > Brain-Mind Institute, Department of Life Sciences > > ?cole Polytechnique F?d?rale de Lausanne > > Station 19, AI 2101 > > 1015 Lausanne, Switzerland > > +41 21 693 1771 > > aaron.schurger at epfl.ch > > http://lnco.epfl.ch/ > > > > > > > > ------------------------------ > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > End of fieldtrip Digest, Vol 41, Issue 33 > > ***************************************** > > > > > > -- > Haiteng Jiang > PhD candidate > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Visiting address > Room 2.32 > Donders Centre for Cognitive Neuroimaging > Kapittelweg 29 > 6525 EN Nijmegen > the Netherlands > > Tel.: +31 (0)243668291 > Web: https://sites.google.com/site/haitengjiang/ > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 34 > ***************************************** > > > > > -- > Guofa Shou PhD > Research associate, > Computational Neuroimaging and Neuroengineering Laboratory, > University of Oklahoma > 3100 Monitor Ave. Suit 280 > phone: 405-443-0133 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Tue Apr 29 15:28:04 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 29 Apr 2014 15:28:04 +0200 Subject: [FieldTrip] fieldtrip Digest, Vol 41, Issue 34 In-Reply-To: <535F71B3.6020703@donders.ru.nl> References: <535F71B3.6020703@donders.ru.nl> Message-ID: <535FA8E4.8010800@donders.ru.nl> whops, an important correction, I meant Maris, Schoffelen & Fries 2007, my bad On 4/29/2014 11:32 AM, "Jörn M. Horschig" wrote: > Hi Guofa, > > What you copied looks to me like squared coherence, whereas FieldTrip > computes absolute coherence. In essence, there is not much difference > (as you can probably infer from the name). In my opinion, it depends > mostly on what statistics you are using and what other methods to find > out what makes most sense. Most papers that I know report coherence, > so I personally prefer coherence because I know what values do make > sense. But that's a matter of choice. > > You can check Maris, Schoffelen & Oostenveld, 2007 in JNM for formula > that Fieldtrip uses (see also > http://fieldtrip.fcdonders.nl/references_to_implemented_methods) > > Best, > Jörn > > > On 4/29/2014 4:15 AM, guofa shou wrote: >> Thanks, Haiteng. >> And I have one more question about which coherence equation was used >> in Fieldtrip? I have checked the code, it seems it is different >> compared to the following equation (from Srinivasan, Ramesh, et al. >> "EEG and MEG coherence: measures of functional connectivity at >> distinct spatial scales of neocortical dynamics." /Journal of >> neuroscience methods/ 166.1 (2007): 41-52.): >> Inline image 2 >> Inline image 1 >> Thanks, >> >> >> >> On Sat, Apr 26, 2014 at 5:00 AM, > > wrote: >> >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. Re: between subject permutation test (guofa shou) (Haiteng >> Jiang) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Fri, 25 Apr 2014 13:35:40 +0200 >> From: Haiteng Jiang > > >> To: fieldtrip at science.ru.nl >> Subject: Re: [FieldTrip] between subject permutation test (guofa >> shou) >> Message-ID: >> > > >> Content-Type: text/plain; charset="utf-8" >> >> Hi Guofa, >> This is quite similar to between trial experiment ( >> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq). >> In your >> case, you could specify something like this: >> >> cfg.statistic = 'indepsamplesT'; >> design = zeros(1,22); >> design(1,10) = 1; % group 1 >> design(1,11:22) = 2; % group 2 >> cfg.design = design; >> cfg.ivar = 1; >> >> Best, >> >> Haiteng >> >> >> >> > >> > Message: 2 >> > Date: Thu, 24 Apr 2014 09:54:10 -0500 >> > From: guofa shou > > >> > To: fieldtrip at science.ru.nl >> > Subject: [FieldTrip] between subject permutation test >> > Message-ID: >> > < >> > >> CAC4CbVLP176SnaPyBDfwqOkdO-jqQnMNFHRTytaQjk5Hsiuaog at mail.gmail.com >> > >> > Content-Type: text/plain; charset="utf-8" >> > >> > Hi, Fieldtripers, >> > I have a question about the parameters setting about running >> > cluster-based permutation test on group-level frequency data. >> Specifically, >> > I have two groups, one is 12 subjects (i.e., 12 averaged >> powers), the other >> > is 10 subjects (10 averaged powers), I want to do comparison on >> the sensor >> > powers between these two groups. so how can I set cfg.statistic, >> > cfg.design. >> > Thanks! >> > Guofa >> > >> > -- >> > Guofa Shou PhD >> > Research fellow, >> > Computational Neuroimaging and Neuroengineering Laboratory, >> > University of Oklahoma >> > 3100 Monitor Ave. Suit 280 >> > phone: 405-496-8661 >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: < >> > >> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140424/5199110d/attachment-0001.html >> > > >> > >> > ------------------------------ >> > >> > Message: 3 >> > Date: Thu, 24 Apr 2014 18:24:44 +0200 >> > From: Aaron Schurger > > >> > To: FieldTrip discussion list > > >> > Subject: Re: [FieldTrip] cluster based permutation test - >> > cfg.clusteralpha threshold >> > Message-ID: >> > > > 8HFQpK3HHf6-Ba0g at mail.gmail.com >> > >> > Content-Type: text/plain; charset=UTF-8 >> > >> > Dear Balint, >> > It was difficult to parse your question: "it?s a valid way to >> choose a >> > more permissive threshold (cfg.clusteralpha) at the level of the >> > clusters identifying t-tests?" If you are asking whether or not >> it is >> > valid to use a lower point-wise threshold, then it is technically >> > valid, but if, for example, you try every possible point-wise >> > threshold from 0.01 to 0.20 in steps of 0.01, and you manage to >> find >> > one that gives you a significant result - well that should be >> avoided. >> > Otherwise it is OK. You might also try this: >> > http://www.biomedcentral.com/1471-2202/14/122 with code available >> > here: https://bitbucket.org/emsf/emsf_matlab >> > >> > Instead of trying to find clusters of points that covary with an >> > experimental effect, you try to find a temporo-spatial weighting >> that >> > maximizes the experimental effect, and then look at the spatial >> > patterns (clusters) that give you the effect. >> > >> > Best, >> > Aaron >> > >> > On Thu, Apr 24, 2014 at 4:23 PM, Balint File >> > >> > wrote: >> > > Dear Fieldtrip experts, >> > > >> > > Recently I started to apply the spatial dimension (electrode >> > neighborhood) >> > > of the cluster based permutation test. My question is: it?s a >> valid way >> > to >> > > choose a more permissive threshold (cfg.clusteralpha) at the >> level of the >> > > clusters identifying t-tests? According to the publication of >> Maris et >> > al., >> > > 2007 (?this threshold does not affect the FA rate of the >> statistical >> > test. >> > > However, this threshold does affect the sensitivity of the >> test. For >> > > example, weak but long-lasting effects are not detected when the >> > threshold >> > > is large?) it seems to me, that this threshold depends on the >> nature of >> > the >> > > data. For lower cfg.clusteralpha threshold (<0.15) I get more >> extensive >> > > (and more explainable) results and the clusters still show high >> > > significance (<<0.025) at the permutation test. >> > > >> > > Thanks in advance for your help. >> > > >> > > Best regards, >> > > >> > > B?lint File >> > > >> > > >> > > >> > > _______________________________________________ >> > > fieldtrip mailing list >> > > fieldtrip at donders.ru.nl >> > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > >> > >> > -- >> > Aaron Schurger, PhD >> > Senior researcher >> > Laboratory of Cognitive Neuroscience >> > Brain-Mind Institute, Department of Life Sciences >> > ?cole Polytechnique F?d?rale de Lausanne >> > Station 19, AI 2101 >> > 1015 Lausanne, Switzerland >> > +41 21 693 1771 >> > aaron.schurger at epfl.ch >> > http://lnco.epfl.ch/ >> > >> > >> > >> > ------------------------------ >> > >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > End of fieldtrip Digest, Vol 41, Issue 33 >> > ***************************************** >> > >> >> >> >> -- >> Haiteng Jiang >> PhD candidate >> Neuronal Oscillations Group >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> >> Visiting address >> Room 2.32 >> Donders Centre for Cognitive Neuroimaging >> Kapittelweg 29 >> 6525 EN Nijmegen >> the Netherlands >> >> Tel.: +31 (0)243668291 >> Web: https://sites.google.com/site/haitengjiang/ >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> >> ------------------------------ >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> End of fieldtrip Digest, Vol 41, Issue 34 >> ***************************************** >> >> >> >> >> -- >> Guofa Shou PhD >> Research associate, >> Computational Neuroimaging and Neuroengineering Laboratory, >> University of Oklahoma >> 3100 Monitor Ave. Suit 280 >> phone: 405-443-0133 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From marial.stavrinou at gmail.com Tue Apr 29 15:52:49 2014 From: marial.stavrinou at gmail.com (Maria L. Stavrinou) Date: Tue, 29 Apr 2014 15:52:49 +0200 Subject: [FieldTrip] simple sinusoidal signal as input to wavelet analysis Message-ID: Dear fieldtrip community, I am trying to import my own sinusoidal signal in order to make a wavelet analysis, get the result and find the total power. I cannot make the sinusoidal signal proper for the field trip. I get this message: Error using fixdimord (line 84) the data does not contain a dimord, but it also does not resemble raw or component data Error in ft_datatype_timelock (line 78) timelock = fixdimord(timelock); Error in ft_checkdata (line 207) data = ft_datatype_timelock(data); Error in ft_redefinetrial (line 104) data = ft_checkdata(data, 'datatype', 'raw', 'feedback', cfg.feedback); How should i do that? Best regards, Maria -- -- Maria L. Stavrinou MSc. PhD. Postdoc, Computational Neuroscience Norwegian University of Life Sciences, Ås, Norway http://compneuro.umb.no/ personal web-site: https://sites.google.com/site/marialstavrinou/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Tue Apr 29 17:36:55 2014 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Tue, 29 Apr 2014 11:36:55 -0400 Subject: [FieldTrip] simple sinusoidal signal as input to wavelet analysis In-Reply-To: References: Message-ID: Hello Maria, I have an MEG data set measured from a current dipole energized by a generator with a sinusoidal signal at 7Hz. All waveforms look pretty sinusoidal on all channels. I was able to import the data into Matlab too. I can share the data if it helps. Thanks, Inna Inna McGowin On Tue, Apr 29, 2014 at 9:52 AM, Maria L. Stavrinou < marial.stavrinou at gmail.com> wrote: > Dear fieldtrip community, > I am trying to import my own sinusoidal signal in order to make a wavelet > analysis, get the result and find the total power. > I cannot make the sinusoidal signal proper for the field trip. I get this > message: > > Error using fixdimord (line 84) > the data does not contain a dimord, but it also does not resemble raw or > component data > > Error in ft_datatype_timelock (line 78) > timelock = fixdimord(timelock); > > Error in ft_checkdata (line 207) > data = ft_datatype_timelock(data); > > Error in ft_redefinetrial (line 104) > data = ft_checkdata(data, 'datatype', 'raw', 'feedback', cfg.feedback); > > How should i do that? > > > Best regards, > Maria > > -- > -- > Maria L. Stavrinou > MSc. PhD. > Postdoc, Computational Neuroscience > Norwegian University of Life Sciences, Ås, Norway > http://compneuro.umb.no/ > > personal web-site: https://sites.google.com/site/marialstavrinou/ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at fcdonders.ru.nl Wed Apr 30 09:06:24 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Wed, 30 Apr 2014 09:06:24 +0200 (CEST) Subject: [FieldTrip] simple sinusoidal signal as input to wavelet analysis In-Reply-To: References: Message-ID: <013e01cf6442$b373e5d0$1a5bb170$@herring@fcdonders.ru.nl> Hi Maria, To be able to use your data in Fieldtrip you need to structure it in a certain way. Please have a look at http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat for an example. In short you will need to create a structure with a couple of fields that contain your raw data, sampling rate, etc. Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Maria L. Stavrinou Sent: dinsdag 29 april 2014 15:53 To: fieldtrip at science.ru.nl Subject: [FieldTrip] simple sinusoidal signal as input to wavelet analysis Dear fieldtrip community, I am trying to import my own sinusoidal signal in order to make a wavelet analysis, get the result and find the total power. I cannot make the sinusoidal signal proper for the field trip. I get this message: Error using fixdimord (line 84) the data does not contain a dimord, but it also does not resemble raw or component data Error in ft_datatype_timelock (line 78) timelock = fixdimord(timelock); Error in ft_checkdata (line 207) data = ft_datatype_timelock(data); Error in ft_redefinetrial (line 104) data = ft_checkdata(data, 'datatype', 'raw', 'feedback', cfg.feedback); How should i do that? Best regards, Maria -- -- Maria L. Stavrinou MSc. PhD. Postdoc, Computational Neuroscience Norwegian University of Life Sciences, Ås, Norway http://compneuro.umb.no/ personal web-site: https://sites.google.com/site/marialstavrinou/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From pierpaolo12croce at gmail.com Wed Apr 30 10:18:51 2014 From: pierpaolo12croce at gmail.com (Pierpaolo Croce) Date: Wed, 30 Apr 2014 10:18:51 +0200 Subject: [FieldTrip] txt file Message-ID: Dear Experts, i m a new ft user, i m writing to ask how open simple txt files with ft. this file is without any header. best -- PC -------------- next part -------------- An HTML attachment was scrubbed... URL: From elisa at csl.psychol.cam.ac.uk Wed Apr 30 12:38:01 2014 From: elisa at csl.psychol.cam.ac.uk (Elisa Carrus) Date: Wed, 30 Apr 2014 11:38:01 +0100 Subject: [FieldTrip] problem with ft_resampledata after ft_preprocessing (inc. Hilbert) In-Reply-To: <535F6E20.1070006@donders.ru.nl> References: <535E6B48.4050401@csl.psychol.cam.ac.uk> <535E7798.8090201@csl.psychol.cam.ac.uk> <535F6E20.1070006@donders.ru.nl> Message-ID: <5360D289.60907@csl.psychol.cam.ac.uk> Thanks Jörn, Yes, I have the latest version and I am forced to specify the detrend option. However, as for cfg.demean, I had done it when reading the continuous data with ft_preprocessing. Would you suggest doing it again then, when resampling the epoched data? It's because when I resample with 'cfg.demean = yes', my Hilbert values are centred around zero, i.e. I have both positive and negative values. Thanks, Elisa On 29/04/2014 10:17, "Jörn M. Horschig" wrote: > Hi Elisa, > > please note the following things: > 1) Using an up-to-date version is always good (in a more recent FT > version, you are forced to specify cfg.detrend when applying > ft_resampledata). > 2) Find out whether the version you are using detrending is applied by > default (it used to be, but we changed this default. If you want to > know why, check the help of ft_resampledata in one of the newer > versions). > 3) In ft_resampledata, we now suggest to apply demeaning before > resampling. You can always add back the mean after resampling (given > that you saved it beforehands) > > Best, > Jörn > > > > On 4/28/2014 5:45 PM, Elisa Carrus wrote: >> Ah, that's it! I should have set demean to 'no'. >> >> Thanks! >> >> On 28/04/2014 16:32, Julian Keil wrote: >>> Hi Elisa, >>> >>> did you check your .cfg of the output for demean and detrend? >>> Depending on the FT-Version you use, the defaults may be to demean >>> and detrend your data which might center the data around 0. >>> >>> See the help of your fr_resampledata-function for more info. >>> >>> Best, >>> >>> Julian >>> >>> >>> ******************** >>> *Dr. Julian Keil* >>> * >>> * >>> AG Multisensorische Integration >>> Psychiatrische Universitätsklinik >>> der Charité im St. Hedwig-Krankenhaus >>> Große Hamburger Straße 5-11, Raum E 307 >>> 10115 Berlin >>> >>> Telefon: +49-30-2311-1879 >>> Fax: +49-30-2311-2209 >>> http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration >>> >>> >>> Am 28.04.2014 um 16:52 schrieb Elisa Carrus: >>> >>>> Hi FT users, >>>> >>>> I am having some problems with resampling (downsampling) the data. >>>> >>>> Here is what I'm doing: >>>> >>>> I preprocess the continuous data to obtain band-pass filtered >>>> signal in several frequencies (4-8,8-12,12-30, etc), also taking >>>> the abs value of the Hilbert transform. The absolute value of the >>>> Hilbert is ultimately what I need. >>>> >>>> I have used the following code: >>>> / >>>> //cfg = [];// >>>> //cfg.channel = 'MEG';// >>>> //cfg.demean = 'yes';// >>>> //cfg.detrend = 'yes';// >>>> //cfg.lpfilter = 'yes';// >>>> //cfg.hilbert = 'abs';// >>>> //cfg.hpfilter = 'yes';// >>>> //cfg.hilbert = 'abs';// >>>> //cfg.lpfreq = 30;// >>>> //cfg.hpfreq = 12;// >>>> //cfg.dataset = '0061_syntask_02_raw_ssst_td.fif';// >>>> //cfg.continuous = 'yes';// >>>> //beta = ft_preprocessing(cfg);// >>>> / >>>> After this, I epoch the data as follows >>>> >>>> /cfg = [];// >>>> //cfg.trl = trl2; % this is a trial definition previously created// >>>> //beta_ep = ft_redefinetrial(cfg,beta);/ >>>> >>>> and then I downsample as follows: >>>> >>>> /cfg = [];// >>>> //cfg.resamplefs = 500;// >>>> //beta_epdw = ft_resampledata(cfg, beta_ep)/ >>>> >>>> I don't encounter any errors, but the strange thing is that the >>>> data looks fine up to before I downsample (i.e.g. if I plot one >>>> trial, it's all positive values, as I would expect from the abs of >>>> the Hilbert), but if I plot the downsampled data, the signal has >>>> both negative and positive values. >>>> >>>> Is there something I'm missing? >>>> >>>> Thanks a lot if you can help, >>>> >>>> Elisa >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > From spa268 at nyu.edu Wed Apr 30 13:33:30 2014 From: spa268 at nyu.edu (Stephen Politzer-Ahles) Date: Wed, 30 Apr 2014 15:33:30 +0400 Subject: [FieldTrip] txt file Message-ID: Hello Pierpaolo, Have you tried this? http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat Best, Steve Stephen Politzer-Ahles New York University, Abu Dhabi Neuroscience of Language Lab http://www.nyu.edu/projects/politzer-ahles/ Message: 5 Date: Wed, 30 Apr 2014 10:18:51 +0200 From: Pierpaolo Croce To: fieldtrip at science.ru.nl Subject: [FieldTrip] txt file Message-ID: Content-Type: text/plain; charset="utf-8" Dear Experts, i m a new ft user, i m writing to ask how open simple txt files with ft. this file is without any header. best -- PC -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Tue Apr 1 01:58:45 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 31 Mar 2014 23:58:45 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <533985D8.4080504@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>,<533985D8.4080504@donders.ru.nl> Message-ID: <2573399203ce4b8481d629d08994337a@SIXPR03MB368.apcprd03.prod.outlook.com> Hey Jorn, I am still getting an error when running ft_sourceanalysis. Ill try and give you the full picture of what I am doing. 1. coming from eeglab to fieldtrip: % convert to fieldtrip process = 'componentanalysis'; data = eeglab2fieldtrip( EEG, process, 'none'); data = label: {1x121 cell} fsample: 500 elec: [1x1 struct] trial: {[121x19767 single]} time: {[1x19767 double]} topolabel: {1x121 cell} topo: [121x121 double] cfg: [1x1 struct] 2. Calculate timelock analysis % calculating the timelock analysis cfg = []; % cfg.channel = 'EEG'; % for some reason it crashes the % beamformer cfg.vartrllength = 2; % accept variable length trials cfg.covariance = 'yes'; cfg.covariancewindow = 'all'; % cfg.channel = data.label; timelock = ft_timelockanalysis(cfg, data); timelock = avg: [121x19767 double] var: [121x19767 double] time: [1x19767 double] dof: [121x19767 double] label: {1x121 cell} dimord: 'chan_time' cov: [121x121 double] elec: [1x1 struct] cfg: [1x1 struct] 3. Calculate head model % the forward model and lead field matrix mri = ft_read_mri( 'Subject01.mri'); cfg = []; cfg.write = 'no'; cfg.coordsys = 'ctf'; segmentedmri = ft_volumesegment(cfg, mri); cfg = []; cfg.method = 'concentricspheres'; vol = ft_prepare_headmodel(cfg, segmentedmri); vol = unit: 'mm' r: 69.8077 o: [19.2853 1.2231 54.6031] cond: 1 type: 'concentricspheres' cfg: [1x1 struct] 4. Compute lead field % compute lead field ( apparently source analysis computes % lead field anyway cfg = []; cfg.elec = timelock.elec; cfg.vol = vol; cfg.reducerank = 3; cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution cfg.grid.unit = 'cm'; cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window grid = ft_prepare_leadfield( cfg); grid = xgrid: [-5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8] ygrid: [-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7] zgrid: [-1 0 1 2 3 4 5 6 7 8 9 10 11 12] dim: [14 14 14] pos: [2744x3 double] unit: 'cm' inside: [1x1430 double] outside: [1x1314 double] cfg: [1x1 struct] leadfield: {1x2744 cell} 5. Compute ft_source analysis % Source Analysis: without contrasting condition cfg = []; cfg.method = 'lcmv'; cfg.grid = grid; cfg.vol = vol; % cfg.grid.pos = 'maxpos'; cfg.keepfilter = 'yes'; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = 0; source = ft_sourceanalysis( cfg, timelock); It crashes with the following error: Error using * Inner matrix dimensions must agree. Error in beamformer_lcmv (line 268) filt = pinv(lf' * invCy * lf) * lf' * invCy; % van Veen eqn. 23, use PINV/SVD to cover rank deficient leadfield Error in ft_sourceanalysis (line 794) dip(i) = beamformer_lcmv(grid, sens, vol, squeeze_avg, squeeze(Cy(i,:,:)), optarg{:}); Please note that fieldtrip is up to date. Can you see an error? I will trying looking in the tutorials again. Also, did you want a segment of my data to see if you can get it working? ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" Sent: Tuesday, 1 April 2014 1:42 AM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot just to clarify and be precise > The pos-matrix has to be a regular 3D grid, i.e. be representable as a > 3x3x3 matrix. it actually does not have to be as you can also beam individual grid points, but if you have a .dim field, then is has to be like above. But that does not affect the rest of the mail I wrote ;) > I am not quite sure how the sourceinterpolate function is handeling > the fact that you do not have that .dim field. Apparently, it is also > confused ;) > > Do you want to reconstruct only some voxels? From your code it seems > that you want to cover the whole brain with a 1cm resolution. If the > latter is the case, maybe restart with creating your forward model by > following the tutorial that I posted in my previous mail. There are > some sanity checks that can help you figuring out if you are doing the > correct thing. If the former one is the case, please explain again > what exactly you want to achieve and how you are building your forward > model. > > Best, > Jörn > > btw, there's nothing wrong with being a PhD student, it's just a > matter of experience in practice and theory as in all domains in life ;) > > > On 3/31/2014 3:15 PM, Tyler Grummett wrote: >> Hey Jorn, >> >> Yes I am definitely confused haha, this stuff is way out of my league >> as a PhD student. >> Anyway, I feel we are getting somewhere. >> >> timelock = >> >> avg: [121x19767 double] >> var: [121x19767 double] >> time: [1x19767 double] >> dof: [121x19767 double] >> label: {1x121 cell} >> dimord: 'chan_time' >> cov: [121x121 double] >> elec: [1x1 struct] >> cfg: [1x1 struct] >> >> source = >> >> time: [1x19767 double] >> pos: [642x3 double] >> inside: [642x1 double] >> outside: [] >> method: 'average' >> avg: [1x1 struct] >> cfg: [1x1 struct] >> >> sourceInt = >> >> time: [1x19767 double] >> avg: [1x1 struct] >> pos: [16777216x3 double] >> dim: [256 256 256] >> inside: [1x16777216 double] >> outside: [1x0 double] >> coordsys: 'ctf' >> unit: 'mm' >> cfg: [1x1 struct] >> >> Given what I said last time, I might not comment on the differences. >> I hope you can see something wrong. >> >> One thing I should mention is that the data is continuous, around 30 >> seconds. Therefore there is only one trial, >> is that an issue? >> >> Tyler >> >> ************************* >> >> Tyler Grummett ( BBSc, BSc(Hons I)) >> PhD Candidate >> Brain Signals Laboratory >> Flinders University >> Rm 5A301 >> Ext 66124 >> >> ________________________________________ >> From: fieldtrip-bounces at science.ru.nl >> on behalf of "Jörn M. Horschig" >> >> Sent: Monday, 31 March 2014 10:24 PM >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] plotting interpolated sources with >> ft_sourceplot >> >> Hi Tyler, >> >> there is not much inherently different between time- and >> freuqency-domain beamformer, at least in terms of computing the forward >> and the inverse solution. But I see that you are obviously confused, so >> let me try to help you out and shed some light on what you are actually >> doing ;) >> >> >>> I had a look at my variables. >>> >>> source.avg = >>> >>> pow: [642x1 double] >>> filter: {642x1 cell} >>> >>> sourceInt.avg = >>> >>> pow: [16777216x1 double] >>> >>> So clearly, as both variables are completely different. Something >>> has gone wrong. >> No, that is actually how it should be. From below you can see that your >> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >> 16777216 elements. In line with source.avg.pow, you should see that your >> 'grid' consists of 642 elements, so you were computing your source >> activity on a grid of in total 642 elements. Then you used the original >> MRI to interpolate from 642 to these 16 million grid points. Actually, >> since you specific cfg.downsample = 2, it should have been only 8 >> million points, so that's where things already get a bit weird. >> >> So let's go into some sanity checks: >> 1. are you using the latest version (or a recent, i.e. from this year) >> of FielTrip? >> 2. sourceInt should look something like this, does it? >> >> source_diff_int = >> inside: [46x55x46 logical] >> avg: [1x1 struct] >> dim: [46 55 46] >> transform: [4x4 double] >> anatomy: [46x55x46 double] >> unit: 'mm' >> cfg: [1x1 struct] >> >> >> >> 3. source should look something like this: >> >> source = >> dim: [20 25 22] >> freq: 54.8287 >> cumtapcnt: [338x1 double] >> pos: [11000x3 double] >> inside: [1x5798 double] >> outside: [1x5202 double] >> method: 'average' >> avg: [1x1 struct] >> trialinfo: [338x1 double] >> cfg: [1x1 struct] >> >> 4. also check your grid, should be something like this: >> >> sourcemodel = >> >> pos: [11000x3 double] >> dim: [20 25 22] >> unit: 'cm' >> inside: [1x5798 double] >> outside: [1x5202 double] >> params: [1x1 struct] >> initial: [4x4 double] >> cfg: [1x1 struct] >> >> >> Of course, it should all look a bit different, because you are using >> LCMV, but essentially it should be the same. Lastly, you can check other >> source plotting methods, like 'ortho' or try to plot the source >> structure rather than the sourceInt structure. In the end, the error >> must be somewhere in your grid, be it in .pos or .inside, because >> FieldTrip thinks that there is only one voxel to be plotted. There are >> other things that may be the issue, but I am not sure about these. So, I >> would suggest that you play a bit around and see where the error might >> come from (e.g. follow this tutorial: >> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >> steps that you need for LCMV, maybe also check out: >> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >> >> there, LCMV is used, but on one voxel only) >> >> Best, >> Jörn >> >>> The next part of my code is the following: >>> >>> % interpolate sources >>> mri = ft_read_mri('Subject01.mri'); >>> mri = ft_volumereslice([], mri); >>> >>> cfg = []; >>> cfg.downsample = 2; >>> cfg.parameter = 'avg.pow'; >>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>> parameter >>> % does not vary over time, therefore the time >>> dimension is not needed. >>> >>> mri = >>> >>> anatomy: [256x256x256 double] >>> dim: [256 256 256] >>> transform: [4x4 double] >>> coordsys: 'ctf' >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> I cant really see if the data works in the tutorial because it >>> doesnt appear as though fieldtrip has a tutorial on lcmv >>> beamformers, they seem to stick to frequency domain beamformers. >>> >>> Ive been wrong before though, >>> >>> thanks for your help. >>> >>> Tyler >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl >>> on behalf of "Jörn M. Horschig" >>> >>> Sent: Monday, 31 March 2014 7:13 PM >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting interpolated sources with >>> ft_sourceplot >>> >>> Hi Tyler, >>> >>> hm, okay, it could be that the issue with the leadfield and with the >>> plot are related, but it could also be that they are separate issues. I >>> just saw that you posted the same 'problem' on bugzilla and included a >>> picture. Maybe for next time, include a picture on the mailinglist and >>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>> and not if you are not sure. That saves us a lot of time in separating >>> code issues from user problems ;) >>> >>> So, back to you problem. It seems that your reconstruction results in >>> one voxel only. Are you sure that your grid consistents of more than >>> just one position? So, for example check the size of the matrices in >>> source.avg, source- and headmodel, etc. >>> >>> Also, you can check in Matlab the respective fields of source and >>> sourceInt and see whether that makes sense. >>> >>> Lastly, a neat way to check is always to use your code on data from the >>> tutorial, and vice versa, use code from the tutorial on your data and >>> see whether that works. Both should give sensible results, and if one >>> does not, you know where to start looking for a solution ;) >>> >>> Best, >>> Jörn >>> >>> >>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>> Hey Jorn, >>>> >>>> Previously I have let ft_sourceanalysis do a lead field because if >>>> I use the following code: >>>> >>>> % compute lead field ( apparently source analysis computes >>>> % lead field anyway >>>> cfg = []; >>>> cfg.elec = timelock.elec; >>>> cfg.vol = vol; >>>> cfg.reducerank = 3; >>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>> cm resolution >>>> cfg.grid.unit = 'cm'; >>>> cfg.normalize = 'yes'; % if you are not >>>> contrasting the activity of interest again another condition or >>>> baseline time-window >>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>> I AM UP TO >>>> >>>> and then calculate the source analysis: >>>> >>>> % Source Analysis: without contrasting condition >>>> cfg = []; >>>> cfg.method = 'lcmv'; >>>> cfg.grid = grid; >>>> cfg.vol = vol; >>>> % cfg.grid.pos = maxpos; >>>> cfg.keepfilter = 'yes'; >>>> cfg.dics.projectnoise = 'yes'; >>>> % cfg.dics.lambda = 0; >>>> source = ft_sourceanalysis( cfg, timelock); >>>> >>>> then I get an error than says: >>>> >>>> Error using * >>>> Inner matrix dimensions must agree. >>>> >>>> Error in beamformer_lcmv (line 268) >>>> filt = pinv(lf' * invCy * lf) * lf' * >>>> invCy; % van Veen eqn. 23, use >>>> PINV/SVD to cover rank deficient leadfield >>>> >>>> Error in ft_sourceanalysis (line 794) >>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>> optarg{:}); >>>> >>>> I just removed the leadfield code and it successfully ran. I could >>>> also interpolate it later. >>>> Is this the correct approach. >>>> >>>> Thankyou in advance! >>>> >>>> Tyler >>>> >>>> ************************* >>>> >>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>> PhD Candidate >>>> Brain Signals Laboratory >>>> Flinders University >>>> Rm 5A301 >>>> Ext 66124 >>>> >>>> ________________________________________ >>>> From: fieldtrip-bounces at science.ru.nl >>>> on behalf of "Jörn M. Horschig" >>>> >>>> Sent: Monday, 31 March 2014 5:30 PM >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>> ft_sourceplot >>>> >>>> Hi Tyler, >>>> >>>> what you are describing sounds to me like the center bias of the >>>> beamformer. Did you contrast the activity with anything, or did you >>>> normalize your leadfield? >>>> Check this out: >>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>> >>>> >>>> Best, >>>> Jörn >>>> >>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>> I have been trying to plot my interpolated source data using the >>>>> code: >>>>> >>>>> % interpolate sources >>>>> mri = ft_read_mri('Subject01.mri'); >>>>> mri = ft_volumereslice([], mri); >>>>> cfg = []; >>>>> cfg.downsample = 2; >>>>> cfg.parameter = 'avg.pow'; >>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>> parameter >>>>> % does not vary over time, therefore the time >>>>> dimension >>>>> is not needed. >>>>> >>>>> % Plot interpolated data >>>>> cfg = []; %#ok >>>>> cfg.method = 'ortho'; % spline >>>>> cfg.funparameter = 'avg.pow'; >>>>> ft_sourceplot( cfg, sourceInt); >>>>> >>>>> However the figure that comes up just had orange squares in the >>>>> subplots. >>>>> >>>>> I dont know where Ive gone wrong. >>>>> >>>>> >>>>> Tyler >>>>> >>>>> >>>>> ************************* >>>>> >>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>> /PhD Candidate/ >>>>> /Brain Signals Laboratory/ >>>>> /Flinders University/ >>>>> /Rm 5A301/ >>>>> /Ext 66124/ >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> -- >>>> Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tyler.grummett at flinders.edu.au Tue Apr 1 08:15:11 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 1 Apr 2014 06:15:11 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <533985D8.4080504@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>,<533985D8.4080504@donders.ru.nl> Message-ID: Hey Jorn, In addition to my previous emails, Ive been trying to debug the functions. In ft_sourceanalysis, line 661 to 677: % HACK: use the default code % select the channels of interest [dum, datchanindx] = match_str(cfg.channel, data.label); if strcmp(data.dimord, 'chan_time') % It is in principle possible to have timelockanalysis with % keeptrial=yes and only a single trial in the raw data. % In that case the covariance should be represented as Nchan*Nchan data.avg = data.avg(datchanindx,:); %data.cov = reshape(data.cov, length(datchanindx), length(datchanindx)); data.cov = data.cov(datchanindx,datchanindx); else data.avg = data.avg(datchanindx,:); data.cov = data.cov(:,datchanindx,datchanindx); data.trial = data.trial(:,datchanindx,:); end data.label = data.label(datchanindx); Nchans = length(data.label); I found that my cfg.channel is []; and the data.label is all my ICA components labelled ica_001 etc. So it is returned as a []; which means data.cov = []; I think then it will crash later parts of the code. Does this function work on ICA components? I ran the ICA in eeglab. Tyler. ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" Sent: Tuesday, 1 April 2014 1:42 AM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot just to clarify and be precise > The pos-matrix has to be a regular 3D grid, i.e. be representable as a > 3x3x3 matrix. it actually does not have to be as you can also beam individual grid points, but if you have a .dim field, then is has to be like above. But that does not affect the rest of the mail I wrote ;) > I am not quite sure how the sourceinterpolate function is handeling > the fact that you do not have that .dim field. Apparently, it is also > confused ;) > > Do you want to reconstruct only some voxels? From your code it seems > that you want to cover the whole brain with a 1cm resolution. If the > latter is the case, maybe restart with creating your forward model by > following the tutorial that I posted in my previous mail. There are > some sanity checks that can help you figuring out if you are doing the > correct thing. If the former one is the case, please explain again > what exactly you want to achieve and how you are building your forward > model. > > Best, > Jörn > > btw, there's nothing wrong with being a PhD student, it's just a > matter of experience in practice and theory as in all domains in life ;) > > > On 3/31/2014 3:15 PM, Tyler Grummett wrote: >> Hey Jorn, >> >> Yes I am definitely confused haha, this stuff is way out of my league >> as a PhD student. >> Anyway, I feel we are getting somewhere. >> >> timelock = >> >> avg: [121x19767 double] >> var: [121x19767 double] >> time: [1x19767 double] >> dof: [121x19767 double] >> label: {1x121 cell} >> dimord: 'chan_time' >> cov: [121x121 double] >> elec: [1x1 struct] >> cfg: [1x1 struct] >> >> source = >> >> time: [1x19767 double] >> pos: [642x3 double] >> inside: [642x1 double] >> outside: [] >> method: 'average' >> avg: [1x1 struct] >> cfg: [1x1 struct] >> >> sourceInt = >> >> time: [1x19767 double] >> avg: [1x1 struct] >> pos: [16777216x3 double] >> dim: [256 256 256] >> inside: [1x16777216 double] >> outside: [1x0 double] >> coordsys: 'ctf' >> unit: 'mm' >> cfg: [1x1 struct] >> >> Given what I said last time, I might not comment on the differences. >> I hope you can see something wrong. >> >> One thing I should mention is that the data is continuous, around 30 >> seconds. Therefore there is only one trial, >> is that an issue? >> >> Tyler >> >> ************************* >> >> Tyler Grummett ( BBSc, BSc(Hons I)) >> PhD Candidate >> Brain Signals Laboratory >> Flinders University >> Rm 5A301 >> Ext 66124 >> >> ________________________________________ >> From: fieldtrip-bounces at science.ru.nl >> on behalf of "Jörn M. Horschig" >> >> Sent: Monday, 31 March 2014 10:24 PM >> To: FieldTrip discussion list >> Subject: Re: [FieldTrip] plotting interpolated sources with >> ft_sourceplot >> >> Hi Tyler, >> >> there is not much inherently different between time- and >> freuqency-domain beamformer, at least in terms of computing the forward >> and the inverse solution. But I see that you are obviously confused, so >> let me try to help you out and shed some light on what you are actually >> doing ;) >> >> >>> I had a look at my variables. >>> >>> source.avg = >>> >>> pow: [642x1 double] >>> filter: {642x1 cell} >>> >>> sourceInt.avg = >>> >>> pow: [16777216x1 double] >>> >>> So clearly, as both variables are completely different. Something >>> has gone wrong. >> No, that is actually how it should be. From below you can see that your >> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >> 16777216 elements. In line with source.avg.pow, you should see that your >> 'grid' consists of 642 elements, so you were computing your source >> activity on a grid of in total 642 elements. Then you used the original >> MRI to interpolate from 642 to these 16 million grid points. Actually, >> since you specific cfg.downsample = 2, it should have been only 8 >> million points, so that's where things already get a bit weird. >> >> So let's go into some sanity checks: >> 1. are you using the latest version (or a recent, i.e. from this year) >> of FielTrip? >> 2. sourceInt should look something like this, does it? >> >> source_diff_int = >> inside: [46x55x46 logical] >> avg: [1x1 struct] >> dim: [46 55 46] >> transform: [4x4 double] >> anatomy: [46x55x46 double] >> unit: 'mm' >> cfg: [1x1 struct] >> >> >> >> 3. source should look something like this: >> >> source = >> dim: [20 25 22] >> freq: 54.8287 >> cumtapcnt: [338x1 double] >> pos: [11000x3 double] >> inside: [1x5798 double] >> outside: [1x5202 double] >> method: 'average' >> avg: [1x1 struct] >> trialinfo: [338x1 double] >> cfg: [1x1 struct] >> >> 4. also check your grid, should be something like this: >> >> sourcemodel = >> >> pos: [11000x3 double] >> dim: [20 25 22] >> unit: 'cm' >> inside: [1x5798 double] >> outside: [1x5202 double] >> params: [1x1 struct] >> initial: [4x4 double] >> cfg: [1x1 struct] >> >> >> Of course, it should all look a bit different, because you are using >> LCMV, but essentially it should be the same. Lastly, you can check other >> source plotting methods, like 'ortho' or try to plot the source >> structure rather than the sourceInt structure. In the end, the error >> must be somewhere in your grid, be it in .pos or .inside, because >> FieldTrip thinks that there is only one voxel to be plotted. There are >> other things that may be the issue, but I am not sure about these. So, I >> would suggest that you play a bit around and see where the error might >> come from (e.g. follow this tutorial: >> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >> steps that you need for LCMV, maybe also check out: >> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >> >> there, LCMV is used, but on one voxel only) >> >> Best, >> Jörn >> >>> The next part of my code is the following: >>> >>> % interpolate sources >>> mri = ft_read_mri('Subject01.mri'); >>> mri = ft_volumereslice([], mri); >>> >>> cfg = []; >>> cfg.downsample = 2; >>> cfg.parameter = 'avg.pow'; >>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>> parameter >>> % does not vary over time, therefore the time >>> dimension is not needed. >>> >>> mri = >>> >>> anatomy: [256x256x256 double] >>> dim: [256 256 256] >>> transform: [4x4 double] >>> coordsys: 'ctf' >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> I cant really see if the data works in the tutorial because it >>> doesnt appear as though fieldtrip has a tutorial on lcmv >>> beamformers, they seem to stick to frequency domain beamformers. >>> >>> Ive been wrong before though, >>> >>> thanks for your help. >>> >>> Tyler >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl >>> on behalf of "Jörn M. Horschig" >>> >>> Sent: Monday, 31 March 2014 7:13 PM >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting interpolated sources with >>> ft_sourceplot >>> >>> Hi Tyler, >>> >>> hm, okay, it could be that the issue with the leadfield and with the >>> plot are related, but it could also be that they are separate issues. I >>> just saw that you posted the same 'problem' on bugzilla and included a >>> picture. Maybe for next time, include a picture on the mailinglist and >>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>> and not if you are not sure. That saves us a lot of time in separating >>> code issues from user problems ;) >>> >>> So, back to you problem. It seems that your reconstruction results in >>> one voxel only. Are you sure that your grid consistents of more than >>> just one position? So, for example check the size of the matrices in >>> source.avg, source- and headmodel, etc. >>> >>> Also, you can check in Matlab the respective fields of source and >>> sourceInt and see whether that makes sense. >>> >>> Lastly, a neat way to check is always to use your code on data from the >>> tutorial, and vice versa, use code from the tutorial on your data and >>> see whether that works. Both should give sensible results, and if one >>> does not, you know where to start looking for a solution ;) >>> >>> Best, >>> Jörn >>> >>> >>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>> Hey Jorn, >>>> >>>> Previously I have let ft_sourceanalysis do a lead field because if >>>> I use the following code: >>>> >>>> % compute lead field ( apparently source analysis computes >>>> % lead field anyway >>>> cfg = []; >>>> cfg.elec = timelock.elec; >>>> cfg.vol = vol; >>>> cfg.reducerank = 3; >>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>> cm resolution >>>> cfg.grid.unit = 'cm'; >>>> cfg.normalize = 'yes'; % if you are not >>>> contrasting the activity of interest again another condition or >>>> baseline time-window >>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>> I AM UP TO >>>> >>>> and then calculate the source analysis: >>>> >>>> % Source Analysis: without contrasting condition >>>> cfg = []; >>>> cfg.method = 'lcmv'; >>>> cfg.grid = grid; >>>> cfg.vol = vol; >>>> % cfg.grid.pos = maxpos; >>>> cfg.keepfilter = 'yes'; >>>> cfg.dics.projectnoise = 'yes'; >>>> % cfg.dics.lambda = 0; >>>> source = ft_sourceanalysis( cfg, timelock); >>>> >>>> then I get an error than says: >>>> >>>> Error using * >>>> Inner matrix dimensions must agree. >>>> >>>> Error in beamformer_lcmv (line 268) >>>> filt = pinv(lf' * invCy * lf) * lf' * >>>> invCy; % van Veen eqn. 23, use >>>> PINV/SVD to cover rank deficient leadfield >>>> >>>> Error in ft_sourceanalysis (line 794) >>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>> optarg{:}); >>>> >>>> I just removed the leadfield code and it successfully ran. I could >>>> also interpolate it later. >>>> Is this the correct approach. >>>> >>>> Thankyou in advance! >>>> >>>> Tyler >>>> >>>> ************************* >>>> >>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>> PhD Candidate >>>> Brain Signals Laboratory >>>> Flinders University >>>> Rm 5A301 >>>> Ext 66124 >>>> >>>> ________________________________________ >>>> From: fieldtrip-bounces at science.ru.nl >>>> on behalf of "Jörn M. Horschig" >>>> >>>> Sent: Monday, 31 March 2014 5:30 PM >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>> ft_sourceplot >>>> >>>> Hi Tyler, >>>> >>>> what you are describing sounds to me like the center bias of the >>>> beamformer. Did you contrast the activity with anything, or did you >>>> normalize your leadfield? >>>> Check this out: >>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>> >>>> >>>> Best, >>>> Jörn >>>> >>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>> I have been trying to plot my interpolated source data using the >>>>> code: >>>>> >>>>> % interpolate sources >>>>> mri = ft_read_mri('Subject01.mri'); >>>>> mri = ft_volumereslice([], mri); >>>>> cfg = []; >>>>> cfg.downsample = 2; >>>>> cfg.parameter = 'avg.pow'; >>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>> parameter >>>>> % does not vary over time, therefore the time >>>>> dimension >>>>> is not needed. >>>>> >>>>> % Plot interpolated data >>>>> cfg = []; %#ok >>>>> cfg.method = 'ortho'; % spline >>>>> cfg.funparameter = 'avg.pow'; >>>>> ft_sourceplot( cfg, sourceInt); >>>>> >>>>> However the figure that comes up just had orange squares in the >>>>> subplots. >>>>> >>>>> I dont know where Ive gone wrong. >>>>> >>>>> >>>>> Tyler >>>>> >>>>> >>>>> ************************* >>>>> >>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>> /PhD Candidate/ >>>>> /Brain Signals Laboratory/ >>>>> /Flinders University/ >>>>> /Rm 5A301/ >>>>> /Ext 66124/ >>>>> >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> -- >>>> Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jm.horschig at donders.ru.nl Tue Apr 1 08:17:56 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 01 Apr 2014 08:17:56 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <2573399203ce4b8481d629d08994337a@SIXPR03MB368.apcprd03.prod.outlook.com> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>, <533985D8.4080504@donders.ru.nl> <2573399203ce4b8481d629d08994337a@SIXPR03MB368.apcprd03.prod.outlook.com> Message-ID: <533A5A14.4060700@donders.ru.nl> Hi Tyler, the leadfield matrix contains by design no channel labels, and I think that FieldTrip assumes that the elements of the leadfield coincides with the elements of the channel. I guess you can avoid the error you get by setting cfg.channel = data.label; when computing the leadfield. You could try that, otherwise your code looks fine. Best, Jörn On 4/1/2014 1:58 AM, Tyler Grummett wrote: > Hey Jorn, > > I am still getting an error when running ft_sourceanalysis. Ill try and give you the full picture of what I am doing. > > 1. coming from eeglab to fieldtrip: > > % convert to fieldtrip > process = 'componentanalysis'; > data = eeglab2fieldtrip( EEG, process, 'none'); > > data = > > label: {1x121 cell} > fsample: 500 > elec: [1x1 struct] > trial: {[121x19767 single]} > time: {[1x19767 double]} > topolabel: {1x121 cell} > topo: [121x121 double] > cfg: [1x1 struct] > > 2. Calculate timelock analysis > > % calculating the timelock analysis > cfg = []; > % cfg.channel = 'EEG'; % for some reason it crashes the > % beamformer > cfg.vartrllength = 2; % accept variable length trials > cfg.covariance = 'yes'; > cfg.covariancewindow = 'all'; > % cfg.channel = data.label; > timelock = ft_timelockanalysis(cfg, data); > > timelock = > > avg: [121x19767 double] > var: [121x19767 double] > time: [1x19767 double] > dof: [121x19767 double] > label: {1x121 cell} > dimord: 'chan_time' > cov: [121x121 double] > elec: [1x1 struct] > cfg: [1x1 struct] > > 3. Calculate head model > > % the forward model and lead field matrix > mri = ft_read_mri( 'Subject01.mri'); > cfg = []; > cfg.write = 'no'; > cfg.coordsys = 'ctf'; > segmentedmri = ft_volumesegment(cfg, mri); > > cfg = []; > cfg.method = 'concentricspheres'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > vol = > > unit: 'mm' > r: 69.8077 > o: [19.2853 1.2231 54.6031] > cond: 1 > type: 'concentricspheres' > cfg: [1x1 struct] > > 4. Compute lead field > > % compute lead field ( apparently source analysis computes > % lead field anyway > cfg = []; > cfg.elec = timelock.elec; > cfg.vol = vol; > cfg.reducerank = 3; > cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution > cfg.grid.unit = 'cm'; > cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window > grid = ft_prepare_leadfield( cfg); > > grid = > > xgrid: [-5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8] > ygrid: [-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7] > zgrid: [-1 0 1 2 3 4 5 6 7 8 9 10 11 12] > dim: [14 14 14] > pos: [2744x3 double] > unit: 'cm' > inside: [1x1430 double] > outside: [1x1314 double] > cfg: [1x1 struct] > leadfield: {1x2744 cell} > > 5. Compute ft_source analysis > > % Source Analysis: without contrasting condition > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = grid; > cfg.vol = vol; > % cfg.grid.pos = 'maxpos'; > cfg.keepfilter = 'yes'; > cfg.dics.projectnoise = 'yes'; > cfg.dics.lambda = 0; > source = ft_sourceanalysis( cfg, timelock); > > It crashes with the following error: > > Error using * > Inner matrix dimensions must agree. > > Error in beamformer_lcmv (line 268) > filt = pinv(lf' * invCy * lf) * lf' * invCy; > % van Veen eqn. 23, use PINV/SVD to cover rank > deficient leadfield > > Error in ft_sourceanalysis (line 794) > dip(i) = beamformer_lcmv(grid, sens, vol, > squeeze_avg, squeeze(Cy(i,:,:)), optarg{:}); > > > Please note that fieldtrip is up to date. > Can you see an error? I will trying looking in the tutorials again. > Also, did you want a segment of my data to see if you can get it working? > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" > Sent: Tuesday, 1 April 2014 1:42 AM > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot > > just to clarify and be precise >> The pos-matrix has to be a regular 3D grid, i.e. be representable as a >> 3x3x3 matrix. > it actually does not have to be as you can also beam individual grid > points, but if you have a .dim field, then is has to be like above. But > that does not affect the rest of the mail I wrote ;) > > >> I am not quite sure how the sourceinterpolate function is handeling >> the fact that you do not have that .dim field. Apparently, it is also >> confused ;) >> >> Do you want to reconstruct only some voxels? From your code it seems >> that you want to cover the whole brain with a 1cm resolution. If the >> latter is the case, maybe restart with creating your forward model by >> following the tutorial that I posted in my previous mail. There are >> some sanity checks that can help you figuring out if you are doing the >> correct thing. If the former one is the case, please explain again >> what exactly you want to achieve and how you are building your forward >> model. >> >> Best, >> Jörn >> >> btw, there's nothing wrong with being a PhD student, it's just a >> matter of experience in practice and theory as in all domains in life ;) >> >> >> On 3/31/2014 3:15 PM, Tyler Grummett wrote: >>> Hey Jorn, >>> >>> Yes I am definitely confused haha, this stuff is way out of my league >>> as a PhD student. >>> Anyway, I feel we are getting somewhere. >>> >>> timelock = >>> >>> avg: [121x19767 double] >>> var: [121x19767 double] >>> time: [1x19767 double] >>> dof: [121x19767 double] >>> label: {1x121 cell} >>> dimord: 'chan_time' >>> cov: [121x121 double] >>> elec: [1x1 struct] >>> cfg: [1x1 struct] >>> >>> source = >>> >>> time: [1x19767 double] >>> pos: [642x3 double] >>> inside: [642x1 double] >>> outside: [] >>> method: 'average' >>> avg: [1x1 struct] >>> cfg: [1x1 struct] >>> >>> sourceInt = >>> >>> time: [1x19767 double] >>> avg: [1x1 struct] >>> pos: [16777216x3 double] >>> dim: [256 256 256] >>> inside: [1x16777216 double] >>> outside: [1x0 double] >>> coordsys: 'ctf' >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> Given what I said last time, I might not comment on the differences. >>> I hope you can see something wrong. >>> >>> One thing I should mention is that the data is continuous, around 30 >>> seconds. Therefore there is only one trial, >>> is that an issue? >>> >>> Tyler >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl >>> on behalf of "Jörn M. Horschig" >>> >>> Sent: Monday, 31 March 2014 10:24 PM >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting interpolated sources with >>> ft_sourceplot >>> >>> Hi Tyler, >>> >>> there is not much inherently different between time- and >>> freuqency-domain beamformer, at least in terms of computing the forward >>> and the inverse solution. But I see that you are obviously confused, so >>> let me try to help you out and shed some light on what you are actually >>> doing ;) >>> >>> >>>> I had a look at my variables. >>>> >>>> source.avg = >>>> >>>> pow: [642x1 double] >>>> filter: {642x1 cell} >>>> >>>> sourceInt.avg = >>>> >>>> pow: [16777216x1 double] >>>> >>>> So clearly, as both variables are completely different. Something >>>> has gone wrong. >>> No, that is actually how it should be. From below you can see that your >>> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >>> 16777216 elements. In line with source.avg.pow, you should see that your >>> 'grid' consists of 642 elements, so you were computing your source >>> activity on a grid of in total 642 elements. Then you used the original >>> MRI to interpolate from 642 to these 16 million grid points. Actually, >>> since you specific cfg.downsample = 2, it should have been only 8 >>> million points, so that's where things already get a bit weird. >>> >>> So let's go into some sanity checks: >>> 1. are you using the latest version (or a recent, i.e. from this year) >>> of FielTrip? >>> 2. sourceInt should look something like this, does it? >>> >>> source_diff_int = >>> inside: [46x55x46 logical] >>> avg: [1x1 struct] >>> dim: [46 55 46] >>> transform: [4x4 double] >>> anatomy: [46x55x46 double] >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> >>> >>> 3. source should look something like this: >>> >>> source = >>> dim: [20 25 22] >>> freq: 54.8287 >>> cumtapcnt: [338x1 double] >>> pos: [11000x3 double] >>> inside: [1x5798 double] >>> outside: [1x5202 double] >>> method: 'average' >>> avg: [1x1 struct] >>> trialinfo: [338x1 double] >>> cfg: [1x1 struct] >>> >>> 4. also check your grid, should be something like this: >>> >>> sourcemodel = >>> >>> pos: [11000x3 double] >>> dim: [20 25 22] >>> unit: 'cm' >>> inside: [1x5798 double] >>> outside: [1x5202 double] >>> params: [1x1 struct] >>> initial: [4x4 double] >>> cfg: [1x1 struct] >>> >>> >>> Of course, it should all look a bit different, because you are using >>> LCMV, but essentially it should be the same. Lastly, you can check other >>> source plotting methods, like 'ortho' or try to plot the source >>> structure rather than the sourceInt structure. In the end, the error >>> must be somewhere in your grid, be it in .pos or .inside, because >>> FieldTrip thinks that there is only one voxel to be plotted. There are >>> other things that may be the issue, but I am not sure about these. So, I >>> would suggest that you play a bit around and see where the error might >>> come from (e.g. follow this tutorial: >>> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >>> steps that you need for LCMV, maybe also check out: >>> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >>> >>> there, LCMV is used, but on one voxel only) >>> >>> Best, >>> Jörn >>> >>>> The next part of my code is the following: >>>> >>>> % interpolate sources >>>> mri = ft_read_mri('Subject01.mri'); >>>> mri = ft_volumereslice([], mri); >>>> >>>> cfg = []; >>>> cfg.downsample = 2; >>>> cfg.parameter = 'avg.pow'; >>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>> parameter >>>> % does not vary over time, therefore the time >>>> dimension is not needed. >>>> >>>> mri = >>>> >>>> anatomy: [256x256x256 double] >>>> dim: [256 256 256] >>>> transform: [4x4 double] >>>> coordsys: 'ctf' >>>> unit: 'mm' >>>> cfg: [1x1 struct] >>>> >>>> I cant really see if the data works in the tutorial because it >>>> doesnt appear as though fieldtrip has a tutorial on lcmv >>>> beamformers, they seem to stick to frequency domain beamformers. >>>> >>>> Ive been wrong before though, >>>> >>>> thanks for your help. >>>> >>>> Tyler >>>> >>>> ************************* >>>> >>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>> PhD Candidate >>>> Brain Signals Laboratory >>>> Flinders University >>>> Rm 5A301 >>>> Ext 66124 >>>> >>>> ________________________________________ >>>> From: fieldtrip-bounces at science.ru.nl >>>> on behalf of "Jörn M. Horschig" >>>> >>>> Sent: Monday, 31 March 2014 7:13 PM >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>> ft_sourceplot >>>> >>>> Hi Tyler, >>>> >>>> hm, okay, it could be that the issue with the leadfield and with the >>>> plot are related, but it could also be that they are separate issues. I >>>> just saw that you posted the same 'problem' on bugzilla and included a >>>> picture. Maybe for next time, include a picture on the mailinglist and >>>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>>> and not if you are not sure. That saves us a lot of time in separating >>>> code issues from user problems ;) >>>> >>>> So, back to you problem. It seems that your reconstruction results in >>>> one voxel only. Are you sure that your grid consistents of more than >>>> just one position? So, for example check the size of the matrices in >>>> source.avg, source- and headmodel, etc. >>>> >>>> Also, you can check in Matlab the respective fields of source and >>>> sourceInt and see whether that makes sense. >>>> >>>> Lastly, a neat way to check is always to use your code on data from the >>>> tutorial, and vice versa, use code from the tutorial on your data and >>>> see whether that works. Both should give sensible results, and if one >>>> does not, you know where to start looking for a solution ;) >>>> >>>> Best, >>>> Jörn >>>> >>>> >>>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>>> Hey Jorn, >>>>> >>>>> Previously I have let ft_sourceanalysis do a lead field because if >>>>> I use the following code: >>>>> >>>>> % compute lead field ( apparently source analysis computes >>>>> % lead field anyway >>>>> cfg = []; >>>>> cfg.elec = timelock.elec; >>>>> cfg.vol = vol; >>>>> cfg.reducerank = 3; >>>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>>> cm resolution >>>>> cfg.grid.unit = 'cm'; >>>>> cfg.normalize = 'yes'; % if you are not >>>>> contrasting the activity of interest again another condition or >>>>> baseline time-window >>>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>>> I AM UP TO >>>>> >>>>> and then calculate the source analysis: >>>>> >>>>> % Source Analysis: without contrasting condition >>>>> cfg = []; >>>>> cfg.method = 'lcmv'; >>>>> cfg.grid = grid; >>>>> cfg.vol = vol; >>>>> % cfg.grid.pos = maxpos; >>>>> cfg.keepfilter = 'yes'; >>>>> cfg.dics.projectnoise = 'yes'; >>>>> % cfg.dics.lambda = 0; >>>>> source = ft_sourceanalysis( cfg, timelock); >>>>> >>>>> then I get an error than says: >>>>> >>>>> Error using * >>>>> Inner matrix dimensions must agree. >>>>> >>>>> Error in beamformer_lcmv (line 268) >>>>> filt = pinv(lf' * invCy * lf) * lf' * >>>>> invCy; % van Veen eqn. 23, use >>>>> PINV/SVD to cover rank deficient leadfield >>>>> >>>>> Error in ft_sourceanalysis (line 794) >>>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>>> optarg{:}); >>>>> >>>>> I just removed the leadfield code and it successfully ran. I could >>>>> also interpolate it later. >>>>> Is this the correct approach. >>>>> >>>>> Thankyou in advance! >>>>> >>>>> Tyler >>>>> >>>>> ************************* >>>>> >>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>> PhD Candidate >>>>> Brain Signals Laboratory >>>>> Flinders University >>>>> Rm 5A301 >>>>> Ext 66124 >>>>> >>>>> ________________________________________ >>>>> From: fieldtrip-bounces at science.ru.nl >>>>> on behalf of "Jörn M. Horschig" >>>>> >>>>> Sent: Monday, 31 March 2014 5:30 PM >>>>> To: FieldTrip discussion list >>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>> ft_sourceplot >>>>> >>>>> Hi Tyler, >>>>> >>>>> what you are describing sounds to me like the center bias of the >>>>> beamformer. Did you contrast the activity with anything, or did you >>>>> normalize your leadfield? >>>>> Check this out: >>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>>> >>>>> >>>>> Best, >>>>> Jörn >>>>> >>>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>>> I have been trying to plot my interpolated source data using the >>>>>> code: >>>>>> >>>>>> % interpolate sources >>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>> mri = ft_volumereslice([], mri); >>>>>> cfg = []; >>>>>> cfg.downsample = 2; >>>>>> cfg.parameter = 'avg.pow'; >>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>> parameter >>>>>> % does not vary over time, therefore the time >>>>>> dimension >>>>>> is not needed. >>>>>> >>>>>> % Plot interpolated data >>>>>> cfg = []; %#ok >>>>>> cfg.method = 'ortho'; % spline >>>>>> cfg.funparameter = 'avg.pow'; >>>>>> ft_sourceplot( cfg, sourceInt); >>>>>> >>>>>> However the figure that comes up just had orange squares in the >>>>>> subplots. >>>>>> >>>>>> I dont know where Ive gone wrong. >>>>>> >>>>>> >>>>>> Tyler >>>>>> >>>>>> >>>>>> ************************* >>>>>> >>>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>>> /PhD Candidate/ >>>>>> /Brain Signals Laboratory/ >>>>>> /Flinders University/ >>>>>> /Rm 5A301/ >>>>>> /Ext 66124/ >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> -- >>>>> Jörn M. Horschig >>>>> PhD Student >>>>> Donders Institute for Brain, Cognition and Behaviour >>>>> Centre for Cognitive Neuroimaging >>>>> Radboud University Nijmegen >>>>> Neuronal Oscillations Group >>>>> FieldTrip Development Team >>>>> >>>>> P.O. Box 9101 >>>>> NL-6500 HB Nijmegen >>>>> The Netherlands >>>>> >>>>> Contact: >>>>> E-Mail: jm.horschig at donders.ru.nl >>>>> Tel: +31-(0)24-36-68493 >>>>> Web: http://www.ru.nl/donders >>>>> >>>>> Visiting address: >>>>> Trigon, room 2.30 >>>>> Kapittelweg 29 >>>>> NL-6525 EN Nijmegen >>>>> The Netherlands >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> -- >>>> Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Tue Apr 1 08:24:11 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 01 Apr 2014 08:24:11 +0200 Subject: [FieldTrip] ICA: eeglab and fieldtrip In-Reply-To: References: Message-ID: <533A5B8B.5010207@donders.ru.nl> HI Aaron, in addition to what Stephen and especially Stephen said (fun quiz: who is who? ;)), pay attention that the colourscale might be different (also for different subplots) and therefore the plots from different toolboxes could suggest different activity in components, although in fact they are similar. Best, Jörn On 3/31/2014 10:10 PM, Stephen Whitmarsh wrote: > Hi Aaron (i see Stephen just wrote a similar response) > > Those component topoplots look pretty good to me. In the FT one, I > would say the first and third have a good change of being related to > eyeblinks, and the fifth and twenty-fifth to eye-movements. > However, you should really look at the timecourses to identify them as > related to saccades and blinks, and by comparing them with your EOG > recording. > > Although each ICA will *always* give you different results (if you > don't specifiy the random seed), to make them more comparable you > could add the EOG channel to the layout. > > Cheer, > Stephen > > > On 31 March 2014 22:08, Stephen Politzer-Ahles > wrote: > > Hello Aaron, > > This doesn't, answer the rest of your questions, but... In your > attached Fieldtrip image, component 1 does look like a likely > blink component to me? > > > > Stephen Politzer-Ahles > New York University, Abu Dhabi > Neuroscience of Language Lab > http://www.nyu.edu/projects/politzer-ahles/ > > > On Mon, Mar 31, 2014 at 11:52 PM, > wrote: > > > Message: 2 > Date: Mon, 31 Mar 2014 14:51:51 -0500 > From: Aaron Hanford > > To: "fieldtrip at science.ru.nl " > > > Subject: [FieldTrip] ICA: eeglab and fieldtrip > Message-ID: > Content-Type: text/plain; charset="iso-8859-1" > > Hi,I'm resending this with the figures turned into jpgs so > it's not oversize...anyway, so I'm somewhat new to both > fieldtrip and eeglab (although much more so to fieldtrip). > I'm trying to figure out the following: > > On the exact same dataset, I did the following two things: > 1) in eeglab, I just chose Tools -> Run ICA with default settings. > Then, starting over with the original raw data: > 2) In fieldtrip I ran the following: data = > eeglab2fieldtrip(EEG,'preprocessing','none');cfg = > [];cfg.method = > 'runica';[comp]=ft_componentanalysis(cfg,data);layout = > 'C:\Users\aharown\Desktop\fieldtrip-20140126\template\layout\easycapM17.mat';cfg.component > = [1:31];cfg.layout = layout;ft_topoplotIC(cfg,comp); > In both cases I then plotted the 2-D component maps, attached. > So my question is, why are these results so completely > different? The fieldtrip results don't look right at all, in > that for instance they don't obviously identify a blink > component (note that in this dataset, there is only one > electrode placed near the right eye, not the left). I did > this a handful of times and got the same sort of big > differences. Am I doing something wrong or what? > > I actually think the cap file seems incorrect, but I've been > assured by my PI that it's correct, so .... is there another > likely answer? > Thanks, > Aaron > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: fieldtrip.JPG > Type: image/jpeg > Size: 110477 bytes > Desc: not available > URL: > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: eeglab.JPG > Type: image/jpeg > Size: 99185 bytes > Desc: not available > URL: > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 40, Issue 48 > ***************************************** > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From tyler.grummett at flinders.edu.au Tue Apr 1 08:45:50 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 1 Apr 2014 06:45:50 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <533A5A14.4060700@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>, <533985D8.4080504@donders.ru.nl> <2573399203ce4b8481d629d08994337a@SIXPR03MB368.apcprd03.prod.outlook.com>, <533A5A14.4060700@donders.ru.nl> Message-ID: Hey Jorn, It looks like the function prepare_headmodel is altering cfg.channel at line 54: sens = ft_fetch_sens(cfg, data); line 94: [vol, sens] = ft_prepare_vol_sens(vol, sens, 'channel', cfg.channel, 'order', cfg.order); and line 97: cfg.channel = sens.label; sens = elecpos: [0x3 double] label: {1x0 cell} type: 'eeg1005' unit: 'cm' chanpos: [0x3 double] this function is called in ft_sourceanalysis. After that I dont have the labels anymore. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" Sent: Tuesday, 1 April 2014 4:47 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot Hi Tyler, the leadfield matrix contains by design no channel labels, and I think that FieldTrip assumes that the elements of the leadfield coincides with the elements of the channel. I guess you can avoid the error you get by setting cfg.channel = data.label; when computing the leadfield. You could try that, otherwise your code looks fine. Best, Jörn On 4/1/2014 1:58 AM, Tyler Grummett wrote: > Hey Jorn, > > I am still getting an error when running ft_sourceanalysis. Ill try and give you the full picture of what I am doing. > > 1. coming from eeglab to fieldtrip: > > % convert to fieldtrip > process = 'componentanalysis'; > data = eeglab2fieldtrip( EEG, process, 'none'); > > data = > > label: {1x121 cell} > fsample: 500 > elec: [1x1 struct] > trial: {[121x19767 single]} > time: {[1x19767 double]} > topolabel: {1x121 cell} > topo: [121x121 double] > cfg: [1x1 struct] > > 2. Calculate timelock analysis > > % calculating the timelock analysis > cfg = []; > % cfg.channel = 'EEG'; % for some reason it crashes the > % beamformer > cfg.vartrllength = 2; % accept variable length trials > cfg.covariance = 'yes'; > cfg.covariancewindow = 'all'; > % cfg.channel = data.label; > timelock = ft_timelockanalysis(cfg, data); > > timelock = > > avg: [121x19767 double] > var: [121x19767 double] > time: [1x19767 double] > dof: [121x19767 double] > label: {1x121 cell} > dimord: 'chan_time' > cov: [121x121 double] > elec: [1x1 struct] > cfg: [1x1 struct] > > 3. Calculate head model > > % the forward model and lead field matrix > mri = ft_read_mri( 'Subject01.mri'); > cfg = []; > cfg.write = 'no'; > cfg.coordsys = 'ctf'; > segmentedmri = ft_volumesegment(cfg, mri); > > cfg = []; > cfg.method = 'concentricspheres'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > vol = > > unit: 'mm' > r: 69.8077 > o: [19.2853 1.2231 54.6031] > cond: 1 > type: 'concentricspheres' > cfg: [1x1 struct] > > 4. Compute lead field > > % compute lead field ( apparently source analysis computes > % lead field anyway > cfg = []; > cfg.elec = timelock.elec; > cfg.vol = vol; > cfg.reducerank = 3; > cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution > cfg.grid.unit = 'cm'; > cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window > grid = ft_prepare_leadfield( cfg); > > grid = > > xgrid: [-5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8] > ygrid: [-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7] > zgrid: [-1 0 1 2 3 4 5 6 7 8 9 10 11 12] > dim: [14 14 14] > pos: [2744x3 double] > unit: 'cm' > inside: [1x1430 double] > outside: [1x1314 double] > cfg: [1x1 struct] > leadfield: {1x2744 cell} > > 5. Compute ft_source analysis > > % Source Analysis: without contrasting condition > cfg = []; > cfg.method = 'lcmv'; > cfg.grid = grid; > cfg.vol = vol; > % cfg.grid.pos = 'maxpos'; > cfg.keepfilter = 'yes'; > cfg.dics.projectnoise = 'yes'; > cfg.dics.lambda = 0; > source = ft_sourceanalysis( cfg, timelock); > > It crashes with the following error: > > Error using * > Inner matrix dimensions must agree. > > Error in beamformer_lcmv (line 268) > filt = pinv(lf' * invCy * lf) * lf' * invCy; > % van Veen eqn. 23, use PINV/SVD to cover rank > deficient leadfield > > Error in ft_sourceanalysis (line 794) > dip(i) = beamformer_lcmv(grid, sens, vol, > squeeze_avg, squeeze(Cy(i,:,:)), optarg{:}); > > > Please note that fieldtrip is up to date. > Can you see an error? I will trying looking in the tutorials again. > Also, did you want a segment of my data to see if you can get it working? > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" > Sent: Tuesday, 1 April 2014 1:42 AM > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot > > just to clarify and be precise >> The pos-matrix has to be a regular 3D grid, i.e. be representable as a >> 3x3x3 matrix. > it actually does not have to be as you can also beam individual grid > points, but if you have a .dim field, then is has to be like above. But > that does not affect the rest of the mail I wrote ;) > > >> I am not quite sure how the sourceinterpolate function is handeling >> the fact that you do not have that .dim field. Apparently, it is also >> confused ;) >> >> Do you want to reconstruct only some voxels? From your code it seems >> that you want to cover the whole brain with a 1cm resolution. If the >> latter is the case, maybe restart with creating your forward model by >> following the tutorial that I posted in my previous mail. There are >> some sanity checks that can help you figuring out if you are doing the >> correct thing. If the former one is the case, please explain again >> what exactly you want to achieve and how you are building your forward >> model. >> >> Best, >> Jörn >> >> btw, there's nothing wrong with being a PhD student, it's just a >> matter of experience in practice and theory as in all domains in life ;) >> >> >> On 3/31/2014 3:15 PM, Tyler Grummett wrote: >>> Hey Jorn, >>> >>> Yes I am definitely confused haha, this stuff is way out of my league >>> as a PhD student. >>> Anyway, I feel we are getting somewhere. >>> >>> timelock = >>> >>> avg: [121x19767 double] >>> var: [121x19767 double] >>> time: [1x19767 double] >>> dof: [121x19767 double] >>> label: {1x121 cell} >>> dimord: 'chan_time' >>> cov: [121x121 double] >>> elec: [1x1 struct] >>> cfg: [1x1 struct] >>> >>> source = >>> >>> time: [1x19767 double] >>> pos: [642x3 double] >>> inside: [642x1 double] >>> outside: [] >>> method: 'average' >>> avg: [1x1 struct] >>> cfg: [1x1 struct] >>> >>> sourceInt = >>> >>> time: [1x19767 double] >>> avg: [1x1 struct] >>> pos: [16777216x3 double] >>> dim: [256 256 256] >>> inside: [1x16777216 double] >>> outside: [1x0 double] >>> coordsys: 'ctf' >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> Given what I said last time, I might not comment on the differences. >>> I hope you can see something wrong. >>> >>> One thing I should mention is that the data is continuous, around 30 >>> seconds. Therefore there is only one trial, >>> is that an issue? >>> >>> Tyler >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl >>> on behalf of "Jörn M. Horschig" >>> >>> Sent: Monday, 31 March 2014 10:24 PM >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting interpolated sources with >>> ft_sourceplot >>> >>> Hi Tyler, >>> >>> there is not much inherently different between time- and >>> freuqency-domain beamformer, at least in terms of computing the forward >>> and the inverse solution. But I see that you are obviously confused, so >>> let me try to help you out and shed some light on what you are actually >>> doing ;) >>> >>> >>>> I had a look at my variables. >>>> >>>> source.avg = >>>> >>>> pow: [642x1 double] >>>> filter: {642x1 cell} >>>> >>>> sourceInt.avg = >>>> >>>> pow: [16777216x1 double] >>>> >>>> So clearly, as both variables are completely different. Something >>>> has gone wrong. >>> No, that is actually how it should be. From below you can see that your >>> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >>> 16777216 elements. In line with source.avg.pow, you should see that your >>> 'grid' consists of 642 elements, so you were computing your source >>> activity on a grid of in total 642 elements. Then you used the original >>> MRI to interpolate from 642 to these 16 million grid points. Actually, >>> since you specific cfg.downsample = 2, it should have been only 8 >>> million points, so that's where things already get a bit weird. >>> >>> So let's go into some sanity checks: >>> 1. are you using the latest version (or a recent, i.e. from this year) >>> of FielTrip? >>> 2. sourceInt should look something like this, does it? >>> >>> source_diff_int = >>> inside: [46x55x46 logical] >>> avg: [1x1 struct] >>> dim: [46 55 46] >>> transform: [4x4 double] >>> anatomy: [46x55x46 double] >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> >>> >>> 3. source should look something like this: >>> >>> source = >>> dim: [20 25 22] >>> freq: 54.8287 >>> cumtapcnt: [338x1 double] >>> pos: [11000x3 double] >>> inside: [1x5798 double] >>> outside: [1x5202 double] >>> method: 'average' >>> avg: [1x1 struct] >>> trialinfo: [338x1 double] >>> cfg: [1x1 struct] >>> >>> 4. also check your grid, should be something like this: >>> >>> sourcemodel = >>> >>> pos: [11000x3 double] >>> dim: [20 25 22] >>> unit: 'cm' >>> inside: [1x5798 double] >>> outside: [1x5202 double] >>> params: [1x1 struct] >>> initial: [4x4 double] >>> cfg: [1x1 struct] >>> >>> >>> Of course, it should all look a bit different, because you are using >>> LCMV, but essentially it should be the same. Lastly, you can check other >>> source plotting methods, like 'ortho' or try to plot the source >>> structure rather than the sourceInt structure. In the end, the error >>> must be somewhere in your grid, be it in .pos or .inside, because >>> FieldTrip thinks that there is only one voxel to be plotted. There are >>> other things that may be the issue, but I am not sure about these. So, I >>> would suggest that you play a bit around and see where the error might >>> come from (e.g. follow this tutorial: >>> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >>> steps that you need for LCMV, maybe also check out: >>> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >>> >>> there, LCMV is used, but on one voxel only) >>> >>> Best, >>> Jörn >>> >>>> The next part of my code is the following: >>>> >>>> % interpolate sources >>>> mri = ft_read_mri('Subject01.mri'); >>>> mri = ft_volumereslice([], mri); >>>> >>>> cfg = []; >>>> cfg.downsample = 2; >>>> cfg.parameter = 'avg.pow'; >>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>> parameter >>>> % does not vary over time, therefore the time >>>> dimension is not needed. >>>> >>>> mri = >>>> >>>> anatomy: [256x256x256 double] >>>> dim: [256 256 256] >>>> transform: [4x4 double] >>>> coordsys: 'ctf' >>>> unit: 'mm' >>>> cfg: [1x1 struct] >>>> >>>> I cant really see if the data works in the tutorial because it >>>> doesnt appear as though fieldtrip has a tutorial on lcmv >>>> beamformers, they seem to stick to frequency domain beamformers. >>>> >>>> Ive been wrong before though, >>>> >>>> thanks for your help. >>>> >>>> Tyler >>>> >>>> ************************* >>>> >>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>> PhD Candidate >>>> Brain Signals Laboratory >>>> Flinders University >>>> Rm 5A301 >>>> Ext 66124 >>>> >>>> ________________________________________ >>>> From: fieldtrip-bounces at science.ru.nl >>>> on behalf of "Jörn M. Horschig" >>>> >>>> Sent: Monday, 31 March 2014 7:13 PM >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>> ft_sourceplot >>>> >>>> Hi Tyler, >>>> >>>> hm, okay, it could be that the issue with the leadfield and with the >>>> plot are related, but it could also be that they are separate issues. I >>>> just saw that you posted the same 'problem' on bugzilla and included a >>>> picture. Maybe for next time, include a picture on the mailinglist and >>>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>>> and not if you are not sure. That saves us a lot of time in separating >>>> code issues from user problems ;) >>>> >>>> So, back to you problem. It seems that your reconstruction results in >>>> one voxel only. Are you sure that your grid consistents of more than >>>> just one position? So, for example check the size of the matrices in >>>> source.avg, source- and headmodel, etc. >>>> >>>> Also, you can check in Matlab the respective fields of source and >>>> sourceInt and see whether that makes sense. >>>> >>>> Lastly, a neat way to check is always to use your code on data from the >>>> tutorial, and vice versa, use code from the tutorial on your data and >>>> see whether that works. Both should give sensible results, and if one >>>> does not, you know where to start looking for a solution ;) >>>> >>>> Best, >>>> Jörn >>>> >>>> >>>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>>> Hey Jorn, >>>>> >>>>> Previously I have let ft_sourceanalysis do a lead field because if >>>>> I use the following code: >>>>> >>>>> % compute lead field ( apparently source analysis computes >>>>> % lead field anyway >>>>> cfg = []; >>>>> cfg.elec = timelock.elec; >>>>> cfg.vol = vol; >>>>> cfg.reducerank = 3; >>>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>>> cm resolution >>>>> cfg.grid.unit = 'cm'; >>>>> cfg.normalize = 'yes'; % if you are not >>>>> contrasting the activity of interest again another condition or >>>>> baseline time-window >>>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>>> I AM UP TO >>>>> >>>>> and then calculate the source analysis: >>>>> >>>>> % Source Analysis: without contrasting condition >>>>> cfg = []; >>>>> cfg.method = 'lcmv'; >>>>> cfg.grid = grid; >>>>> cfg.vol = vol; >>>>> % cfg.grid.pos = maxpos; >>>>> cfg.keepfilter = 'yes'; >>>>> cfg.dics.projectnoise = 'yes'; >>>>> % cfg.dics.lambda = 0; >>>>> source = ft_sourceanalysis( cfg, timelock); >>>>> >>>>> then I get an error than says: >>>>> >>>>> Error using * >>>>> Inner matrix dimensions must agree. >>>>> >>>>> Error in beamformer_lcmv (line 268) >>>>> filt = pinv(lf' * invCy * lf) * lf' * >>>>> invCy; % van Veen eqn. 23, use >>>>> PINV/SVD to cover rank deficient leadfield >>>>> >>>>> Error in ft_sourceanalysis (line 794) >>>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>>> optarg{:}); >>>>> >>>>> I just removed the leadfield code and it successfully ran. I could >>>>> also interpolate it later. >>>>> Is this the correct approach. >>>>> >>>>> Thankyou in advance! >>>>> >>>>> Tyler >>>>> >>>>> ************************* >>>>> >>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>> PhD Candidate >>>>> Brain Signals Laboratory >>>>> Flinders University >>>>> Rm 5A301 >>>>> Ext 66124 >>>>> >>>>> ________________________________________ >>>>> From: fieldtrip-bounces at science.ru.nl >>>>> on behalf of "Jörn M. Horschig" >>>>> >>>>> Sent: Monday, 31 March 2014 5:30 PM >>>>> To: FieldTrip discussion list >>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>> ft_sourceplot >>>>> >>>>> Hi Tyler, >>>>> >>>>> what you are describing sounds to me like the center bias of the >>>>> beamformer. Did you contrast the activity with anything, or did you >>>>> normalize your leadfield? >>>>> Check this out: >>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>>> >>>>> >>>>> Best, >>>>> Jörn >>>>> >>>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>>> I have been trying to plot my interpolated source data using the >>>>>> code: >>>>>> >>>>>> % interpolate sources >>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>> mri = ft_volumereslice([], mri); >>>>>> cfg = []; >>>>>> cfg.downsample = 2; >>>>>> cfg.parameter = 'avg.pow'; >>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>> parameter >>>>>> % does not vary over time, therefore the time >>>>>> dimension >>>>>> is not needed. >>>>>> >>>>>> % Plot interpolated data >>>>>> cfg = []; %#ok >>>>>> cfg.method = 'ortho'; % spline >>>>>> cfg.funparameter = 'avg.pow'; >>>>>> ft_sourceplot( cfg, sourceInt); >>>>>> >>>>>> However the figure that comes up just had orange squares in the >>>>>> subplots. >>>>>> >>>>>> I dont know where Ive gone wrong. >>>>>> >>>>>> >>>>>> Tyler >>>>>> >>>>>> >>>>>> ************************* >>>>>> >>>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>>> /PhD Candidate/ >>>>>> /Brain Signals Laboratory/ >>>>>> /Flinders University/ >>>>>> /Rm 5A301/ >>>>>> /Ext 66124/ >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> -- >>>>> Jörn M. Horschig >>>>> PhD Student >>>>> Donders Institute for Brain, Cognition and Behaviour >>>>> Centre for Cognitive Neuroimaging >>>>> Radboud University Nijmegen >>>>> Neuronal Oscillations Group >>>>> FieldTrip Development Team >>>>> >>>>> P.O. Box 9101 >>>>> NL-6500 HB Nijmegen >>>>> The Netherlands >>>>> >>>>> Contact: >>>>> E-Mail: jm.horschig at donders.ru.nl >>>>> Tel: +31-(0)24-36-68493 >>>>> Web: http://www.ru.nl/donders >>>>> >>>>> Visiting address: >>>>> Trigon, room 2.30 >>>>> Kapittelweg 29 >>>>> NL-6525 EN Nijmegen >>>>> The Netherlands >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> -- >>>> Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From natalia.zaretskaya at cin.uni-tuebingen.de Tue Apr 1 09:19:39 2014 From: natalia.zaretskaya at cin.uni-tuebingen.de (Natalia Zaretskaya) Date: Tue, 1 Apr 2014 09:19:39 +0200 Subject: [FieldTrip] PLV with DICS beamformer Message-ID: <003FC94A-3967-44F3-A0E2-BC813E99C4D8@cin.uni-tuebingen.de> Dear FieldTrip experts, I would like to be able to compute the phase-locking value (Lachaux, 1999) using source data derived from disc beamformer. Right now I perform ft_sourceanalysis with cfg.method = ‘dics’; cfg.refdip = [x y z]; cfg.rawtrial = ‘yes’; cfg.keepcsd = ‘yes’; cfg.grid.filter = source.avg.filter; % precomputed common filter for two conditions and then use the imaginary part of the single-trial cross-spectral densities to compute PLV “by hand”. Cross-spectra at each position have a 3x3 format, so I compute the PLV for each dipole orientation pair and then average. I was wondering whether 1) the above procedure is technically correct and 2) whether there is a better, more efficient way to do it (I assume plv can be derived at the same step where source.avg.coh is computed?). Many thanks in advance! Best regards, Natalia Zaretskaya --- Dr. Natalia Zaretskaya Centre for Integrative Neuroscience Vision and Cognition Lab (AG Bartels) 72076 Tübingen, Germany natalia.zaretskaya at cin.uni-tuebingen.de phone: +49 7071 2989032 -------------- next part -------------- An HTML attachment was scrubbed... URL: From meschwe at gmail.com Tue Apr 1 14:12:20 2014 From: meschwe at gmail.com (Meike Schweisfurth) Date: Tue, 1 Apr 2014 14:12:20 +0200 Subject: [FieldTrip] source analysis on the group level Message-ID: Dear Fieldtrippers! I am very new to MEG and have a question concerning source analysis on the group level. Specifically, I have two consecutive problems: 1) After mne source analysis (roughly as described in http://fieldtrip.fcdonders.nl/tutorial/minimumnormestimate) for individual subjects and for two different conditions, I would like to combine the data between subjects for each condition (using the same grid for all of them). However, I keep getting the following error: *"Subscripted assignment dimension mismatch.* *Error in ft_sourcegrandaverage (line 157)* * dat(:,i) = tmp(:);*" Does anybody know know to handle that or why it occurs? 2) I then went on without averaging and wanted to calculated statistics, very much as described in http://fieldtrip.fcdonders.nl/example/source_statistics in the group level section. As I could not use ft_sourcegrandaverage before, I fed in the output from ft_sourceanalysis for all subjects behind each other, cfg=[]; %cfg.dim = sc1{1}.dim; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.parameter = 'pow'; cfg.correctm = 'cluster'; cfg.numrandomization = 500; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.alpha = 0.025; cfg.tail = 0; cfg.latency =[0, 0.6]; nsubj=numel(sc1); cfg.design(1,:) = [1:nsubj 1:nsubj]; cfg.design(2,:) = [ones(1,nsubj) ones(1,nsubj)*2]; cfg.uvar = 1; % row of design matrix that contains unit variable (in this case: subjects) cfg.ivar = 2; % row of design matrix that contains independent variable (the conditions) stat = ft_sourcestatistics(cfg, sc1{1}, sc1{2}, sc1{3}, sc2{1}, sc2{2} ,sc2{3} ); , where e.g. sc1{1}=time: [1x1465 double] pos: [3000x3 double] inside: [3000x1 double] outside: [1x0 double] method: 'average' avg: [1x1 struct] cfg: [1x1 struct] First, I got an error saying that I do not have a field 'pow', which I had entered as cfg.parameter = 'pow', although that field was only hidden in sc1{}.avg.pow. To circumvent that error, I then copied the avg.pow data to an extra field pow and the error was gone pow: [3000x1465 double] However, giving now I get the error: *"Error using false* *Out of memory. Type HELP MEMORY for your options.* *Error in ft_statistics_montecarlo (line 177)* * cfg.connectivity = false(size(dat,1));* *Error in statistics_wrapper (line 308)* * [stat, cfg] = statmethod(cfg, dat, design);* *Error in ft_sourcestatistics (line 107)* * [stat, cfg] = statistics_wrapper(cfg, varargin{:});**"* Does anybody know a solution for that? What should I set cfg.dim to, as I do not have output from ft_sourcegrandaverage? I would be really happy for any help! Best, Meike -------------- next part -------------- An HTML attachment was scrubbed... URL: From meschwe at gmail.com Tue Apr 1 14:12:45 2014 From: meschwe at gmail.com (Meike Schweisfurth) Date: Tue, 1 Apr 2014 14:12:45 +0200 Subject: [FieldTrip] warping from MNI to individual subjects Message-ID: Dear Fieldtrippers! As newbie I have another question, now concerning the warping from MNI to individual subjects. Using the below code (the first part almost entirely from http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space), I get first the template and then apply the grid to the individual subjects. However, in later on analysis step it turned out that while the subjects where nicely similar positioned, the template position is entirely different, as it is was even axes were exchanged... Does anybody know what could be the reason and how to change it? Thanks for any suggestions! Best, Meike % NOTE: the path to the template file is user-specific template = ft_read_mri('fieldtrip/fieldtrip-20140316/external/spm8/templates/T1.nii'); template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the coordinate system % segment the template brain and construct a volume conduction model (i.e. head model): this is needed % for the inside/outside detection of voxels. cfg = []; template_seg = ft_volumesegment(cfg, template); cfg = []; cfg.method = 'singleshell'; template_vol = ft_prepare_headmodel(cfg, template_seg); template_vol = ft_convert_units(template_vol, 'cm'); % Convert the vol to cm, since the grid will also be expressed in cm % construct the dipole grid in the template brain coordinates % the source units are in cm % the negative inwardshift means an outward shift of the brain surface for inside/outside detection cfg = []; cfg.grid.xgrid = -20:1:20; cfg.grid.ygrid = -20:1:20; cfg.grid.zgrid = -20:1:20; cfg.grid.unit = 'cm'; cfg.grid.tight = 'yes'; cfg.inwardshift = -1.5; cfg.vol = template_vol; template_grid = ft_prepare_sourcemodel(cfg); save('../analysis/MEG/source_analysis/MNI','template_grid','template_vol','template_seg','template') % make a figure with the template head model and dipole grid figure hold on ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', 'none');alpha 0.5; camlight; ft_plot_mesh(template_grid.pos(template_grid.inside,:)); else load('../analysis/MEG/source_analysis/MNI','template_grid','template_vol','template_seg','template') %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SUBJECTS={ 'VP02' 'VP03' 'VP04' 'VP05' 'VP06' 'VP07' 'VP08' 'VP09' 'VP11' 'VP12' 'VP13' 'VP14' 'VP15' 'VP16' 'VP17' 'VP18'} for SUBJI=SUBJECTS SUBJ=SUBJI{1}; % read the single subject anatomical MRI load(['..*/analysis/MEG/source_analysis/*',SUBJ,'/mri']); %Has been processed to CFT coordinates before load(['..*/analysis/MEG/source_analysis/*',SUBJ,'/segmentedmri']); cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, segmentedmri); % create the subject specific grid, using the template grid that has just been created cfg = []; cfg.grid.warpmni = 'yes'; cfg.grid.template = template_grid; cfg.grid.nonlinear = 'yes'; % use non-linear normalization cfg.mri = mri_ra; grid = ft_prepare_sourcemodel(cfg); % make a figure of the single subject headmodel, and grid positions figure; ft_plot_vol(vol, 'edgecolor', 'none'); alpha 0.4; %camlight ft_plot_mesh(grid.pos(grid.inside,:)); save(['..*/analysis/MEG/source_analysis/*',SUBJ,'/MNIgrid'],'grid','vol') end -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Tue Apr 1 15:12:48 2014 From: julian.keil at gmail.com (Julian Keil) Date: Tue, 1 Apr 2014 15:12:48 +0200 Subject: [FieldTrip] warping from MNI to individual subjects In-Reply-To: References: Message-ID: <57CBCEA0-7232-44A9-A8B0-05588E4C2310@gmail.com> Dear Meike, I'm not sure if this relates to your problem, but I had - possibly similar - issues with the warped grid and the template being 90° rotated. My problem was due to an error during the realignment of the MRI. Did you check whether the realignment works and whether your different coordinate systems make sense? Could you also maybe attach a picture of your exchanged axes? At least for me it's hard to image how this looks. Best, Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 01.04.2014 um 14:12 schrieb Meike Schweisfurth: > Dear Fieldtrippers! > As newbie I have another question, now concerning the warping from MNI to individual subjects. > Using the below code (the first part almost entirely from http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space), I get first the template and then apply the grid to the individual subjects. > However, in later on analysis step it turned out that while the subjects where nicely similar positioned, the template position is entirely different, as it is was even axes were exchanged... > Does anybody know what could be the reason and how to change it? > Thanks for any suggestions! > Best, Meike > > > % NOTE: the path to the template file is user-specific > template = ft_read_mri('fieldtrip/fieldtrip-20140316/external/spm8/templates/T1.nii'); > template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the coordinate system > > % segment the template brain and construct a volume conduction model (i.e. head model): this is needed > % for the inside/outside detection of voxels. > cfg = []; > template_seg = ft_volumesegment(cfg, template); > > cfg = []; > cfg.method = 'singleshell'; > template_vol = ft_prepare_headmodel(cfg, template_seg); > template_vol = ft_convert_units(template_vol, 'cm'); % Convert the vol to cm, since the grid will also be expressed in cm > > % construct the dipole grid in the template brain coordinates > % the source units are in cm > % the negative inwardshift means an outward shift of the brain surface for inside/outside detection > cfg = []; > cfg.grid.xgrid = -20:1:20; > cfg.grid.ygrid = -20:1:20; > cfg.grid.zgrid = -20:1:20; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > cfg.inwardshift = -1.5; > cfg.vol = template_vol; > template_grid = ft_prepare_sourcemodel(cfg); > save('../analysis/MEG/source_analysis/MNI','template_grid','template_vol','template_seg','template') > % make a figure with the template head model and dipole grid > figure > hold on > ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', 'none');alpha 0.5; camlight; > ft_plot_mesh(template_grid.pos(template_grid.inside,:)); > else load('../analysis/MEG/source_analysis/MNI','template_grid','template_vol','template_seg','template') > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > SUBJECTS={ 'VP02' 'VP03' 'VP04' 'VP05' 'VP06' 'VP07' 'VP08' 'VP09' 'VP11' 'VP12' 'VP13' 'VP14' 'VP15' 'VP16' 'VP17' 'VP18'} > > for SUBJI=SUBJECTS > SUBJ=SUBJI{1}; > % read the single subject anatomical MRI > load(['../analysis/MEG/source_analysis/',SUBJ,'/mri']); %Has been processed to CFT coordinates before > load(['../analysis/MEG/source_analysis/',SUBJ,'/segmentedmri']); > > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > % create the subject specific grid, using the template grid that has just been created > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template_grid; > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > cfg.mri = mri_ra; > grid = ft_prepare_sourcemodel(cfg); > > % make a figure of the single subject headmodel, and grid positions > figure; > ft_plot_vol(vol, 'edgecolor', 'none'); alpha 0.4; %camlight > ft_plot_mesh(grid.pos(grid.inside,:)); > > save(['../analysis/MEG/source_analysis/',SUBJ,'/MNIgrid'],'grid','vol') > end > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Apr 1 17:16:27 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 01 Apr 2014 17:16:27 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>, <533985D8.4080504@donders.ru.nl> Message-ID: <533AD84B.6060600@donders.ru.nl> Hi Tyler, any reason why you don't want to go back to sensor-space but stay in component-space with your data? I would assume that the error will be gone if you use the back-projected data (ft_rejectcomponent, with cfg.component = []). Best, Jörn On 4/1/2014 8:15 AM, Tyler Grummett wrote: > Hey Jorn, > > In addition to my previous emails, Ive been trying to debug the functions. > > In ft_sourceanalysis, line 661 to 677: > > % HACK: use the default code > % select the channels of interest > [dum, datchanindx] = match_str(cfg.channel, data.label); > if strcmp(data.dimord, 'chan_time') > % It is in principle possible to have timelockanalysis with > % keeptrial=yes and only a single trial in the raw data. > % In that case the covariance should be represented as Nchan*Nchan > data.avg = data.avg(datchanindx,:); > %data.cov = reshape(data.cov, length(datchanindx), length(datchanindx)); > data.cov = data.cov(datchanindx,datchanindx); > else > data.avg = data.avg(datchanindx,:); > data.cov = data.cov(:,datchanindx,datchanindx); > data.trial = data.trial(:,datchanindx,:); > end > data.label = data.label(datchanindx); > Nchans = length(data.label); > > I found that my cfg.channel is []; and the data.label is all my ICA components labelled ica_001 etc. > > So it is returned as a []; > which means data.cov = []; > > I think then it will crash later parts of the code. Does this function work on ICA components? > > I ran the ICA in eeglab. > > Tyler. > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" > Sent: Tuesday, 1 April 2014 1:42 AM > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot > > just to clarify and be precise >> The pos-matrix has to be a regular 3D grid, i.e. be representable as a >> 3x3x3 matrix. > it actually does not have to be as you can also beam individual grid > points, but if you have a .dim field, then is has to be like above. But > that does not affect the rest of the mail I wrote ;) > > >> I am not quite sure how the sourceinterpolate function is handeling >> the fact that you do not have that .dim field. Apparently, it is also >> confused ;) >> >> Do you want to reconstruct only some voxels? From your code it seems >> that you want to cover the whole brain with a 1cm resolution. If the >> latter is the case, maybe restart with creating your forward model by >> following the tutorial that I posted in my previous mail. There are >> some sanity checks that can help you figuring out if you are doing the >> correct thing. If the former one is the case, please explain again >> what exactly you want to achieve and how you are building your forward >> model. >> >> Best, >> Jörn >> >> btw, there's nothing wrong with being a PhD student, it's just a >> matter of experience in practice and theory as in all domains in life ;) >> >> >> On 3/31/2014 3:15 PM, Tyler Grummett wrote: >>> Hey Jorn, >>> >>> Yes I am definitely confused haha, this stuff is way out of my league >>> as a PhD student. >>> Anyway, I feel we are getting somewhere. >>> >>> timelock = >>> >>> avg: [121x19767 double] >>> var: [121x19767 double] >>> time: [1x19767 double] >>> dof: [121x19767 double] >>> label: {1x121 cell} >>> dimord: 'chan_time' >>> cov: [121x121 double] >>> elec: [1x1 struct] >>> cfg: [1x1 struct] >>> >>> source = >>> >>> time: [1x19767 double] >>> pos: [642x3 double] >>> inside: [642x1 double] >>> outside: [] >>> method: 'average' >>> avg: [1x1 struct] >>> cfg: [1x1 struct] >>> >>> sourceInt = >>> >>> time: [1x19767 double] >>> avg: [1x1 struct] >>> pos: [16777216x3 double] >>> dim: [256 256 256] >>> inside: [1x16777216 double] >>> outside: [1x0 double] >>> coordsys: 'ctf' >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> Given what I said last time, I might not comment on the differences. >>> I hope you can see something wrong. >>> >>> One thing I should mention is that the data is continuous, around 30 >>> seconds. Therefore there is only one trial, >>> is that an issue? >>> >>> Tyler >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl >>> on behalf of "Jörn M. Horschig" >>> >>> Sent: Monday, 31 March 2014 10:24 PM >>> To: FieldTrip discussion list >>> Subject: Re: [FieldTrip] plotting interpolated sources with >>> ft_sourceplot >>> >>> Hi Tyler, >>> >>> there is not much inherently different between time- and >>> freuqency-domain beamformer, at least in terms of computing the forward >>> and the inverse solution. But I see that you are obviously confused, so >>> let me try to help you out and shed some light on what you are actually >>> doing ;) >>> >>> >>>> I had a look at my variables. >>>> >>>> source.avg = >>>> >>>> pow: [642x1 double] >>>> filter: {642x1 cell} >>>> >>>> sourceInt.avg = >>>> >>>> pow: [16777216x1 double] >>>> >>>> So clearly, as both variables are completely different. Something >>>> has gone wrong. >>> No, that is actually how it should be. From below you can see that your >>> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >>> 16777216 elements. In line with source.avg.pow, you should see that your >>> 'grid' consists of 642 elements, so you were computing your source >>> activity on a grid of in total 642 elements. Then you used the original >>> MRI to interpolate from 642 to these 16 million grid points. Actually, >>> since you specific cfg.downsample = 2, it should have been only 8 >>> million points, so that's where things already get a bit weird. >>> >>> So let's go into some sanity checks: >>> 1. are you using the latest version (or a recent, i.e. from this year) >>> of FielTrip? >>> 2. sourceInt should look something like this, does it? >>> >>> source_diff_int = >>> inside: [46x55x46 logical] >>> avg: [1x1 struct] >>> dim: [46 55 46] >>> transform: [4x4 double] >>> anatomy: [46x55x46 double] >>> unit: 'mm' >>> cfg: [1x1 struct] >>> >>> >>> >>> 3. source should look something like this: >>> >>> source = >>> dim: [20 25 22] >>> freq: 54.8287 >>> cumtapcnt: [338x1 double] >>> pos: [11000x3 double] >>> inside: [1x5798 double] >>> outside: [1x5202 double] >>> method: 'average' >>> avg: [1x1 struct] >>> trialinfo: [338x1 double] >>> cfg: [1x1 struct] >>> >>> 4. also check your grid, should be something like this: >>> >>> sourcemodel = >>> >>> pos: [11000x3 double] >>> dim: [20 25 22] >>> unit: 'cm' >>> inside: [1x5798 double] >>> outside: [1x5202 double] >>> params: [1x1 struct] >>> initial: [4x4 double] >>> cfg: [1x1 struct] >>> >>> >>> Of course, it should all look a bit different, because you are using >>> LCMV, but essentially it should be the same. Lastly, you can check other >>> source plotting methods, like 'ortho' or try to plot the source >>> structure rather than the sourceInt structure. In the end, the error >>> must be somewhere in your grid, be it in .pos or .inside, because >>> FieldTrip thinks that there is only one voxel to be plotted. There are >>> other things that may be the issue, but I am not sure about these. So, I >>> would suggest that you play a bit around and see where the error might >>> come from (e.g. follow this tutorial: >>> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >>> steps that you need for LCMV, maybe also check out: >>> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >>> >>> there, LCMV is used, but on one voxel only) >>> >>> Best, >>> Jörn >>> >>>> The next part of my code is the following: >>>> >>>> % interpolate sources >>>> mri = ft_read_mri('Subject01.mri'); >>>> mri = ft_volumereslice([], mri); >>>> >>>> cfg = []; >>>> cfg.downsample = 2; >>>> cfg.parameter = 'avg.pow'; >>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>> parameter >>>> % does not vary over time, therefore the time >>>> dimension is not needed. >>>> >>>> mri = >>>> >>>> anatomy: [256x256x256 double] >>>> dim: [256 256 256] >>>> transform: [4x4 double] >>>> coordsys: 'ctf' >>>> unit: 'mm' >>>> cfg: [1x1 struct] >>>> >>>> I cant really see if the data works in the tutorial because it >>>> doesnt appear as though fieldtrip has a tutorial on lcmv >>>> beamformers, they seem to stick to frequency domain beamformers. >>>> >>>> Ive been wrong before though, >>>> >>>> thanks for your help. >>>> >>>> Tyler >>>> >>>> ************************* >>>> >>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>> PhD Candidate >>>> Brain Signals Laboratory >>>> Flinders University >>>> Rm 5A301 >>>> Ext 66124 >>>> >>>> ________________________________________ >>>> From: fieldtrip-bounces at science.ru.nl >>>> on behalf of "Jörn M. Horschig" >>>> >>>> Sent: Monday, 31 March 2014 7:13 PM >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>> ft_sourceplot >>>> >>>> Hi Tyler, >>>> >>>> hm, okay, it could be that the issue with the leadfield and with the >>>> plot are related, but it could also be that they are separate issues. I >>>> just saw that you posted the same 'problem' on bugzilla and included a >>>> picture. Maybe for next time, include a picture on the mailinglist and >>>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>>> and not if you are not sure. That saves us a lot of time in separating >>>> code issues from user problems ;) >>>> >>>> So, back to you problem. It seems that your reconstruction results in >>>> one voxel only. Are you sure that your grid consistents of more than >>>> just one position? So, for example check the size of the matrices in >>>> source.avg, source- and headmodel, etc. >>>> >>>> Also, you can check in Matlab the respective fields of source and >>>> sourceInt and see whether that makes sense. >>>> >>>> Lastly, a neat way to check is always to use your code on data from the >>>> tutorial, and vice versa, use code from the tutorial on your data and >>>> see whether that works. Both should give sensible results, and if one >>>> does not, you know where to start looking for a solution ;) >>>> >>>> Best, >>>> Jörn >>>> >>>> >>>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>>> Hey Jorn, >>>>> >>>>> Previously I have let ft_sourceanalysis do a lead field because if >>>>> I use the following code: >>>>> >>>>> % compute lead field ( apparently source analysis computes >>>>> % lead field anyway >>>>> cfg = []; >>>>> cfg.elec = timelock.elec; >>>>> cfg.vol = vol; >>>>> cfg.reducerank = 3; >>>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>>> cm resolution >>>>> cfg.grid.unit = 'cm'; >>>>> cfg.normalize = 'yes'; % if you are not >>>>> contrasting the activity of interest again another condition or >>>>> baseline time-window >>>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>>> I AM UP TO >>>>> >>>>> and then calculate the source analysis: >>>>> >>>>> % Source Analysis: without contrasting condition >>>>> cfg = []; >>>>> cfg.method = 'lcmv'; >>>>> cfg.grid = grid; >>>>> cfg.vol = vol; >>>>> % cfg.grid.pos = maxpos; >>>>> cfg.keepfilter = 'yes'; >>>>> cfg.dics.projectnoise = 'yes'; >>>>> % cfg.dics.lambda = 0; >>>>> source = ft_sourceanalysis( cfg, timelock); >>>>> >>>>> then I get an error than says: >>>>> >>>>> Error using * >>>>> Inner matrix dimensions must agree. >>>>> >>>>> Error in beamformer_lcmv (line 268) >>>>> filt = pinv(lf' * invCy * lf) * lf' * >>>>> invCy; % van Veen eqn. 23, use >>>>> PINV/SVD to cover rank deficient leadfield >>>>> >>>>> Error in ft_sourceanalysis (line 794) >>>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>>> optarg{:}); >>>>> >>>>> I just removed the leadfield code and it successfully ran. I could >>>>> also interpolate it later. >>>>> Is this the correct approach. >>>>> >>>>> Thankyou in advance! >>>>> >>>>> Tyler >>>>> >>>>> ************************* >>>>> >>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>> PhD Candidate >>>>> Brain Signals Laboratory >>>>> Flinders University >>>>> Rm 5A301 >>>>> Ext 66124 >>>>> >>>>> ________________________________________ >>>>> From: fieldtrip-bounces at science.ru.nl >>>>> on behalf of "Jörn M. Horschig" >>>>> >>>>> Sent: Monday, 31 March 2014 5:30 PM >>>>> To: FieldTrip discussion list >>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>> ft_sourceplot >>>>> >>>>> Hi Tyler, >>>>> >>>>> what you are describing sounds to me like the center bias of the >>>>> beamformer. Did you contrast the activity with anything, or did you >>>>> normalize your leadfield? >>>>> Check this out: >>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>>> >>>>> >>>>> Best, >>>>> Jörn >>>>> >>>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>>> I have been trying to plot my interpolated source data using the >>>>>> code: >>>>>> >>>>>> % interpolate sources >>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>> mri = ft_volumereslice([], mri); >>>>>> cfg = []; >>>>>> cfg.downsample = 2; >>>>>> cfg.parameter = 'avg.pow'; >>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>> parameter >>>>>> % does not vary over time, therefore the time >>>>>> dimension >>>>>> is not needed. >>>>>> >>>>>> % Plot interpolated data >>>>>> cfg = []; %#ok >>>>>> cfg.method = 'ortho'; % spline >>>>>> cfg.funparameter = 'avg.pow'; >>>>>> ft_sourceplot( cfg, sourceInt); >>>>>> >>>>>> However the figure that comes up just had orange squares in the >>>>>> subplots. >>>>>> >>>>>> I dont know where Ive gone wrong. >>>>>> >>>>>> >>>>>> Tyler >>>>>> >>>>>> >>>>>> ************************* >>>>>> >>>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>>> /PhD Candidate/ >>>>>> /Brain Signals Laboratory/ >>>>>> /Flinders University/ >>>>>> /Rm 5A301/ >>>>>> /Ext 66124/ >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> -- >>>>> Jörn M. Horschig >>>>> PhD Student >>>>> Donders Institute for Brain, Cognition and Behaviour >>>>> Centre for Cognitive Neuroimaging >>>>> Radboud University Nijmegen >>>>> Neuronal Oscillations Group >>>>> FieldTrip Development Team >>>>> >>>>> P.O. Box 9101 >>>>> NL-6500 HB Nijmegen >>>>> The Netherlands >>>>> >>>>> Contact: >>>>> E-Mail: jm.horschig at donders.ru.nl >>>>> Tel: +31-(0)24-36-68493 >>>>> Web: http://www.ru.nl/donders >>>>> >>>>> Visiting address: >>>>> Trigon, room 2.30 >>>>> Kapittelweg 29 >>>>> NL-6525 EN Nijmegen >>>>> The Netherlands >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> -- >>>> Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From r.oostenveld at donders.ru.nl Tue Apr 1 19:19:57 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Tue, 1 Apr 2014 19:19:57 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <533AD84B.6060600@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>, <533985D8.4080504@donders.ru.nl> <533AD84B.6060600@donders.ru.nl> Message-ID: Hi Jorn I was browsing the FT list and see that you got involved with this question from Tyler. I can imagine there being problems with a pipeline like this preprocessing -> componentanalysis -> timelockanalysis -> dipolefitting although it should (i.e. "is meant to") work by fitting dipoles to component topographies. But the code is not frequently used like this and it might be possible that there has been regression of the code (i.e bugs in the latest version that were not there before). With sourceanalysis it depends on the method. Covariance estimates between components does not make much sense in the further inversion, and thereby beamforming won’t work. MNE should in principle work, but not with an estimated data covariance but rather a scaled identity covariance. Given the uncertain level of support , but clear expectations on what should (and should not) work, I suggest to file it as “bug” (i.e. the issue is that it should be tested) and to write a test script that goes (with e.g. some simulated data) over the various options. best regards, Robert On 01 Apr 2014, at 17:16, Jörn M. Horschig wrote: > Hi Tyler, > > any reason why you don't want to go back to sensor-space but stay in component-space with your data? I would assume that the error will be gone if you use the back-projected data (ft_rejectcomponent, with cfg.component = []). > > Best, > Jörn > > On 4/1/2014 8:15 AM, Tyler Grummett wrote: >> Hey Jorn, >> >> In addition to my previous emails, Ive been trying to debug the functions. >> >> In ft_sourceanalysis, line 661 to 677: >> >> % HACK: use the default code >> % select the channels of interest >> [dum, datchanindx] = match_str(cfg.channel, data.label); >> if strcmp(data.dimord, 'chan_time') >> % It is in principle possible to have timelockanalysis with >> % keeptrial=yes and only a single trial in the raw data. >> % In that case the covariance should be represented as Nchan*Nchan >> data.avg = data.avg(datchanindx,:); >> %data.cov = reshape(data.cov, length(datchanindx), length(datchanindx)); >> data.cov = data.cov(datchanindx,datchanindx); >> else >> data.avg = data.avg(datchanindx,:); >> data.cov = data.cov(:,datchanindx,datchanindx); >> data.trial = data.trial(:,datchanindx,:); >> end >> data.label = data.label(datchanindx); >> Nchans = length(data.label); >> >> I found that my cfg.channel is []; and the data.label is all my ICA components labelled ica_001 etc. >> >> So it is returned as a []; >> which means data.cov = []; >> >> I think then it will crash later parts of the code. Does this function work on ICA components? >> >> I ran the ICA in eeglab. >> >> Tyler. >> >> ************************* >> >> Tyler Grummett ( BBSc, BSc(Hons I)) >> PhD Candidate >> Brain Signals Laboratory >> Flinders University >> Rm 5A301 >> Ext 66124 >> >> ________________________________________ >> From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" >> Sent: Tuesday, 1 April 2014 1:42 AM >> To: fieldtrip at science.ru.nl >> Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot >> >> just to clarify and be precise >>> The pos-matrix has to be a regular 3D grid, i.e. be representable as a >>> 3x3x3 matrix. >> it actually does not have to be as you can also beam individual grid >> points, but if you have a .dim field, then is has to be like above. But >> that does not affect the rest of the mail I wrote ;) >> >> >>> I am not quite sure how the sourceinterpolate function is handeling >>> the fact that you do not have that .dim field. Apparently, it is also >>> confused ;) >>> >>> Do you want to reconstruct only some voxels? From your code it seems >>> that you want to cover the whole brain with a 1cm resolution. If the >>> latter is the case, maybe restart with creating your forward model by >>> following the tutorial that I posted in my previous mail. There are >>> some sanity checks that can help you figuring out if you are doing the >>> correct thing. If the former one is the case, please explain again >>> what exactly you want to achieve and how you are building your forward >>> model. >>> >>> Best, >>> Jörn >>> >>> btw, there's nothing wrong with being a PhD student, it's just a >>> matter of experience in practice and theory as in all domains in life ;) >>> >>> >>> On 3/31/2014 3:15 PM, Tyler Grummett wrote: >>>> Hey Jorn, >>>> >>>> Yes I am definitely confused haha, this stuff is way out of my league >>>> as a PhD student. >>>> Anyway, I feel we are getting somewhere. >>>> >>>> timelock = >>>> >>>> avg: [121x19767 double] >>>> var: [121x19767 double] >>>> time: [1x19767 double] >>>> dof: [121x19767 double] >>>> label: {1x121 cell} >>>> dimord: 'chan_time' >>>> cov: [121x121 double] >>>> elec: [1x1 struct] >>>> cfg: [1x1 struct] >>>> >>>> source = >>>> >>>> time: [1x19767 double] >>>> pos: [642x3 double] >>>> inside: [642x1 double] >>>> outside: [] >>>> method: 'average' >>>> avg: [1x1 struct] >>>> cfg: [1x1 struct] >>>> >>>> sourceInt = >>>> >>>> time: [1x19767 double] >>>> avg: [1x1 struct] >>>> pos: [16777216x3 double] >>>> dim: [256 256 256] >>>> inside: [1x16777216 double] >>>> outside: [1x0 double] >>>> coordsys: 'ctf' >>>> unit: 'mm' >>>> cfg: [1x1 struct] >>>> >>>> Given what I said last time, I might not comment on the differences. >>>> I hope you can see something wrong. >>>> >>>> One thing I should mention is that the data is continuous, around 30 >>>> seconds. Therefore there is only one trial, >>>> is that an issue? >>>> >>>> Tyler >>>> >>>> ************************* >>>> >>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>> PhD Candidate >>>> Brain Signals Laboratory >>>> Flinders University >>>> Rm 5A301 >>>> Ext 66124 >>>> >>>> ________________________________________ >>>> From: fieldtrip-bounces at science.ru.nl >>>> on behalf of "Jörn M. Horschig" >>>> >>>> Sent: Monday, 31 March 2014 10:24 PM >>>> To: FieldTrip discussion list >>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>> ft_sourceplot >>>> >>>> Hi Tyler, >>>> >>>> there is not much inherently different between time- and >>>> freuqency-domain beamformer, at least in terms of computing the forward >>>> and the inverse solution. But I see that you are obviously confused, so >>>> let me try to help you out and shed some light on what you are actually >>>> doing ;) >>>> >>>> >>>>> I had a look at my variables. >>>>> >>>>> source.avg = >>>>> >>>>> pow: [642x1 double] >>>>> filter: {642x1 cell} >>>>> >>>>> sourceInt.avg = >>>>> >>>>> pow: [16777216x1 double] >>>>> >>>>> So clearly, as both variables are completely different. Something >>>>> has gone wrong. >>>> No, that is actually how it should be. From below you can see that your >>>> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >>>> 16777216 elements. In line with source.avg.pow, you should see that your >>>> 'grid' consists of 642 elements, so you were computing your source >>>> activity on a grid of in total 642 elements. Then you used the original >>>> MRI to interpolate from 642 to these 16 million grid points. Actually, >>>> since you specific cfg.downsample = 2, it should have been only 8 >>>> million points, so that's where things already get a bit weird. >>>> >>>> So let's go into some sanity checks: >>>> 1. are you using the latest version (or a recent, i.e. from this year) >>>> of FielTrip? >>>> 2. sourceInt should look something like this, does it? >>>> >>>> source_diff_int = >>>> inside: [46x55x46 logical] >>>> avg: [1x1 struct] >>>> dim: [46 55 46] >>>> transform: [4x4 double] >>>> anatomy: [46x55x46 double] >>>> unit: 'mm' >>>> cfg: [1x1 struct] >>>> >>>> >>>> >>>> 3. source should look something like this: >>>> >>>> source = >>>> dim: [20 25 22] >>>> freq: 54.8287 >>>> cumtapcnt: [338x1 double] >>>> pos: [11000x3 double] >>>> inside: [1x5798 double] >>>> outside: [1x5202 double] >>>> method: 'average' >>>> avg: [1x1 struct] >>>> trialinfo: [338x1 double] >>>> cfg: [1x1 struct] >>>> >>>> 4. also check your grid, should be something like this: >>>> >>>> sourcemodel = >>>> >>>> pos: [11000x3 double] >>>> dim: [20 25 22] >>>> unit: 'cm' >>>> inside: [1x5798 double] >>>> outside: [1x5202 double] >>>> params: [1x1 struct] >>>> initial: [4x4 double] >>>> cfg: [1x1 struct] >>>> >>>> >>>> Of course, it should all look a bit different, because you are using >>>> LCMV, but essentially it should be the same. Lastly, you can check other >>>> source plotting methods, like 'ortho' or try to plot the source >>>> structure rather than the sourceInt structure. In the end, the error >>>> must be somewhere in your grid, be it in .pos or .inside, because >>>> FieldTrip thinks that there is only one voxel to be plotted. There are >>>> other things that may be the issue, but I am not sure about these. So, I >>>> would suggest that you play a bit around and see where the error might >>>> come from (e.g. follow this tutorial: >>>> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >>>> steps that you need for LCMV, maybe also check out: >>>> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >>>> >>>> there, LCMV is used, but on one voxel only) >>>> >>>> Best, >>>> Jörn >>>> >>>>> The next part of my code is the following: >>>>> >>>>> % interpolate sources >>>>> mri = ft_read_mri('Subject01.mri'); >>>>> mri = ft_volumereslice([], mri); >>>>> >>>>> cfg = []; >>>>> cfg.downsample = 2; >>>>> cfg.parameter = 'avg.pow'; >>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>> parameter >>>>> % does not vary over time, therefore the time >>>>> dimension is not needed. >>>>> >>>>> mri = >>>>> >>>>> anatomy: [256x256x256 double] >>>>> dim: [256 256 256] >>>>> transform: [4x4 double] >>>>> coordsys: 'ctf' >>>>> unit: 'mm' >>>>> cfg: [1x1 struct] >>>>> >>>>> I cant really see if the data works in the tutorial because it >>>>> doesnt appear as though fieldtrip has a tutorial on lcmv >>>>> beamformers, they seem to stick to frequency domain beamformers. >>>>> >>>>> Ive been wrong before though, >>>>> >>>>> thanks for your help. >>>>> >>>>> Tyler >>>>> >>>>> ************************* >>>>> >>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>> PhD Candidate >>>>> Brain Signals Laboratory >>>>> Flinders University >>>>> Rm 5A301 >>>>> Ext 66124 >>>>> >>>>> ________________________________________ >>>>> From: fieldtrip-bounces at science.ru.nl >>>>> on behalf of "Jörn M. Horschig" >>>>> >>>>> Sent: Monday, 31 March 2014 7:13 PM >>>>> To: FieldTrip discussion list >>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>> ft_sourceplot >>>>> >>>>> Hi Tyler, >>>>> >>>>> hm, okay, it could be that the issue with the leadfield and with the >>>>> plot are related, but it could also be that they are separate issues. I >>>>> just saw that you posted the same 'problem' on bugzilla and included a >>>>> picture. Maybe for next time, include a picture on the mailinglist and >>>>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>>>> and not if you are not sure. That saves us a lot of time in separating >>>>> code issues from user problems ;) >>>>> >>>>> So, back to you problem. It seems that your reconstruction results in >>>>> one voxel only. Are you sure that your grid consistents of more than >>>>> just one position? So, for example check the size of the matrices in >>>>> source.avg, source- and headmodel, etc. >>>>> >>>>> Also, you can check in Matlab the respective fields of source and >>>>> sourceInt and see whether that makes sense. >>>>> >>>>> Lastly, a neat way to check is always to use your code on data from the >>>>> tutorial, and vice versa, use code from the tutorial on your data and >>>>> see whether that works. Both should give sensible results, and if one >>>>> does not, you know where to start looking for a solution ;) >>>>> >>>>> Best, >>>>> Jörn >>>>> >>>>> >>>>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>>>> Hey Jorn, >>>>>> >>>>>> Previously I have let ft_sourceanalysis do a lead field because if >>>>>> I use the following code: >>>>>> >>>>>> % compute lead field ( apparently source analysis computes >>>>>> % lead field anyway >>>>>> cfg = []; >>>>>> cfg.elec = timelock.elec; >>>>>> cfg.vol = vol; >>>>>> cfg.reducerank = 3; >>>>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>>>> cm resolution >>>>>> cfg.grid.unit = 'cm'; >>>>>> cfg.normalize = 'yes'; % if you are not >>>>>> contrasting the activity of interest again another condition or >>>>>> baseline time-window >>>>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>>>> I AM UP TO >>>>>> >>>>>> and then calculate the source analysis: >>>>>> >>>>>> % Source Analysis: without contrasting condition >>>>>> cfg = []; >>>>>> cfg.method = 'lcmv'; >>>>>> cfg.grid = grid; >>>>>> cfg.vol = vol; >>>>>> % cfg.grid.pos = maxpos; >>>>>> cfg.keepfilter = 'yes'; >>>>>> cfg.dics.projectnoise = 'yes'; >>>>>> % cfg.dics.lambda = 0; >>>>>> source = ft_sourceanalysis( cfg, timelock); >>>>>> >>>>>> then I get an error than says: >>>>>> >>>>>> Error using * >>>>>> Inner matrix dimensions must agree. >>>>>> >>>>>> Error in beamformer_lcmv (line 268) >>>>>> filt = pinv(lf' * invCy * lf) * lf' * >>>>>> invCy; % van Veen eqn. 23, use >>>>>> PINV/SVD to cover rank deficient leadfield >>>>>> >>>>>> Error in ft_sourceanalysis (line 794) >>>>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>>>> optarg{:}); >>>>>> >>>>>> I just removed the leadfield code and it successfully ran. I could >>>>>> also interpolate it later. >>>>>> Is this the correct approach. >>>>>> >>>>>> Thankyou in advance! >>>>>> >>>>>> Tyler >>>>>> >>>>>> ************************* >>>>>> >>>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>>> PhD Candidate >>>>>> Brain Signals Laboratory >>>>>> Flinders University >>>>>> Rm 5A301 >>>>>> Ext 66124 >>>>>> >>>>>> ________________________________________ >>>>>> From: fieldtrip-bounces at science.ru.nl >>>>>> on behalf of "Jörn M. Horschig" >>>>>> >>>>>> Sent: Monday, 31 March 2014 5:30 PM >>>>>> To: FieldTrip discussion list >>>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>>> ft_sourceplot >>>>>> >>>>>> Hi Tyler, >>>>>> >>>>>> what you are describing sounds to me like the center bias of the >>>>>> beamformer. Did you contrast the activity with anything, or did you >>>>>> normalize your leadfield? >>>>>> Check this out: >>>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>>>> >>>>>> >>>>>> Best, >>>>>> Jörn >>>>>> >>>>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>>>> I have been trying to plot my interpolated source data using the >>>>>>> code: >>>>>>> >>>>>>> % interpolate sources >>>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>>> mri = ft_volumereslice([], mri); >>>>>>> cfg = []; >>>>>>> cfg.downsample = 2; >>>>>>> cfg.parameter = 'avg.pow'; >>>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>>> parameter >>>>>>> % does not vary over time, therefore the time >>>>>>> dimension >>>>>>> is not needed. >>>>>>> >>>>>>> % Plot interpolated data >>>>>>> cfg = []; %#ok >>>>>>> cfg.method = 'ortho'; % spline >>>>>>> cfg.funparameter = 'avg.pow'; >>>>>>> ft_sourceplot( cfg, sourceInt); >>>>>>> >>>>>>> However the figure that comes up just had orange squares in the >>>>>>> subplots. >>>>>>> >>>>>>> I dont know where Ive gone wrong. >>>>>>> >>>>>>> >>>>>>> Tyler >>>>>>> >>>>>>> >>>>>>> ************************* >>>>>>> >>>>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>>>> /PhD Candidate/ >>>>>>> /Brain Signals Laboratory/ >>>>>>> /Flinders University/ >>>>>>> /Rm 5A301/ >>>>>>> /Ext 66124/ >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> -- >>>>>> Jörn M. Horschig >>>>>> PhD Student >>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>> Centre for Cognitive Neuroimaging >>>>>> Radboud University Nijmegen >>>>>> Neuronal Oscillations Group >>>>>> FieldTrip Development Team >>>>>> >>>>>> P.O. Box 9101 >>>>>> NL-6500 HB Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> Contact: >>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>> Tel: +31-(0)24-36-68493 >>>>>> Web: http://www.ru.nl/donders >>>>>> >>>>>> Visiting address: >>>>>> Trigon, room 2.30 >>>>>> Kapittelweg 29 >>>>>> NL-6525 EN Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> -- >>>>> Jörn M. Horschig >>>>> PhD Student >>>>> Donders Institute for Brain, Cognition and Behaviour >>>>> Centre for Cognitive Neuroimaging >>>>> Radboud University Nijmegen >>>>> Neuronal Oscillations Group >>>>> FieldTrip Development Team >>>>> >>>>> P.O. Box 9101 >>>>> NL-6500 HB Nijmegen >>>>> The Netherlands >>>>> >>>>> Contact: >>>>> E-Mail: jm.horschig at donders.ru.nl >>>>> Tel: +31-(0)24-36-68493 >>>>> Web: http://www.ru.nl/donders >>>>> >>>>> Visiting address: >>>>> Trigon, room 2.30 >>>>> Kapittelweg 29 >>>>> NL-6525 EN Nijmegen >>>>> The Netherlands >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> -- >>>> Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From gopalar.ccf at gmail.com Tue Apr 1 21:31:35 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Tue, 1 Apr 2014 15:31:35 -0400 Subject: [FieldTrip] Source statistics on spatio-temporal source reconstruction data (MNE) Message-ID: Dear all, I saw a lot of discussion about source grand average and source statistics on Spatio-temporal MNE source data in the forum, however the last major discussion was in june 2013 http://mailman.science.ru.nl/pipermail/fieldtrip/2013-June/006684.html I was wondering if any major updates have been done to fieldtrip to tackle this issue since then. I also see a bug report on this issue. http://bugzilla.fcdonders.nl/show_bug.cgi?id=2185 It would be great if someone can revive this discussion with some new information. Thanks vey much Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Apr 1 22:34:18 2014 From: jm.horschig at donders.ru.nl (=?windows-1252?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 01 Apr 2014 22:34:18 +0200 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>, <533985D8.4080504@donders.ru.nl> <533AD84B.6060600@donders.ru.nl> Message-ID: <533B22CA.8040305@donders.ru.nl> Hi Robert, yes, I thought so, that's why I put it on the agenda for tomorrow's meeting to discuss in more detail to figure out what needs to be done :) Best, Jörn On 4/1/2014 7:19 PM, Robert Oostenveld wrote: > Hi Jorn > > I was browsing the FT list and see that you got involved with this question from Tyler. I can imagine there being problems with a pipeline like this > > preprocessing -> componentanalysis -> timelockanalysis -> dipolefitting > > although it should (i.e. "is meant to") work by fitting dipoles to component topographies. But the code is not frequently used like this and it might be possible that there has been regression of the code (i.e bugs in the latest version that were not there before). > > With sourceanalysis it depends on the method. Covariance estimates between components does not make much sense in the further inversion, and thereby beamforming won’t work. MNE should in principle work, but not with an estimated data covariance but rather a scaled identity covariance. > > Given the uncertain level of support , but clear expectations on what should (and should not) work, I suggest to file it as “bug” (i.e. the issue is that it should be tested) and to write a test script that goes (with e.g. some simulated data) over the various options. > > best regards, > Robert > > > On 01 Apr 2014, at 17:16, Jörn M. Horschig wrote: > >> Hi Tyler, >> >> any reason why you don't want to go back to sensor-space but stay in component-space with your data? I would assume that the error will be gone if you use the back-projected data (ft_rejectcomponent, with cfg.component = []). >> >> Best, >> Jörn >> >> On 4/1/2014 8:15 AM, Tyler Grummett wrote: >>> Hey Jorn, >>> >>> In addition to my previous emails, Ive been trying to debug the functions. >>> >>> In ft_sourceanalysis, line 661 to 677: >>> >>> % HACK: use the default code >>> % select the channels of interest >>> [dum, datchanindx] = match_str(cfg.channel, data.label); >>> if strcmp(data.dimord, 'chan_time') >>> % It is in principle possible to have timelockanalysis with >>> % keeptrial=yes and only a single trial in the raw data. >>> % In that case the covariance should be represented as Nchan*Nchan >>> data.avg = data.avg(datchanindx,:); >>> %data.cov = reshape(data.cov, length(datchanindx), length(datchanindx)); >>> data.cov = data.cov(datchanindx,datchanindx); >>> else >>> data.avg = data.avg(datchanindx,:); >>> data.cov = data.cov(:,datchanindx,datchanindx); >>> data.trial = data.trial(:,datchanindx,:); >>> end >>> data.label = data.label(datchanindx); >>> Nchans = length(data.label); >>> >>> I found that my cfg.channel is []; and the data.label is all my ICA components labelled ica_001 etc. >>> >>> So it is returned as a []; >>> which means data.cov = []; >>> >>> I think then it will crash later parts of the code. Does this function work on ICA components? >>> >>> I ran the ICA in eeglab. >>> >>> Tyler. >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" >>> Sent: Tuesday, 1 April 2014 1:42 AM >>> To: fieldtrip at science.ru.nl >>> Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot >>> >>> just to clarify and be precise >>>> The pos-matrix has to be a regular 3D grid, i.e. be representable as a >>>> 3x3x3 matrix. >>> it actually does not have to be as you can also beam individual grid >>> points, but if you have a .dim field, then is has to be like above. But >>> that does not affect the rest of the mail I wrote ;) >>> >>> >>>> I am not quite sure how the sourceinterpolate function is handeling >>>> the fact that you do not have that .dim field. Apparently, it is also >>>> confused ;) >>>> >>>> Do you want to reconstruct only some voxels? From your code it seems >>>> that you want to cover the whole brain with a 1cm resolution. If the >>>> latter is the case, maybe restart with creating your forward model by >>>> following the tutorial that I posted in my previous mail. There are >>>> some sanity checks that can help you figuring out if you are doing the >>>> correct thing. If the former one is the case, please explain again >>>> what exactly you want to achieve and how you are building your forward >>>> model. >>>> >>>> Best, >>>> Jörn >>>> >>>> btw, there's nothing wrong with being a PhD student, it's just a >>>> matter of experience in practice and theory as in all domains in life ;) >>>> >>>> >>>> On 3/31/2014 3:15 PM, Tyler Grummett wrote: >>>>> Hey Jorn, >>>>> >>>>> Yes I am definitely confused haha, this stuff is way out of my league >>>>> as a PhD student. >>>>> Anyway, I feel we are getting somewhere. >>>>> >>>>> timelock = >>>>> >>>>> avg: [121x19767 double] >>>>> var: [121x19767 double] >>>>> time: [1x19767 double] >>>>> dof: [121x19767 double] >>>>> label: {1x121 cell} >>>>> dimord: 'chan_time' >>>>> cov: [121x121 double] >>>>> elec: [1x1 struct] >>>>> cfg: [1x1 struct] >>>>> >>>>> source = >>>>> >>>>> time: [1x19767 double] >>>>> pos: [642x3 double] >>>>> inside: [642x1 double] >>>>> outside: [] >>>>> method: 'average' >>>>> avg: [1x1 struct] >>>>> cfg: [1x1 struct] >>>>> >>>>> sourceInt = >>>>> >>>>> time: [1x19767 double] >>>>> avg: [1x1 struct] >>>>> pos: [16777216x3 double] >>>>> dim: [256 256 256] >>>>> inside: [1x16777216 double] >>>>> outside: [1x0 double] >>>>> coordsys: 'ctf' >>>>> unit: 'mm' >>>>> cfg: [1x1 struct] >>>>> >>>>> Given what I said last time, I might not comment on the differences. >>>>> I hope you can see something wrong. >>>>> >>>>> One thing I should mention is that the data is continuous, around 30 >>>>> seconds. Therefore there is only one trial, >>>>> is that an issue? >>>>> >>>>> Tyler >>>>> >>>>> ************************* >>>>> >>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>> PhD Candidate >>>>> Brain Signals Laboratory >>>>> Flinders University >>>>> Rm 5A301 >>>>> Ext 66124 >>>>> >>>>> ________________________________________ >>>>> From: fieldtrip-bounces at science.ru.nl >>>>> on behalf of "Jörn M. Horschig" >>>>> >>>>> Sent: Monday, 31 March 2014 10:24 PM >>>>> To: FieldTrip discussion list >>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>> ft_sourceplot >>>>> >>>>> Hi Tyler, >>>>> >>>>> there is not much inherently different between time- and >>>>> freuqency-domain beamformer, at least in terms of computing the forward >>>>> and the inverse solution. But I see that you are obviously confused, so >>>>> let me try to help you out and shed some light on what you are actually >>>>> doing ;) >>>>> >>>>> >>>>>> I had a look at my variables. >>>>>> >>>>>> source.avg = >>>>>> >>>>>> pow: [642x1 double] >>>>>> filter: {642x1 cell} >>>>>> >>>>>> sourceInt.avg = >>>>>> >>>>>> pow: [16777216x1 double] >>>>>> >>>>>> So clearly, as both variables are completely different. Something >>>>>> has gone wrong. >>>>> No, that is actually how it should be. From below you can see that your >>>>> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >>>>> 16777216 elements. In line with source.avg.pow, you should see that your >>>>> 'grid' consists of 642 elements, so you were computing your source >>>>> activity on a grid of in total 642 elements. Then you used the original >>>>> MRI to interpolate from 642 to these 16 million grid points. Actually, >>>>> since you specific cfg.downsample = 2, it should have been only 8 >>>>> million points, so that's where things already get a bit weird. >>>>> >>>>> So let's go into some sanity checks: >>>>> 1. are you using the latest version (or a recent, i.e. from this year) >>>>> of FielTrip? >>>>> 2. sourceInt should look something like this, does it? >>>>> >>>>> source_diff_int = >>>>> inside: [46x55x46 logical] >>>>> avg: [1x1 struct] >>>>> dim: [46 55 46] >>>>> transform: [4x4 double] >>>>> anatomy: [46x55x46 double] >>>>> unit: 'mm' >>>>> cfg: [1x1 struct] >>>>> >>>>> >>>>> >>>>> 3. source should look something like this: >>>>> >>>>> source = >>>>> dim: [20 25 22] >>>>> freq: 54.8287 >>>>> cumtapcnt: [338x1 double] >>>>> pos: [11000x3 double] >>>>> inside: [1x5798 double] >>>>> outside: [1x5202 double] >>>>> method: 'average' >>>>> avg: [1x1 struct] >>>>> trialinfo: [338x1 double] >>>>> cfg: [1x1 struct] >>>>> >>>>> 4. also check your grid, should be something like this: >>>>> >>>>> sourcemodel = >>>>> >>>>> pos: [11000x3 double] >>>>> dim: [20 25 22] >>>>> unit: 'cm' >>>>> inside: [1x5798 double] >>>>> outside: [1x5202 double] >>>>> params: [1x1 struct] >>>>> initial: [4x4 double] >>>>> cfg: [1x1 struct] >>>>> >>>>> >>>>> Of course, it should all look a bit different, because you are using >>>>> LCMV, but essentially it should be the same. Lastly, you can check other >>>>> source plotting methods, like 'ortho' or try to plot the source >>>>> structure rather than the sourceInt structure. In the end, the error >>>>> must be somewhere in your grid, be it in .pos or .inside, because >>>>> FieldTrip thinks that there is only one voxel to be plotted. There are >>>>> other things that may be the issue, but I am not sure about these. So, I >>>>> would suggest that you play a bit around and see where the error might >>>>> come from (e.g. follow this tutorial: >>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >>>>> steps that you need for LCMV, maybe also check out: >>>>> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >>>>> >>>>> there, LCMV is used, but on one voxel only) >>>>> >>>>> Best, >>>>> Jörn >>>>> >>>>>> The next part of my code is the following: >>>>>> >>>>>> % interpolate sources >>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>> mri = ft_volumereslice([], mri); >>>>>> >>>>>> cfg = []; >>>>>> cfg.downsample = 2; >>>>>> cfg.parameter = 'avg.pow'; >>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>> parameter >>>>>> % does not vary over time, therefore the time >>>>>> dimension is not needed. >>>>>> >>>>>> mri = >>>>>> >>>>>> anatomy: [256x256x256 double] >>>>>> dim: [256 256 256] >>>>>> transform: [4x4 double] >>>>>> coordsys: 'ctf' >>>>>> unit: 'mm' >>>>>> cfg: [1x1 struct] >>>>>> >>>>>> I cant really see if the data works in the tutorial because it >>>>>> doesnt appear as though fieldtrip has a tutorial on lcmv >>>>>> beamformers, they seem to stick to frequency domain beamformers. >>>>>> >>>>>> Ive been wrong before though, >>>>>> >>>>>> thanks for your help. >>>>>> >>>>>> Tyler >>>>>> >>>>>> ************************* >>>>>> >>>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>>> PhD Candidate >>>>>> Brain Signals Laboratory >>>>>> Flinders University >>>>>> Rm 5A301 >>>>>> Ext 66124 >>>>>> >>>>>> ________________________________________ >>>>>> From: fieldtrip-bounces at science.ru.nl >>>>>> on behalf of "Jörn M. Horschig" >>>>>> >>>>>> Sent: Monday, 31 March 2014 7:13 PM >>>>>> To: FieldTrip discussion list >>>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>>> ft_sourceplot >>>>>> >>>>>> Hi Tyler, >>>>>> >>>>>> hm, okay, it could be that the issue with the leadfield and with the >>>>>> plot are related, but it could also be that they are separate issues. I >>>>>> just saw that you posted the same 'problem' on bugzilla and included a >>>>>> picture. Maybe for next time, include a picture on the mailinglist and >>>>>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>>>>> and not if you are not sure. That saves us a lot of time in separating >>>>>> code issues from user problems ;) >>>>>> >>>>>> So, back to you problem. It seems that your reconstruction results in >>>>>> one voxel only. Are you sure that your grid consistents of more than >>>>>> just one position? So, for example check the size of the matrices in >>>>>> source.avg, source- and headmodel, etc. >>>>>> >>>>>> Also, you can check in Matlab the respective fields of source and >>>>>> sourceInt and see whether that makes sense. >>>>>> >>>>>> Lastly, a neat way to check is always to use your code on data from the >>>>>> tutorial, and vice versa, use code from the tutorial on your data and >>>>>> see whether that works. Both should give sensible results, and if one >>>>>> does not, you know where to start looking for a solution ;) >>>>>> >>>>>> Best, >>>>>> Jörn >>>>>> >>>>>> >>>>>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>>>>> Hey Jorn, >>>>>>> >>>>>>> Previously I have let ft_sourceanalysis do a lead field because if >>>>>>> I use the following code: >>>>>>> >>>>>>> % compute lead field ( apparently source analysis computes >>>>>>> % lead field anyway >>>>>>> cfg = []; >>>>>>> cfg.elec = timelock.elec; >>>>>>> cfg.vol = vol; >>>>>>> cfg.reducerank = 3; >>>>>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>>>>> cm resolution >>>>>>> cfg.grid.unit = 'cm'; >>>>>>> cfg.normalize = 'yes'; % if you are not >>>>>>> contrasting the activity of interest again another condition or >>>>>>> baseline time-window >>>>>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>>>>> I AM UP TO >>>>>>> >>>>>>> and then calculate the source analysis: >>>>>>> >>>>>>> % Source Analysis: without contrasting condition >>>>>>> cfg = []; >>>>>>> cfg.method = 'lcmv'; >>>>>>> cfg.grid = grid; >>>>>>> cfg.vol = vol; >>>>>>> % cfg.grid.pos = maxpos; >>>>>>> cfg.keepfilter = 'yes'; >>>>>>> cfg.dics.projectnoise = 'yes'; >>>>>>> % cfg.dics.lambda = 0; >>>>>>> source = ft_sourceanalysis( cfg, timelock); >>>>>>> >>>>>>> then I get an error than says: >>>>>>> >>>>>>> Error using * >>>>>>> Inner matrix dimensions must agree. >>>>>>> >>>>>>> Error in beamformer_lcmv (line 268) >>>>>>> filt = pinv(lf' * invCy * lf) * lf' * >>>>>>> invCy; % van Veen eqn. 23, use >>>>>>> PINV/SVD to cover rank deficient leadfield >>>>>>> >>>>>>> Error in ft_sourceanalysis (line 794) >>>>>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>>>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>>>>> optarg{:}); >>>>>>> >>>>>>> I just removed the leadfield code and it successfully ran. I could >>>>>>> also interpolate it later. >>>>>>> Is this the correct approach. >>>>>>> >>>>>>> Thankyou in advance! >>>>>>> >>>>>>> Tyler >>>>>>> >>>>>>> ************************* >>>>>>> >>>>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>>>> PhD Candidate >>>>>>> Brain Signals Laboratory >>>>>>> Flinders University >>>>>>> Rm 5A301 >>>>>>> Ext 66124 >>>>>>> >>>>>>> ________________________________________ >>>>>>> From: fieldtrip-bounces at science.ru.nl >>>>>>> on behalf of "Jörn M. Horschig" >>>>>>> >>>>>>> Sent: Monday, 31 March 2014 5:30 PM >>>>>>> To: FieldTrip discussion list >>>>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>>>> ft_sourceplot >>>>>>> >>>>>>> Hi Tyler, >>>>>>> >>>>>>> what you are describing sounds to me like the center bias of the >>>>>>> beamformer. Did you contrast the activity with anything, or did you >>>>>>> normalize your leadfield? >>>>>>> Check this out: >>>>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>>>>> >>>>>>> >>>>>>> Best, >>>>>>> Jörn >>>>>>> >>>>>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>>>>> I have been trying to plot my interpolated source data using the >>>>>>>> code: >>>>>>>> >>>>>>>> % interpolate sources >>>>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>>>> mri = ft_volumereslice([], mri); >>>>>>>> cfg = []; >>>>>>>> cfg.downsample = 2; >>>>>>>> cfg.parameter = 'avg.pow'; >>>>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>>>> parameter >>>>>>>> % does not vary over time, therefore the time >>>>>>>> dimension >>>>>>>> is not needed. >>>>>>>> >>>>>>>> % Plot interpolated data >>>>>>>> cfg = []; %#ok >>>>>>>> cfg.method = 'ortho'; % spline >>>>>>>> cfg.funparameter = 'avg.pow'; >>>>>>>> ft_sourceplot( cfg, sourceInt); >>>>>>>> >>>>>>>> However the figure that comes up just had orange squares in the >>>>>>>> subplots. >>>>>>>> >>>>>>>> I dont know where Ive gone wrong. >>>>>>>> >>>>>>>> >>>>>>>> Tyler >>>>>>>> >>>>>>>> >>>>>>>> ************************* >>>>>>>> >>>>>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>>>>> /PhD Candidate/ >>>>>>>> /Brain Signals Laboratory/ >>>>>>>> /Flinders University/ >>>>>>>> /Rm 5A301/ >>>>>>>> /Ext 66124/ >>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> fieldtrip mailing list >>>>>>>> fieldtrip at donders.ru.nl >>>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> -- >>>>>>> Jörn M. Horschig >>>>>>> PhD Student >>>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>>> Centre for Cognitive Neuroimaging >>>>>>> Radboud University Nijmegen >>>>>>> Neuronal Oscillations Group >>>>>>> FieldTrip Development Team >>>>>>> >>>>>>> P.O. Box 9101 >>>>>>> NL-6500 HB Nijmegen >>>>>>> The Netherlands >>>>>>> >>>>>>> Contact: >>>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>>> Tel: +31-(0)24-36-68493 >>>>>>> Web: http://www.ru.nl/donders >>>>>>> >>>>>>> Visiting address: >>>>>>> Trigon, room 2.30 >>>>>>> Kapittelweg 29 >>>>>>> NL-6525 EN Nijmegen >>>>>>> The Netherlands >>>>>>> >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> -- >>>>>> Jörn M. Horschig >>>>>> PhD Student >>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>> Centre for Cognitive Neuroimaging >>>>>> Radboud University Nijmegen >>>>>> Neuronal Oscillations Group >>>>>> FieldTrip Development Team >>>>>> >>>>>> P.O. Box 9101 >>>>>> NL-6500 HB Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> Contact: >>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>> Tel: +31-(0)24-36-68493 >>>>>> Web: http://www.ru.nl/donders >>>>>> >>>>>> Visiting address: >>>>>> Trigon, room 2.30 >>>>>> Kapittelweg 29 >>>>>> NL-6525 EN Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> -- >>>>> Jörn M. Horschig >>>>> PhD Student >>>>> Donders Institute for Brain, Cognition and Behaviour >>>>> Centre for Cognitive Neuroimaging >>>>> Radboud University Nijmegen >>>>> Neuronal Oscillations Group >>>>> FieldTrip Development Team >>>>> >>>>> P.O. Box 9101 >>>>> NL-6500 HB Nijmegen >>>>> The Netherlands >>>>> >>>>> Contact: >>>>> E-Mail: jm.horschig at donders.ru.nl >>>>> Tel: +31-(0)24-36-68493 >>>>> Web: http://www.ru.nl/donders >>>>> >>>>> Visiting address: >>>>> Trigon, room 2.30 >>>>> Kapittelweg 29 >>>>> NL-6525 EN Nijmegen >>>>> The Netherlands >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From tyler.grummett at flinders.edu.au Tue Apr 1 23:06:40 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 1 Apr 2014 21:06:40 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <533B22CA.8040305@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>, <533985D8.4080504@donders.ru.nl> <533AD84B.6060600@donders.ru.nl> , <533B22CA.8040305@donders.ru.nl> Message-ID: Hello jorn and robert, The plan is to use the data for functional connectivity. The only alternative we seem to have is dipole fitting in eeglab and then clustering. However we thought that if we used beamformer we would have many more sources to be able to run functional connectivity algorithms. I'm sorry of this has become an issue, what do you advise? Tyler > On 2 Apr 2014, at 7:06 am, "Jörn M. Horschig" wrote: > > Hi Robert, > > yes, I thought so, that's why I put it on the agenda for tomorrow's meeting to discuss in more detail to figure out what needs to be done :) > > Best, > Jörn > >> On 4/1/2014 7:19 PM, Robert Oostenveld wrote: >> Hi Jorn >> >> I was browsing the FT list and see that you got involved with this question from Tyler. I can imagine there being problems with a pipeline like this >> >> preprocessing -> componentanalysis -> timelockanalysis -> dipolefitting >> >> although it should (i.e. "is meant to") work by fitting dipoles to component topographies. But the code is not frequently used like this and it might be possible that there has been regression of the code (i.e bugs in the latest version that were not there before). >> >> With sourceanalysis it depends on the method. Covariance estimates between components does not make much sense in the further inversion, and thereby beamforming won’t work. MNE should in principle work, but not with an estimated data covariance but rather a scaled identity covariance. >> >> Given the uncertain level of support , but clear expectations on what should (and should not) work, I suggest to file it as “bug” (i.e. the issue is that it should be tested) and to write a test script that goes (with e.g. some simulated data) over the various options. >> >> best regards, >> Robert >> >>> On 01 Apr 2014, at 17:16, Jörn M. Horschig wrote: >>> >>> Hi Tyler, >>> >>> any reason why you don't want to go back to sensor-space but stay in component-space with your data? I would assume that the error will be gone if you use the back-projected data (ft_rejectcomponent, with cfg.component = []). >>> >>> Best, >>> Jörn >>> >>>> On 4/1/2014 8:15 AM, Tyler Grummett wrote: >>>> Hey Jorn, >>>> >>>> In addition to my previous emails, Ive been trying to debug the functions. >>>> >>>> In ft_sourceanalysis, line 661 to 677: >>>> >>>> % HACK: use the default code >>>> % select the channels of interest >>>> [dum, datchanindx] = match_str(cfg.channel, data.label); >>>> if strcmp(data.dimord, 'chan_time') >>>> % It is in principle possible to have timelockanalysis with >>>> % keeptrial=yes and only a single trial in the raw data. >>>> % In that case the covariance should be represented as Nchan*Nchan >>>> data.avg = data.avg(datchanindx,:); >>>> %data.cov = reshape(data.cov, length(datchanindx), length(datchanindx)); >>>> data.cov = data.cov(datchanindx,datchanindx); >>>> else >>>> data.avg = data.avg(datchanindx,:); >>>> data.cov = data.cov(:,datchanindx,datchanindx); >>>> data.trial = data.trial(:,datchanindx,:); >>>> end >>>> data.label = data.label(datchanindx); >>>> Nchans = length(data.label); >>>> >>>> I found that my cfg.channel is []; and the data.label is all my ICA components labelled ica_001 etc. >>>> >>>> So it is returned as a []; >>>> which means data.cov = []; >>>> >>>> I think then it will crash later parts of the code. Does this function work on ICA components? >>>> >>>> I ran the ICA in eeglab. >>>> >>>> Tyler. >>>> >>>> ************************* >>>> >>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>> PhD Candidate >>>> Brain Signals Laboratory >>>> Flinders University >>>> Rm 5A301 >>>> Ext 66124 >>>> >>>> ________________________________________ >>>> From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" >>>> Sent: Tuesday, 1 April 2014 1:42 AM >>>> To: fieldtrip at science.ru.nl >>>> Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot >>>> >>>> just to clarify and be precise >>>>> The pos-matrix has to be a regular 3D grid, i.e. be representable as a >>>>> 3x3x3 matrix. >>>> it actually does not have to be as you can also beam individual grid >>>> points, but if you have a .dim field, then is has to be like above. But >>>> that does not affect the rest of the mail I wrote ;) >>>> >>>> >>>>> I am not quite sure how the sourceinterpolate function is handeling >>>>> the fact that you do not have that .dim field. Apparently, it is also >>>>> confused ;) >>>>> >>>>> Do you want to reconstruct only some voxels? From your code it seems >>>>> that you want to cover the whole brain with a 1cm resolution. If the >>>>> latter is the case, maybe restart with creating your forward model by >>>>> following the tutorial that I posted in my previous mail. There are >>>>> some sanity checks that can help you figuring out if you are doing the >>>>> correct thing. If the former one is the case, please explain again >>>>> what exactly you want to achieve and how you are building your forward >>>>> model. >>>>> >>>>> Best, >>>>> Jörn >>>>> >>>>> btw, there's nothing wrong with being a PhD student, it's just a >>>>> matter of experience in practice and theory as in all domains in life ;) >>>>> >>>>> >>>>>> On 3/31/2014 3:15 PM, Tyler Grummett wrote: >>>>>> Hey Jorn, >>>>>> >>>>>> Yes I am definitely confused haha, this stuff is way out of my league >>>>>> as a PhD student. >>>>>> Anyway, I feel we are getting somewhere. >>>>>> >>>>>> timelock = >>>>>> >>>>>> avg: [121x19767 double] >>>>>> var: [121x19767 double] >>>>>> time: [1x19767 double] >>>>>> dof: [121x19767 double] >>>>>> label: {1x121 cell} >>>>>> dimord: 'chan_time' >>>>>> cov: [121x121 double] >>>>>> elec: [1x1 struct] >>>>>> cfg: [1x1 struct] >>>>>> >>>>>> source = >>>>>> >>>>>> time: [1x19767 double] >>>>>> pos: [642x3 double] >>>>>> inside: [642x1 double] >>>>>> outside: [] >>>>>> method: 'average' >>>>>> avg: [1x1 struct] >>>>>> cfg: [1x1 struct] >>>>>> >>>>>> sourceInt = >>>>>> >>>>>> time: [1x19767 double] >>>>>> avg: [1x1 struct] >>>>>> pos: [16777216x3 double] >>>>>> dim: [256 256 256] >>>>>> inside: [1x16777216 double] >>>>>> outside: [1x0 double] >>>>>> coordsys: 'ctf' >>>>>> unit: 'mm' >>>>>> cfg: [1x1 struct] >>>>>> >>>>>> Given what I said last time, I might not comment on the differences. >>>>>> I hope you can see something wrong. >>>>>> >>>>>> One thing I should mention is that the data is continuous, around 30 >>>>>> seconds. Therefore there is only one trial, >>>>>> is that an issue? >>>>>> >>>>>> Tyler >>>>>> >>>>>> ************************* >>>>>> >>>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>>> PhD Candidate >>>>>> Brain Signals Laboratory >>>>>> Flinders University >>>>>> Rm 5A301 >>>>>> Ext 66124 >>>>>> >>>>>> ________________________________________ >>>>>> From: fieldtrip-bounces at science.ru.nl >>>>>> on behalf of "Jörn M. Horschig" >>>>>> >>>>>> Sent: Monday, 31 March 2014 10:24 PM >>>>>> To: FieldTrip discussion list >>>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>>> ft_sourceplot >>>>>> >>>>>> Hi Tyler, >>>>>> >>>>>> there is not much inherently different between time- and >>>>>> freuqency-domain beamformer, at least in terms of computing the forward >>>>>> and the inverse solution. But I see that you are obviously confused, so >>>>>> let me try to help you out and shed some light on what you are actually >>>>>> doing ;) >>>>>> >>>>>> >>>>>>> I had a look at my variables. >>>>>>> >>>>>>> source.avg = >>>>>>> >>>>>>> pow: [642x1 double] >>>>>>> filter: {642x1 cell} >>>>>>> >>>>>>> sourceInt.avg = >>>>>>> >>>>>>> pow: [16777216x1 double] >>>>>>> >>>>>>> So clearly, as both variables are completely different. Something >>>>>>> has gone wrong. >>>>>> No, that is actually how it should be. From below you can see that your >>>>>> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >>>>>> 16777216 elements. In line with source.avg.pow, you should see that your >>>>>> 'grid' consists of 642 elements, so you were computing your source >>>>>> activity on a grid of in total 642 elements. Then you used the original >>>>>> MRI to interpolate from 642 to these 16 million grid points. Actually, >>>>>> since you specific cfg.downsample = 2, it should have been only 8 >>>>>> million points, so that's where things already get a bit weird. >>>>>> >>>>>> So let's go into some sanity checks: >>>>>> 1. are you using the latest version (or a recent, i.e. from this year) >>>>>> of FielTrip? >>>>>> 2. sourceInt should look something like this, does it? >>>>>> >>>>>> source_diff_int = >>>>>> inside: [46x55x46 logical] >>>>>> avg: [1x1 struct] >>>>>> dim: [46 55 46] >>>>>> transform: [4x4 double] >>>>>> anatomy: [46x55x46 double] >>>>>> unit: 'mm' >>>>>> cfg: [1x1 struct] >>>>>> >>>>>> >>>>>> >>>>>> 3. source should look something like this: >>>>>> >>>>>> source = >>>>>> dim: [20 25 22] >>>>>> freq: 54.8287 >>>>>> cumtapcnt: [338x1 double] >>>>>> pos: [11000x3 double] >>>>>> inside: [1x5798 double] >>>>>> outside: [1x5202 double] >>>>>> method: 'average' >>>>>> avg: [1x1 struct] >>>>>> trialinfo: [338x1 double] >>>>>> cfg: [1x1 struct] >>>>>> >>>>>> 4. also check your grid, should be something like this: >>>>>> >>>>>> sourcemodel = >>>>>> >>>>>> pos: [11000x3 double] >>>>>> dim: [20 25 22] >>>>>> unit: 'cm' >>>>>> inside: [1x5798 double] >>>>>> outside: [1x5202 double] >>>>>> params: [1x1 struct] >>>>>> initial: [4x4 double] >>>>>> cfg: [1x1 struct] >>>>>> >>>>>> >>>>>> Of course, it should all look a bit different, because you are using >>>>>> LCMV, but essentially it should be the same. Lastly, you can check other >>>>>> source plotting methods, like 'ortho' or try to plot the source >>>>>> structure rather than the sourceInt structure. In the end, the error >>>>>> must be somewhere in your grid, be it in .pos or .inside, because >>>>>> FieldTrip thinks that there is only one voxel to be plotted. There are >>>>>> other things that may be the issue, but I am not sure about these. So, I >>>>>> would suggest that you play a bit around and see where the error might >>>>>> come from (e.g. follow this tutorial: >>>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >>>>>> steps that you need for LCMV, maybe also check out: >>>>>> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >>>>>> >>>>>> there, LCMV is used, but on one voxel only) >>>>>> >>>>>> Best, >>>>>> Jörn >>>>>> >>>>>>> The next part of my code is the following: >>>>>>> >>>>>>> % interpolate sources >>>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>>> mri = ft_volumereslice([], mri); >>>>>>> >>>>>>> cfg = []; >>>>>>> cfg.downsample = 2; >>>>>>> cfg.parameter = 'avg.pow'; >>>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>>> parameter >>>>>>> % does not vary over time, therefore the time >>>>>>> dimension is not needed. >>>>>>> >>>>>>> mri = >>>>>>> >>>>>>> anatomy: [256x256x256 double] >>>>>>> dim: [256 256 256] >>>>>>> transform: [4x4 double] >>>>>>> coordsys: 'ctf' >>>>>>> unit: 'mm' >>>>>>> cfg: [1x1 struct] >>>>>>> >>>>>>> I cant really see if the data works in the tutorial because it >>>>>>> doesnt appear as though fieldtrip has a tutorial on lcmv >>>>>>> beamformers, they seem to stick to frequency domain beamformers. >>>>>>> >>>>>>> Ive been wrong before though, >>>>>>> >>>>>>> thanks for your help. >>>>>>> >>>>>>> Tyler >>>>>>> >>>>>>> ************************* >>>>>>> >>>>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>>>> PhD Candidate >>>>>>> Brain Signals Laboratory >>>>>>> Flinders University >>>>>>> Rm 5A301 >>>>>>> Ext 66124 >>>>>>> >>>>>>> ________________________________________ >>>>>>> From: fieldtrip-bounces at science.ru.nl >>>>>>> on behalf of "Jörn M. Horschig" >>>>>>> >>>>>>> Sent: Monday, 31 March 2014 7:13 PM >>>>>>> To: FieldTrip discussion list >>>>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>>>> ft_sourceplot >>>>>>> >>>>>>> Hi Tyler, >>>>>>> >>>>>>> hm, okay, it could be that the issue with the leadfield and with the >>>>>>> plot are related, but it could also be that they are separate issues. I >>>>>>> just saw that you posted the same 'problem' on bugzilla and included a >>>>>>> picture. Maybe for next time, include a picture on the mailinglist and >>>>>>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>>>>>> and not if you are not sure. That saves us a lot of time in separating >>>>>>> code issues from user problems ;) >>>>>>> >>>>>>> So, back to you problem. It seems that your reconstruction results in >>>>>>> one voxel only. Are you sure that your grid consistents of more than >>>>>>> just one position? So, for example check the size of the matrices in >>>>>>> source.avg, source- and headmodel, etc. >>>>>>> >>>>>>> Also, you can check in Matlab the respective fields of source and >>>>>>> sourceInt and see whether that makes sense. >>>>>>> >>>>>>> Lastly, a neat way to check is always to use your code on data from the >>>>>>> tutorial, and vice versa, use code from the tutorial on your data and >>>>>>> see whether that works. Both should give sensible results, and if one >>>>>>> does not, you know where to start looking for a solution ;) >>>>>>> >>>>>>> Best, >>>>>>> Jörn >>>>>>> >>>>>>> >>>>>>>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>>>>>> Hey Jorn, >>>>>>>> >>>>>>>> Previously I have let ft_sourceanalysis do a lead field because if >>>>>>>> I use the following code: >>>>>>>> >>>>>>>> % compute lead field ( apparently source analysis computes >>>>>>>> % lead field anyway >>>>>>>> cfg = []; >>>>>>>> cfg.elec = timelock.elec; >>>>>>>> cfg.vol = vol; >>>>>>>> cfg.reducerank = 3; >>>>>>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>>>>>> cm resolution >>>>>>>> cfg.grid.unit = 'cm'; >>>>>>>> cfg.normalize = 'yes'; % if you are not >>>>>>>> contrasting the activity of interest again another condition or >>>>>>>> baseline time-window >>>>>>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>>>>>> I AM UP TO >>>>>>>> >>>>>>>> and then calculate the source analysis: >>>>>>>> >>>>>>>> % Source Analysis: without contrasting condition >>>>>>>> cfg = []; >>>>>>>> cfg.method = 'lcmv'; >>>>>>>> cfg.grid = grid; >>>>>>>> cfg.vol = vol; >>>>>>>> % cfg.grid.pos = maxpos; >>>>>>>> cfg.keepfilter = 'yes'; >>>>>>>> cfg.dics.projectnoise = 'yes'; >>>>>>>> % cfg.dics.lambda = 0; >>>>>>>> source = ft_sourceanalysis( cfg, timelock); >>>>>>>> >>>>>>>> then I get an error than says: >>>>>>>> >>>>>>>> Error using * >>>>>>>> Inner matrix dimensions must agree. >>>>>>>> >>>>>>>> Error in beamformer_lcmv (line 268) >>>>>>>> filt = pinv(lf' * invCy * lf) * lf' * >>>>>>>> invCy; % van Veen eqn. 23, use >>>>>>>> PINV/SVD to cover rank deficient leadfield >>>>>>>> >>>>>>>> Error in ft_sourceanalysis (line 794) >>>>>>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>>>>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>>>>>> optarg{:}); >>>>>>>> >>>>>>>> I just removed the leadfield code and it successfully ran. I could >>>>>>>> also interpolate it later. >>>>>>>> Is this the correct approach. >>>>>>>> >>>>>>>> Thankyou in advance! >>>>>>>> >>>>>>>> Tyler >>>>>>>> >>>>>>>> ************************* >>>>>>>> >>>>>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>>>>> PhD Candidate >>>>>>>> Brain Signals Laboratory >>>>>>>> Flinders University >>>>>>>> Rm 5A301 >>>>>>>> Ext 66124 >>>>>>>> >>>>>>>> ________________________________________ >>>>>>>> From: fieldtrip-bounces at science.ru.nl >>>>>>>> on behalf of "Jörn M. Horschig" >>>>>>>> >>>>>>>> Sent: Monday, 31 March 2014 5:30 PM >>>>>>>> To: FieldTrip discussion list >>>>>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>>>>> ft_sourceplot >>>>>>>> >>>>>>>> Hi Tyler, >>>>>>>> >>>>>>>> what you are describing sounds to me like the center bias of the >>>>>>>> beamformer. Did you contrast the activity with anything, or did you >>>>>>>> normalize your leadfield? >>>>>>>> Check this out: >>>>>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>>>>>> >>>>>>>> >>>>>>>> Best, >>>>>>>> Jörn >>>>>>>> >>>>>>>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>>>>>> I have been trying to plot my interpolated source data using the >>>>>>>>> code: >>>>>>>>> >>>>>>>>> % interpolate sources >>>>>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>>>>> mri = ft_volumereslice([], mri); >>>>>>>>> cfg = []; >>>>>>>>> cfg.downsample = 2; >>>>>>>>> cfg.parameter = 'avg.pow'; >>>>>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>>>>> parameter >>>>>>>>> % does not vary over time, therefore the time >>>>>>>>> dimension >>>>>>>>> is not needed. >>>>>>>>> >>>>>>>>> % Plot interpolated data >>>>>>>>> cfg = []; %#ok >>>>>>>>> cfg.method = 'ortho'; % spline >>>>>>>>> cfg.funparameter = 'avg.pow'; >>>>>>>>> ft_sourceplot( cfg, sourceInt); >>>>>>>>> >>>>>>>>> However the figure that comes up just had orange squares in the >>>>>>>>> subplots. >>>>>>>>> >>>>>>>>> I dont know where Ive gone wrong. >>>>>>>>> >>>>>>>>> >>>>>>>>> Tyler >>>>>>>>> >>>>>>>>> >>>>>>>>> ************************* >>>>>>>>> >>>>>>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>>>>>> /PhD Candidate/ >>>>>>>>> /Brain Signals Laboratory/ >>>>>>>>> /Flinders University/ >>>>>>>>> /Rm 5A301/ >>>>>>>>> /Ext 66124/ >>>>>>>>> >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> fieldtrip mailing list >>>>>>>>> fieldtrip at donders.ru.nl >>>>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>>> -- >>>>>>>> Jörn M. Horschig >>>>>>>> PhD Student >>>>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>>>> Centre for Cognitive Neuroimaging >>>>>>>> Radboud University Nijmegen >>>>>>>> Neuronal Oscillations Group >>>>>>>> FieldTrip Development Team >>>>>>>> >>>>>>>> P.O. Box 9101 >>>>>>>> NL-6500 HB Nijmegen >>>>>>>> The Netherlands >>>>>>>> >>>>>>>> Contact: >>>>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>>>> Tel: +31-(0)24-36-68493 >>>>>>>> Web: http://www.ru.nl/donders >>>>>>>> >>>>>>>> Visiting address: >>>>>>>> Trigon, room 2.30 >>>>>>>> Kapittelweg 29 >>>>>>>> NL-6525 EN Nijmegen >>>>>>>> The Netherlands >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> fieldtrip mailing list >>>>>>>> fieldtrip at donders.ru.nl >>>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>>> _______________________________________________ >>>>>>>> fieldtrip mailing list >>>>>>>> fieldtrip at donders.ru.nl >>>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> -- >>>>>>> Jörn M. Horschig >>>>>>> PhD Student >>>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>>> Centre for Cognitive Neuroimaging >>>>>>> Radboud University Nijmegen >>>>>>> Neuronal Oscillations Group >>>>>>> FieldTrip Development Team >>>>>>> >>>>>>> P.O. Box 9101 >>>>>>> NL-6500 HB Nijmegen >>>>>>> The Netherlands >>>>>>> >>>>>>> Contact: >>>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>>> Tel: +31-(0)24-36-68493 >>>>>>> Web: http://www.ru.nl/donders >>>>>>> >>>>>>> Visiting address: >>>>>>> Trigon, room 2.30 >>>>>>> Kapittelweg 29 >>>>>>> NL-6525 EN Nijmegen >>>>>>> The Netherlands >>>>>>> >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> -- >>>>>> Jörn M. Horschig >>>>>> PhD Student >>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>> Centre for Cognitive Neuroimaging >>>>>> Radboud University Nijmegen >>>>>> Neuronal Oscillations Group >>>>>> FieldTrip Development Team >>>>>> >>>>>> P.O. Box 9101 >>>>>> NL-6500 HB Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> Contact: >>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>> Tel: +31-(0)24-36-68493 >>>>>> Web: http://www.ru.nl/donders >>>>>> >>>>>> Visiting address: >>>>>> Trigon, room 2.30 >>>>>> Kapittelweg 29 >>>>>> NL-6525 EN Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> -- >>>> Jörn M. Horschig >>>> PhD Student >>>> Donders Institute for Brain, Cognition and Behaviour >>>> Centre for Cognitive Neuroimaging >>>> Radboud University Nijmegen >>>> Neuronal Oscillations Group >>>> FieldTrip Development Team >>>> >>>> P.O. Box 9101 >>>> NL-6500 HB Nijmegen >>>> The Netherlands >>>> >>>> Contact: >>>> E-Mail: jm.horschig at donders.ru.nl >>>> Tel: +31-(0)24-36-68493 >>>> Web: http://www.ru.nl/donders >>>> >>>> Visiting address: >>>> Trigon, room 2.30 >>>> Kapittelweg 29 >>>> NL-6525 EN Nijmegen >>>> The Netherlands >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ittan at npsych.med.kyushu-u.ac.jp Wed Apr 2 06:38:02 2014 From: ittan at npsych.med.kyushu-u.ac.jp (=?iso-2022-jp?B?GyRCQ2ZCPDBsQkAbKEI=?=) Date: Wed, 2 Apr 2014 13:38:02 +0900 Subject: [FieldTrip] In BIOSEMI data format, baseline of each data much differ depending on channels Message-ID: <0038B093-BA65-4278-A2D9-936D8142C303@npsych.med.kyushu-u.ac.jp> Hi All, Now I try to read BIOSEMI data (.bdf format, 64ch) by using "ft_preprocessing", but I have one trouble. Baseline of each data much differ depending on channels. So, now I use cfg.demean as below script. cfg.trialdef.prestim = 0.5; % in seconds cfg.trialdef.poststim = 1; % in seconds cfg = ft_definetrial(cfg); cfg.demean='yes'; cfg.baselinewindow = [-0.1 0]; cfg.channel = {'Fp1' 'AF7' 'AF3' 'F1' 'F3' 'F5' 'F7' 'FT9' 'FT7' 'FC5' 'FC3' 'FC1' 'C1' 'C3' 'C5' 'T7' 'TP7'... 'CP5' 'CP3' 'CP1' 'P1' 'P3' 'P5' 'P7' 'P9' 'PO7' 'PO3' 'O1' 'Iz' 'Oz' 'POz' 'Pz' 'Fp2' 'AF8' 'AF4' 'Fz' 'F2'... 'F4' 'F6' 'F8' 'FT10' 'FT8' 'FC6' 'FC4' 'FC2' 'FCz' 'Cz' 'C2' 'C4' 'C6' 'T8' 'TP8' 'CP6' 'CP4' 'CP2' 'CPz' 'P2'... 'P4' 'P6' 'P8' 'P10' 'PO8' 'PO4' 'O2' 'PO9' 'PO10' }; cfd.reref=('yes'); cfg.refchannel=('all'); data = ft_preprocessing(cfg); But, I now focused on DC shift(Slow cortical potential <0.5Hz), so, I can't use cfg.demean and I'm looking for another method to solve this problem. Additionally, is this trouble( Baseline of each data much differ depending on channels.) common with BIOSEMI data format ? or is it due to our recording device? I woud appreciate if someone could advise or comment on how bests to go about this issue. Thanks. Itta Nakamura M.D. Kyushu-University Neuropsychiatry Department, Japan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jan.Hirschmann at med.uni-duesseldorf.de Wed Apr 2 09:42:10 2014 From: Jan.Hirschmann at med.uni-duesseldorf.de (Jan.Hirschmann at med.uni-duesseldorf.de) Date: Wed, 2 Apr 2014 07:42:10 +0000 Subject: [FieldTrip] PLV with DICS beamformer In-Reply-To: <003FC94A-3967-44F3-A0E2-BC813E99C4D8@cin.uni-tuebingen.de> References: <003FC94A-3967-44F3-A0E2-BC813E99C4D8@cin.uni-tuebingen.de> Message-ID: <33DD7D51F083DA488E69A067A5C39FBC8625F610@MAIL1-UKD.VMED.UKD> Hi Natalia, How are you? I didn't know you were fieldtripin', too. I can't really tell if your approach is correct, but I have some comments. First, to me it seems that the imaginary part of csd is not enough to calculate PLV. But then, I don't know the details of how you compute it. Second, the 3 orientations issue is commonly tackled by singular value decomposition rather than by averaging (see e.g. beamformer_dics.m). One can use svd to compute the orientation of maximum power, and I think one could adapt the code, e.g. to get the orientation of maximum phase difference. One straight-forward alternative I know of, is to extract source level time courses using the LCMV beamfomer. You can set cfg.projectmom='yes' to only get the direction of max. power. Then you could use ft_connectivityanalysis with cfg.method='plv' to get the phase locking values. Hope this helps, Jan Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Natalia Zaretskaya Gesendet: Dienstag, 1. April 2014 09:20 An: fieldtrip at science.ru.nl Betreff: [FieldTrip] PLV with DICS beamformer Dear FieldTrip experts, I would like to be able to compute the phase-locking value (Lachaux, 1999) using source data derived from disc beamformer. Right now I perform ft_sourceanalysis with cfg.method = 'dics'; cfg.refdip = [x y z]; cfg.rawtrial = 'yes'; cfg.keepcsd = 'yes'; cfg.grid.filter = source.avg.filter; % precomputed common filter for two conditions and then use the imaginary part of the single-trial cross-spectral densities to compute PLV "by hand". Cross-spectra at each position have a 3x3 format, so I compute the PLV for each dipole orientation pair and then average. I was wondering whether 1) the above procedure is technically correct and 2) whether there is a better, more efficient way to do it (I assume plv can be derived at the same step where source.avg.coh is computed?). Many thanks in advance! Best regards, Natalia Zaretskaya --- Dr. Natalia Zaretskaya Centre for Integrative Neuroscience Vision and Cognition Lab (AG Bartels) 72076 Tübingen, Germany natalia.zaretskaya at cin.uni-tuebingen.de phone: +49 7071 2989032 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ktyler at swin.edu.au Wed Apr 2 09:50:48 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Wed, 2 Apr 2014 07:50:48 +0000 Subject: [FieldTrip] problems with dipole fitting and anatomical alignment Message-ID: Hi All, I am having a great deal of difficulty accurately fitting dipoles. 'Dipoles' are ending up being shown outside the head...... This may be to do with problems in aligning the anatomical data with the sensors. I have used ft_volumerealign to fit the MRI to the neuromag coordinate system, so I am not sure where the problem is arising from. Any help or suggestions, especially from Neuromag users, much appreciated! Here is my code: mri = ft_read_mri('MRI.nii'); %% cfg=[]; cfg.method = 'interactive'; cfg.coordsys = 'neuromag'; mri_real = ft_volumerealign(cfg, mri); % Marked left and right fiducials along with naison %% cfg = []; cfg.coordsys='neuromag'; cfg.output = {'skullstrip' 'brain'}; seg = ft_volumesegment(cfg, mri_real); %% cfg = []; cfg.coordsys='neuromag'; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, seg); %Volume conduction model %% Plotting volume conduction model along with sensor positions. % When these are plotted, the volume conduction model does appear to be positioned too high in the sensors- see jpg vol = ft_convert_units(vol,'cm'); sens = grad;% 'grad' contains neuromag sensor info- taken from MEG data figure ft_plot_sens(sens, 'style', '*b'); hold on ft_plot_vol(vol); %% Fitting dipoles cfg=[]; cfg.numdipoles =1; cfg.latency = [0.05, 0.10]; cfg.vol = vol; %volume conduction model for the subject cfg.model = 'regional'; cfg.grad=grad;% 'grad' contains neuromag sensor info- taken from MEG data source = ft_dipolefitting(cfg, timelocked_data); %% make a plot of the location of the dipoles cfg = []; cfg.location = source.dip.pos* 10; % convert from cm to mm figure; ft_sourceplot(cfg, mri_real); Once again, any help or suggestions, especially from Neuromag users, much appreciated! Kaelasha Tyler -------------- next part -------------- An HTML attachment was scrubbed... URL: From poil.simonshlomo at gmail.com Wed Apr 2 11:44:42 2014 From: poil.simonshlomo at gmail.com (Simon-Shlomo Poil) Date: Wed, 2 Apr 2014 11:44:42 +0200 Subject: [FieldTrip] Import of Brainlab .sig files? Message-ID: Dear all, I have a problem importing .sig files from Brainlab to Matlab (I have .sig and .sts file for each recording). It seems that neither EEGLAB nor Fieldtrip supports import of these files. Does anybody have an idea of how to import these files to Matlab? Best regards, Simon-Shlomo Poil, Dr. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.rotonda at gmail.com Wed Apr 2 12:31:47 2014 From: marco.rotonda at gmail.com (Marco Rotonda) Date: Wed, 2 Apr 2014 12:31:47 +0200 Subject: [FieldTrip] Statistics on ratio frequencies Message-ID: Hi all, I would like to compute a simple alpha-theta ratio and do some statistics on it. I had my data from freqanalysis. Then I averaged with selectdata_new to have the mean for a band. Then the simple ratio for each channel. If now I call freqstatistics I have an error. Any suggestion? Thanks Marco -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Wed Apr 2 12:39:21 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 02 Apr 2014 12:39:21 +0200 Subject: [FieldTrip] Statistics on ratio frequencies In-Reply-To: References: Message-ID: <533BE8D9.6000502@donders.ru.nl> Hi Marco, could you be more specific, in the style of e.g. http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community#how_to_ask_a_questio ? Best, Jörn On 4/2/2014 12:31 PM, Marco Rotonda wrote: > Hi all, > I would like to compute a simple alpha-theta ratio and do some > statistics on it. > I had my data from freqanalysis. > Then I averaged with selectdata_new to have the mean for a band. > Then the simple ratio for each channel. > If now I call freqstatistics I have an error. > Any suggestion? > > Thanks > > Marco > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jan.schoffelen at donders.ru.nl Wed Apr 2 12:42:56 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Wed, 2 Apr 2014 12:42:56 +0200 Subject: [FieldTrip] Statistics on ratio frequencies In-Reply-To: References: Message-ID: <7DC258EF-0DD9-44BD-B0D6-F699575772C2@donders.ru.nl> Not if you don't provide us with some more input. Jan-Mathijs On Apr 2, 2014, at 12:31 PM, Marco Rotonda wrote: > Hi all, > I would like to compute a simple alpha-theta ratio and do some statistics on it. > I had my data from freqanalysis. > Then I averaged with selectdata_new to have the mean for a band. > Then the simple ratio for each channel. > If now I call freqstatistics I have an error. > Any suggestion? > > Thanks > > Marco > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.rotonda at gmail.com Wed Apr 2 12:52:18 2014 From: marco.rotonda at gmail.com (Marco Rotonda) Date: Wed, 2 Apr 2014 12:52:18 +0200 Subject: [FieldTrip] Statistics on ratio frequencies In-Reply-To: <7DC258EF-0DD9-44BD-B0D6-F699575772C2@donders.ru.nl> References: <7DC258EF-0DD9-44BD-B0D6-F699575772C2@donders.ru.nl> Message-ID: Sorry guys I attach the script I used: cfg = []; cfg.method = 'mtmfft'; cfg.taper = 'hanning'; cfg.foi = [4:1:8]; freqmw1theta = ft_freqanalysis(cfg, mw1); freqmw2theta = ft_freqanalysis(cfg, mw2); freqmw3theta = ft_freqanalysis(cfg, mw3); freqmw4theta = ft_freqanalysis(cfg, mw4); freqmw5theta = ft_freqanalysis(cfg, mw5); freqmw6theta = ft_freqanalysis(cfg, mw6); freqmw7theta = ft_freqanalysis(cfg, mw7); freqmwe1theta = ft_freqanalysis(cfg, mwe1); freqmwe2theta = ft_freqanalysis(cfg, mwe2); freqmwe3theta = ft_freqanalysis(cfg, mwe3); freqmwe4theta = ft_freqanalysis(cfg, mwe4); freqmwe5theta = ft_freqanalysis(cfg, mwe5); freqmwe6theta = ft_freqanalysis(cfg, mwe6); freqmwe7theta = ft_freqanalysis(cfg, mwe7); cfg = []; cfg.method = 'mtmfft'; cfg.taper = 'hanning'; cfg.foi = [8:1:12]; freqmw1alpha = ft_freqanalysis(cfg, mw1); freqmw2alpha = ft_freqanalysis(cfg, mw2); freqmw3alpha = ft_freqanalysis(cfg, mw3); freqmw4alpha = ft_freqanalysis(cfg, mw4); freqmw5alpha = ft_freqanalysis(cfg, mw5); freqmw6alpha = ft_freqanalysis(cfg, mw6); freqmw7alpha = ft_freqanalysis(cfg, mw7); freqmwe1alpha = ft_freqanalysis(cfg, mwe1); freqmwe2alpha = ft_freqanalysis(cfg, mwe2); freqmwe3alpha = ft_freqanalysis(cfg, mwe3); freqmwe4alpha = ft_freqanalysis(cfg, mwe4); freqmwe5alpha = ft_freqanalysis(cfg, mwe5); freqmwe6alpha = ft_freqanalysis(cfg, mwe6); freqmwe7alpha = ft_freqanalysis(cfg, mwe7); cfg = [ ]; cfg.parameter = 'powspctrm'; cfg.avgoverfreq = 'yes'; amw1 = ft_selectdata_new(cfg, freqmw1alpha); amw2 = ft_selectdata_new(cfg, freqmw2alpha); amw3 = ft_selectdata_new(cfg, freqmw3alpha); amw4 = ft_selectdata_new(cfg, freqmw4alpha); amw5 = ft_selectdata_new(cfg, freqmw5alpha); amw6 = ft_selectdata_new(cfg, freqmw6alpha); amw7 = ft_selectdata_new(cfg, freqmw7alpha); amwe1 = ft_selectdata_new(cfg, freqmwe1alpha); amwe2 = ft_selectdata_new(cfg, freqmwe2alpha); amwe3 = ft_selectdata_new(cfg, freqmwe3alpha); amwe4 = ft_selectdata_new(cfg, freqmwe4alpha); amwe5 = ft_selectdata_new(cfg, freqmwe5alpha); amwe6 = ft_selectdata_new(cfg, freqmwe6alpha); amwe7 = ft_selectdata_new(cfg, freqmwe7alpha); tmw1 = ft_selectdata_new(cfg, freqmw1theta); tmw2 = ft_selectdata_new(cfg, freqmw2theta); tmw3 = ft_selectdata_new(cfg, freqmw3theta); tmw4 = ft_selectdata_new(cfg, freqmw4theta); tmw5 = ft_selectdata_new(cfg, freqmw5theta); tmw6 = ft_selectdata_new(cfg, freqmw6theta); tmw7 = ft_selectdata_new(cfg, freqmw7theta); tmwe1 = ft_selectdata_new(cfg, freqmwe1theta); tmwe2 = ft_selectdata_new(cfg, freqmwe2theta); tmwe3 = ft_selectdata_new(cfg, freqmwe3theta); tmwe4 = ft_selectdata_new(cfg, freqmwe4theta); tmwe5 = ft_selectdata_new(cfg, freqmwe5theta); tmwe6 = ft_selectdata_new(cfg, freqmwe6theta); tmwe7 = ft_selectdata_new(cfg, freqmwe7theta); atmw1 = amw1; atmw2 = amw2; atmw3 = amw3; atmw4 = amw4; atmw5 = amw5; atmw6 = amw6; atmw7 = amw7; atmwe1 = amwe1; atmwe2 = amwe2; atmwe3 = amwe3; atmwe4 = amwe4; atmwe5 = amwe5; atmwe6 = amwe6; atmwe7 = amwe7; atmw1.powspctrm = amw1.powspctrm./tmw1.powspctrm; atmw2.powspctrm = amw2.powspctrm./tmw2.powspctrm; atmw3.powspctrm = amw3.powspctrm./tmw3.powspctrm; atmw4.powspctrm = amw4.powspctrm./tmw4.powspctrm; atmw5.powspctrm = amw5.powspctrm./tmw5.powspctrm; atmw6.powspctrm = amw6.powspctrm./tmw6.powspctrm; atmw7.powspctrm = amw7.powspctrm./tmw7.powspctrm; atmwe1.powspctrm = amwe1.powspctrm./tmwe1.powspctrm; atmwe2.powspctrm = amwe2.powspctrm./tmwe2.powspctrm; atmwe3.powspctrm = amwe3.powspctrm./tmwe3.powspctrm; atmwe4.powspctrm = amwe4.powspctrm./tmwe4.powspctrm; atmwe5.powspctrm = amwe5.powspctrm./tmwe5.powspctrm; atmwe6.powspctrm = amwe6.powspctrm./tmwe6.powspctrm; atmwe7.powspctrm = amwe7.powspctrm./tmwe7.powspctrm; cfg_neighb = []; cfg_neighb.method = 'distance'; neighbours = ft_prepare_neighbours(cfg_neighb, mwe1); ntrials = 7; cfg = []; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.parameter = 'powspctrm'; cfg.correctm = 'cluster'; cfg.template = 'easycapM11_neighb.mat'; cfg.neighbours = neighbours; cfg.numrandomization = 5000; cfg.avgoverfreq = 'yes'; cfg.alpha = 0.05; cfg.tail = 0; design = [ones(1,ntrials) ones(1,ntrials)*2]; cfg.design = design; cfg.uvar = 1; cfg.ivar = 2; statat = ft_freqstatistics(cfg, atmwe1, atmwe2, atmwe3, atmwe4, atmwe5,... atmwe6, atmwe7, atmw1, atmw2, atmw3, atmw4, atmw5,... atmw6, atmw7); the error I have is: Undefined function or variable "param". Error in seloverdim (line 57) for i = 1:numel(param) Error in ft_selectdata_old (line 601) if selectfoi, data = seloverdim(data, 'freq', selfoi, fb); end Error in ft_selectdata (line 45) [varargout{1:nargout}] = ft_selectdata_old(varargin{:}); Error in ft_freqstatistics (line 245) data = ft_selectdata(data, 'param', cfg.parameter, 'avgoverrpt', false, ... hope is more clear On 2 April 2014 12:42, jan-mathijs schoffelen wrote: > Not if you don't provide us with some more input. > Jan-Mathijs > > On Apr 2, 2014, at 12:31 PM, Marco Rotonda wrote: > > Hi all, > I would like to compute a simple alpha-theta ratio and do some statistics > on it. > I had my data from freqanalysis. > Then I averaged with selectdata_new to have the mean for a band. > Then the simple ratio for each channel. > If now I call freqstatistics I have an error. > Any suggestion? > > Thanks > > Marco > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From meschwe at gmail.com Wed Apr 2 14:49:49 2014 From: meschwe at gmail.com (Meike Schweisfurth) Date: Wed, 2 Apr 2014 14:49:49 +0200 Subject: [FieldTrip] warping from MNI to individual subjects In-Reply-To: <57CBCEA0-7232-44A9-A8B0-05588E4C2310@gmail.com> References: <57CBCEA0-7232-44A9-A8B0-05588E4C2310@gmail.com> Message-ID: Dear Julian! Thanks for your help! I guess it has been only a visualisation problem, it seems to be fine now! Thanks anyway! Meike 2014-04-01 15:12 GMT+02:00 Julian Keil : > Dear Meike, > > I'm not sure if this relates to your problem, but I had - possibly similar > - issues with the warped grid and the template being 90° rotated. > My problem was due to an error during the realignment of the MRI. > Did you check whether the realignment works and whether your different > coordinate systems make sense? > > Could you also maybe attach a picture of your exchanged axes? At least for > me it's hard to image how this looks. > > Best, > > Julian > > > ******************** > *Dr. Julian Keil* > > AG Multisensorische Integration > Psychiatrische Universitätsklinik > der Charité im St. Hedwig-Krankenhaus > Große Hamburger Straße 5-11, Raum E 307 > 10115 Berlin > > Telefon: +49-30-2311-1879 > Fax: +49-30-2311-2209 > > http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration > > Am 01.04.2014 um 14:12 schrieb Meike Schweisfurth: > > Dear Fieldtrippers! > As newbie I have another question, now concerning the warping from MNI to > individual subjects. > Using the below code (the first part almost entirely from > http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space), > I get first the template and then apply the grid to the individual > subjects. > However, in later on analysis step it turned out that while the subjects > where nicely similar positioned, the template position is entirely > different, as it is was even axes were exchanged... > Does anybody know what could be the reason and how to change it? > Thanks for any suggestions! > Best, Meike > > > % NOTE: the path to the template file is user-specific > template = > ft_read_mri('fieldtrip/fieldtrip-20140316/external/spm8/templates/T1.nii'); > template.coordsys = 'spm'; % so that FieldTrip knows how to interpret the > coordinate system > > % segment the template brain and construct a volume conduction model (i.e. > head model): this is needed > % for the inside/outside detection of voxels. > cfg = []; > template_seg = ft_volumesegment(cfg, template); > > cfg = []; > cfg.method = 'singleshell'; > template_vol = ft_prepare_headmodel(cfg, template_seg); > template_vol = ft_convert_units(template_vol, 'cm'); % Convert the vol to > cm, since the grid will also be expressed in cm > > % construct the dipole grid in the template brain coordinates > % the source units are in cm > % the negative inwardshift means an outward shift of the brain surface for > inside/outside detection > cfg = []; > cfg.grid.xgrid = -20:1:20; > cfg.grid.ygrid = -20:1:20; > cfg.grid.zgrid = -20:1:20; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > cfg.inwardshift = -1.5; > cfg.vol = template_vol; > template_grid = ft_prepare_sourcemodel(cfg); > save('../analysis/MEG/source_analysis/MNI','template_grid','template_vol','template_seg','template') > > % make a figure with the template head model and dipole grid > figure > hold on > ft_plot_vol(template_vol, 'facecolor', 'cortex', 'edgecolor', > 'none');alpha 0.5; camlight; > ft_plot_mesh(template_grid.pos(template_grid.inside,:)); > else > load('../analysis/MEG/source_analysis/MNI','template_grid','template_vol','template_seg','template') > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > SUBJECTS={ 'VP02' 'VP03' 'VP04' 'VP05' 'VP06' > 'VP07' 'VP08' 'VP09' 'VP11' 'VP12' 'VP13' 'VP14' > 'VP15' 'VP16' 'VP17' 'VP18'} > > for SUBJI=SUBJECTS > SUBJ=SUBJI{1}; > % read the single subject anatomical MRI > load(['..*/analysis/MEG/source_analysis/*',SUBJ,'/mri']); %Has been > processed to CFT coordinates before > load(['..*/analysis/MEG/source_analysis/*',SUBJ,'/segmentedmri']); > > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, segmentedmri); > > % create the subject specific grid, using the template grid that has just > been created > cfg = []; > cfg.grid.warpmni = 'yes'; > cfg.grid.template = template_grid; > cfg.grid.nonlinear = 'yes'; % use non-linear normalization > cfg.mri = mri_ra; > grid = ft_prepare_sourcemodel(cfg); > > % make a figure of the single subject headmodel, and grid positions > figure; > ft_plot_vol(vol, 'edgecolor', 'none'); alpha 0.4; %camlight > ft_plot_mesh(grid.pos(grid.inside,:)); > > save(['..*/analysis/MEG/source_analysis/*',SUBJ,'/MNIgrid'],'grid','vol') > end > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nkrishna at mprc.umaryland.edu Wed Apr 2 16:23:01 2014 From: nkrishna at mprc.umaryland.edu (Nithin Krishna) Date: Wed, 2 Apr 2014 10:23:01 -0400 Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data References: <533BE8D9.6000502@donders.ru.nl> Message-ID: <20140402T102301Z_155300170001@mprc.umaryland.edu> Dear All, I read the tutorial section on Cluster-based permutation tests on time-frequency data as well as the Maris and Oostenveld, Journal of Neuroscience Methods, 2007 report. I am interested in setting up a ERP experiment on EEG data in this regard I like the procedure and processing section of the tutorial, however I would like to know if there is any section for EEG, I understand that megplanar is specific for MEG. Also is it possible to use 3D matrix (TFR) (time, Freq channels ) non feild trip output to run the cluster based permutation tests. Looking forward Nithin >>> "Jörn M. Horschig" 4/2/2014 6:39 AM >>> Hi Marco, could you be more specific, in the style of e.g. http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community#how_to_ask_a_questio ? Best, Jörn On 4/2/2014 12:31 PM, Marco Rotonda wrote: > Hi all, > I would like to compute a simple alpha-theta ratio and do some > statistics on it. > I had my data from freqanalysis. > Then I averaged with selectdata_new to have the mean for a band. > Then the simple ratio for each channel. > If now I call freqstatistics I have an error. > Any suggestion? > > Thanks > > Marco > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Wed Apr 2 16:39:14 2014 From: n.lam at fcdonders.ru.nl (Lam, Nietzsche) Date: Wed, 2 Apr 2014 16:39:14 +0200 (CEST) Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data In-Reply-To: <20140402T102301Z_155300170001@mprc.umaryland.edu> Message-ID: <463655257.1716412.1396449554295.JavaMail.root@indus.zimbra.ru.nl> Dear Nithin, FieldTrip was primarily set up for MEG data but we definitely have several tutorials discussing similar procedures for EEG data. Perhaps these tutorials can help you out. http://fieldtrip.fcdonders.nl/tutorial/eeg_preprocessing_erp http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock http://fieldtrip.fcdonders.nl/tutorial/eventrelatedstatistics Although these later two links are performed on MEG data, I think they are useful to you because functions used to calculate ERFs are also used for ERPs. For example, in FieldTrip you can use ft_timelockanalysis and ft_timelockstatistics for both EEG and MEG data. Regarding the use of non-FieldTrip data for cluster-permutations. Theoretically, I think it is possible, but probably more experienced users can answer this. Nevertheless, you could look into this FAQ about how to import your data so that it ca be used by FieldTrip here: http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat?s[]=import&s[]=data best, Nietzsche ----- Original Message ----- > From: "Nithin Krishna" > To: "FieldTrip discussion list" > Sent: Wednesday, 2 April, 2014 4:23:01 PM > Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data > Dear All, > I read the tutorial section on Cluster-based permutation tests on > time-frequency data as well as the Maris and Oostenveld, Journal of > Neuroscience Methods, 2007 report. I am interested in setting up a ERP > experiment on EEG data in this regard I like the procedure and > processing section of the tutorial, however I would like to know if > there is any section for EEG, I understand that megplanar is specific > for MEG. > Also is it possible to use 3D matrix (TFR) (time, Freq channels ) non > feild trip output to run the cluster based permutation tests. > Looking forward > Nithin > > > >>> "Jörn M. Horschig" 4/2/2014 6:39 AM >>> > > Hi Marco, > > could you be more specific, in the style of e.g. > http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community#how_to_ask_a_questio > ? > > Best, > Jörn > > On 4/2/2014 12:31 PM, Marco Rotonda wrote: > > Hi all, > > I would like to compute a simple alpha-theta ratio and do some > > statistics on it. > > I had my data from freqanalysis. > > Then I averaged with selectdata_new to have the mean for a band. > > Then the simple ratio for each channel. > > If now I call freqstatistics I have an error. > > Any suggestion? > > > > Thanks > > > > Marco > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com From nkrishna at mprc.umaryland.edu Wed Apr 2 16:43:45 2014 From: nkrishna at mprc.umaryland.edu (Nithin Krishna) Date: Wed, 2 Apr 2014 10:43:45 -0400 Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data References: <20140402T102301Z_155300170001@mprc.umaryland.edu> <463655257.1716412.1396449554295.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <20140402T104345Z_155300170001@mprc.umaryland.edu> Thanks a lot Nietzsche, will explore the tutorials. Nithin >>> "Lam, Nietzsche" 4/2/2014 10:39 AM >>> Dear Nithin, FieldTrip was primarily set up for MEG data but we definitely have several tutorials discussing similar procedures for EEG data. Perhaps these tutorials can help you out. http://fieldtrip.fcdonders.nl/tutorial/eeg_preprocessing_erp http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock http://fieldtrip.fcdonders.nl/tutorial/eventrelatedstatistics Although these later two links are performed on MEG data, I think they are useful to you because functions used to calculate ERFs are also used for ERPs. For example, in FieldTrip you can use ft_timelockanalysis and ft_timelockstatistics for both EEG and MEG data. Regarding the use of non-FieldTrip data for cluster-permutations. Theoretically, I think it is possible, but probably more experienced users can answer this. Nevertheless, you could look into this FAQ about how to import your data so that it ca be used by FieldTrip here: http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat?s[]=import&s[]=data best, Nietzsche ----- Original Message ----- > From: "Nithin Krishna" > To: "FieldTrip discussion list" > Sent: Wednesday, 2 April, 2014 4:23:01 PM > Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data > Dear All, > I read the tutorial section on Cluster-based permutation tests on > time-frequency data as well as the Maris and Oostenveld, Journal of > Neuroscience Methods, 2007 report. I am interested in setting up a ERP > experiment on EEG data in this regard I like the procedure and > processing section of the tutorial, however I would like to know if > there is any section for EEG, I understand that megplanar is specific > for MEG. > Also is it possible to use 3D matrix (TFR) (time, Freq channels ) non > feild trip output to run the cluster based permutation tests. > Looking forward > Nithin > > > >>> "Jörn M. Horschig" 4/2/2014 6:39 AM >>> > > Hi Marco, > > could you be more specific, in the style of e.g. > http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community#how_to_ask_a_questio > ? > > Best, > Jörn > > On 4/2/2014 12:31 PM, Marco Rotonda wrote: > > Hi all, > > I would like to compute a simple alpha-theta ratio and do some > > statistics on it. > > I had my data from freqanalysis. > > Then I averaged with selectdata_new to have the mean for a band. > > Then the simple ratio for each channel. > > If now I call freqstatistics I have an error. > > Any suggestion? > > > > Thanks > > > > Marco > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at fcdonders.ru.nl Wed Apr 2 17:10:52 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Wed, 2 Apr 2014 17:10:52 +0200 (CEST) Subject: [FieldTrip] Fieldtrip ICA crashes Matlab In-Reply-To: References: Message-ID: <005101cf4e85$bd08ef50$371acdf0$@herring@fcdonders.ru.nl> Hi Hweeling, Could you please copy and paste the exact error message Matlab is producing? Also, which version (e.g. 2013a) of Matlab are you using? Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Hwee Ling Lee Sent: maandag 31 maart 2014 17:25 To: Stephen Politzer-Ahles; FieldTrip discussion list Subject: Re: [FieldTrip] Fieldtrip ICA crashes Matlab Hi, Thanks for your reply. I'm running Matlab with 64 bit. I've got 32GB of RAM installed. In the previous month, I was able to run ICA and plot its components without any error message from Matlab. Recently, I keep experiencing the error message, and Matlab crashes completely. I have no clue what could have gone wrong. Cheers, Hweeling On 31 March 2014 17:08, Stephen Politzer-Ahles wrote: Hello Hweeling, What kind of error do you get in MATLAB when you try to do ICA, is it an "Out of memory" error? I'm asking because this is a fairly common issue in MATLAB on Windows systems (I don't know the details of your data, but I've experienced this issue on 32-channel, 1000-Hz epoched EEG data if the epochs are long enough and numerous enough). For me the only solutions (other than shortening the epochs or downsampling the data, which might not be good options depending on your research question) were to use a Unix-based operating system (like Mac OS) or to upgrade my Windows (I had errors like this when using a 32-bit version of Windows with 2 GB of RAM, but not so much after I upgraded to 64-bit and 8 GB of RAM). I'm not sure if this is the issue you're having, though. Best, Steve Stephen Politzer-Ahles New York University, Abu Dhabi Neuroscience of Language Lab http://www.nyu.edu/projects/politzer-ahles/ On Mon, Mar 31, 2014 at 7:02 PM, wrote: Send fieldtrip mailing list submissions to fieldtrip at science.ru.nl To subscribe or unsubscribe via the World Wide Web, visit http://mailman.science.ru.nl/mailman/listinfo/fieldtrip or, via email, send a message with subject or body 'help' to fieldtrip-request at science.ru.nl You can reach the person managing the list at fieldtrip-owner at science.ru.nl When replying, please edit your Subject line so it is more specific than "Re: Contents of fieldtrip digest..." Today's Topics: 1. Fieldtrip ICA crashes Matlab (Hwee Ling Lee) 2. Re: plotting interpolated sources with ft_sourceplot (J?rn M. Horschig) 3. Re: help about ' fieldtrip2fiff ' (Gio Piantoni) ---------------------------------------------------------------------- Message: 1 Date: Mon, 31 Mar 2014 16:48:34 +0200 From: Hwee Ling Lee To: FieldTrip discussion list Subject: [FieldTrip] Fieldtrip ICA crashes Matlab Message-ID: Content-Type: text/plain; charset="iso-8859-1" Dear all, I'm encountering a problem with running ICA in Matlab. After ICA, when I tried to plot the components, Matlab keeps prompting an internal problem and needs to be closed. I wonder why this is the case. Could someone please tell me what went wrong? Here's part of my script for ICA: cfg = []; % if data were cleaned, then use this if sub == 5 %|| sub == 7 cfg.channel = {'all', '-AFz', '-FT7'}; elseif sub == 7 cfg.channel = {'all' '-AFz'}; else cfg.channel = {'all'}; end % cfg.runica.pca = 121; % using the rank of my data % ic_data = ft_componentanalysis(cfg,cleandata); % if data were cleaned then use this ic_data = ft_componentanalysis(cfg, cleandata); % after ICA, look for components that we want to substract from our data, % only looking at ten channels (components) at a time cfg = []; cfg.dataset = rawdatafile; cfg.viewmode = 'component'; cfg.continuous = 'no'; cfg.blocksize = 8; cfg.channels = 'all'; cfg.layout = 'EEG1020.lay'; ft_databrowser(cfg,ic_data); The internal problem appears even when I downsampled my data from 5000 Hz to 1000 Hz. The internal problem appears also when I have short segments of my data (i.e. 2s per trial), and long segments of my data (i.e. 6s per trial). The memory of my PC workstation is: Maximum possible array: 60253 MB (6.318e+10 bytes) * Memory available for all arrays: 60253 MB (6.318e+10 bytes) * Memory used by MATLAB: 560 MB (5.872e+08 bytes) Physical Memory (RAM): 32685 MB (3.427e+10 bytes) Interestingly, this internal problem does not occur when I ran my script on my Macbook Pro. I'm feeling very lost here. Any help is highly appreciated. Cheers, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: -- ================================================= Dr. rer. nat. Lee, Hwee Ling Postdoc German Center for Neurodegenerative Diseases (DZNE) Bonn Email 1: hwee-ling.leedzne.de Email 2: hweeling.leegmail.com https://sites.google.com/site/hweelinglee/home Correspondence Address: Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany ================================================= -------------- next part -------------- An HTML attachment was scrubbed... URL: From joramvandriel at gmail.com Wed Apr 2 17:25:29 2014 From: joramvandriel at gmail.com (Joram van Driel) Date: Wed, 2 Apr 2014 17:25:29 +0200 Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data In-Reply-To: <463655257.1716412.1396449554295.JavaMail.root@indus.zimbra.ru.nl> References: <20140402T102301Z_155300170001@mprc.umaryland.edu> <463655257.1716412.1396449554295.JavaMail.root@indus.zimbra.ru.nl> Message-ID: Dear Nithin, I use Fieldtrip's permutation testing routines quite often on non-fieldtrip analyzed data. It is quite straightforward as long as you have your channel/neighbour layout the way Fieldtrip needs it. Try playing around with the ft_read_sens(*[EEG file with readable channel locations]*), or simply choose a layout file from the folder /template/layout/ inside your fieldtrip folder; from this you need to use ft_prepare_neighbours; or more simple, choose a predefined neighbour structure from /template/neighbours. This covers quite a lot of systems; of course yours may not be in there; then I think ft_read_sens is your only option. I use EEGLAB for example, and I could import a .set file with a field EEG.chanlocs using ft_read_sens. Then, I do the following for time-frequency data (but in principle this should be very similar for time-domain ERP data): - I first configure the cfg as described in the cluster permutation testing tutorial - Then I manually put my own analyzed data into a "freqs" structure; name is of course arbitrary, but should have the same fields as the output from ft_freqanalysis: freq1.freq = [the values of the different frequencies]; freq1.time = [the different time points]; freq1.dimord = 'subj_chan_freq_time'; freq1.grad = [the result from ft_read_sense]; freq1.label = [the labels from the result of ft_read_sense]; freq1.powspctrm = [the result of your own custom/EEGLAB/whatever non-fieldtrip analysis, provided this has the dimensions of freqs.dimord]; Then I do this for example for two different conditions, make my design matrix in cfg.design, and put it into ft_freqstatistics(cfg,freq1,freq2) Hope this helps. - Joram On Wed, Apr 2, 2014 at 4:39 PM, Lam, Nietzsche wrote: > Dear Nithin, > > FieldTrip was primarily set up for MEG data but we definitely have several > tutorials discussing similar procedures for EEG data. Perhaps these > tutorials can help you out. > > http://fieldtrip.fcdonders.nl/tutorial/eeg_preprocessing_erp > > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock > http://fieldtrip.fcdonders.nl/tutorial/eventrelatedstatistics > Although these later two links are performed on MEG data, I think they are > useful to you because functions used to calculate ERFs are also used for > ERPs. For example, in FieldTrip you can use ft_timelockanalysis and > ft_timelockstatistics for both EEG and MEG data. > > Regarding the use of non-FieldTrip data for cluster-permutations. > Theoretically, I think it is possible, but probably more experienced users > can answer this. Nevertheless, you could look into this FAQ about how to > import your data so that it ca be used by FieldTrip here: > > http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat?s[]=import&s[]=data > > best, > Nietzsche > > > > ----- Original Message ----- > > From: "Nithin Krishna" > > To: "FieldTrip discussion list" > > Sent: Wednesday, 2 April, 2014 4:23:01 PM > > Subject: [FieldTrip] Question on Cluster-based permutation tests on > time-frequency data > > Dear All, > > I read the tutorial section on Cluster-based permutation tests on > > time-frequency data as well as the Maris and Oostenveld, Journal of > > Neuroscience Methods, 2007 report. I am interested in setting up a ERP > > experiment on EEG data in this regard I like the procedure and > > processing section of the tutorial, however I would like to know if > > there is any section for EEG, I understand that megplanar is specific > > for MEG. > > Also is it possible to use 3D matrix (TFR) (time, Freq channels ) non > > feild trip output to run the cluster based permutation tests. > > Looking forward > > Nithin > > > > > > >>> "Jörn M. Horschig" 4/2/2014 6:39 AM >>> > > > > Hi Marco, > > > > could you be more specific, in the style of e.g. > > > http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community#how_to_ask_a_questio > > ? > > > > Best, > > Jörn > > > > On 4/2/2014 12:31 PM, Marco Rotonda wrote: > > > Hi all, > > > I would like to compute a simple alpha-theta ratio and do some > > > statistics on it. > > > I had my data from freqanalysis. > > > Then I averaged with selectdata_new to have the mean for a band. > > > Then the simple ratio for each channel. > > > If now I call freqstatistics I have an error. > > > Any suggestion? > > > > > > Thanks > > > > > > Marco > > > > > > > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > -- > > Jörn M. Horschig > > PhD Student > > Donders Institute for Brain, Cognition and Behaviour > > Centre for Cognitive Neuroimaging > > Radboud University Nijmegen > > Neuronal Oscillations Group > > FieldTrip Development Team > > > > P.O. Box 9101 > > NL-6500 HB Nijmegen > > The Netherlands > > > > Contact: > > E-Mail: jm.horschig at donders.ru.nl > > Tel: +31-(0)24-36-68493 > > Web: http://www.ru.nl/donders > > > > Visiting address: > > Trigon, room 2.30 > > Kapittelweg 29 > > NL-6525 EN Nijmegen > > The Netherlands > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > Nietzsche H.L. Lam, MSc > PhD Candidate > > Max Planck Institute for Psycholinguistics > Wundtlaan 1, 6525 XD Nijmegen, The Netherlands > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Kapittelweg 29, 6525EN Nijmegen, The Netherlands > > n.lam at fcdonders.ru.nl > +31-24-3668219 > > > neurobiologyoflanguage.com > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Joram van Driel, MSc. PhD student @ University of Amsterdam Brain & Cognition @ Department of Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: From nkrishna at mprc.umaryland.edu Wed Apr 2 18:28:08 2014 From: nkrishna at mprc.umaryland.edu (Nithin Krishna) Date: Wed, 2 Apr 2014 12:28:08 -0400 Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data References: <20140402T102301Z_155300170001@mprc.umaryland.edu> <463655257.1716412.1396449554295.JavaMail.root@indus.zimbra.ru.nl> Message-ID: <20140402T122808Z_155300170001@mprc.umaryland.edu> Thanks a lot Joram, Actually this helps a lot and the layout does have my system. Cheers Nithin >>> Joram van Driel 4/2/2014 11:25 AM >>> Dear Nithin, I use Fieldtrip's permutation testing routines quite often on non-fieldtrip analyzed data. It is quite straightforward as long as you have your channel/neighbour layout the way Fieldtrip needs it. Try playing around with the ft_read_sens([EEG file with readable channel locations]), or simply choose a layout file from the folder /template/layout/ inside your fieldtrip folder; from this you need to use ft_prepare_neighbours; or more simple, choose a predefined neighbour structure from /template/neighbours. This covers quite a lot of systems; of course yours may not be in there; then I think ft_read_sens is your only option. I use EEGLAB for example, and I could import a .set file with a field EEG.chanlocs using ft_read_sens. Then, I do the following for time-frequency data (but in principle this should be very similar for time-domain ERP data): - I first configure the cfg as described in the cluster permutation testing tutorial - Then I manually put my own analyzed data into a "freqs" structure; name is of course arbitrary, but should have the same fields as the output from ft_freqanalysis: freq1.freq = [the values of the different frequencies]; freq1.time = [the different time points]; freq1.dimord = 'subj_chan_freq_time'; freq1.grad = [the result from ft_read_sense]; freq1.label = [the labels from the result of ft_read_sense]; freq1.powspctrm = [the result of your own custom/EEGLAB/whatever non-fieldtrip analysis, provided this has the dimensions of freqs.dimord]; Then I do this for example for two different conditions, make my design matrix in cfg.design, and put it into ft_freqstatistics(cfg,freq1,freq2) Hope this helps. - Joram On Wed, Apr 2, 2014 at 4:39 PM, Lam, Nietzsche wrote: Dear Nithin, FieldTrip was primarily set up for MEG data but we definitely have several tutorials discussing similar procedures for EEG data. Perhaps these tutorials can help you out. http://fieldtrip.fcdonders.nl/tutorial/eeg_preprocessing_erp http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_timelock http://fieldtrip.fcdonders.nl/tutorial/eventrelatedstatistics Although these later two links are performed on MEG data, I think they are useful to you because functions used to calculate ERFs are also used for ERPs. For example, in FieldTrip you can use ft_timelockanalysis and ft_timelockstatistics for both EEG and MEG data. Regarding the use of non-FieldTrip data for cluster-permutations. Theoretically, I think it is possible, but probably more experienced users can answer this. Nevertheless, you could look into this FAQ about how to import your data so that it ca be used by FieldTrip here: http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat?s[]=import&s[]=data best, Nietzsche ----- Original Message ----- > From: "Nithin Krishna" > To: "FieldTrip discussion list" > Sent: Wednesday, 2 April, 2014 4:23:01 PM > Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data > Dear All, > I read the tutorial section on Cluster-based permutation tests on > time-frequency data as well as the Maris and Oostenveld, Journal of > Neuroscience Methods, 2007 report. I am interested in setting up a ERP > experiment on EEG data in this regard I like the procedure and > processing section of the tutorial, however I would like to know if > there is any section for EEG, I understand that megplanar is specific > for MEG. > Also is it possible to use 3D matrix (TFR) (time, Freq channels ) non > feild trip output to run the cluster based permutation tests. > Looking forward > Nithin > > > >>> "Jörn M. Horschig" 4/2/2014 6:39 AM >>> > > Hi Marco, > > could you be more specific, in the style of e.g. > http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community#how_to_ask_a_questio > ? > > Best, > Jörn > > On 4/2/2014 12:31 PM, Marco Rotonda wrote: > > Hi all, > > I would like to compute a simple alpha-theta ratio and do some > > statistics on it. > > I had my data from freqanalysis. > > Then I averaged with selectdata_new to have the mean for a band. > > Then the simple ratio for each channel. > > If now I call freqstatistics I have an error. > > Any suggestion? > > > > Thanks > > > > Marco > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Nietzsche H.L. Lam, MSc PhD Candidate Max Planck Institute for Psycholinguistics Wundtlaan 1, 6525 XD Nijmegen, The Netherlands Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Kapittelweg 29, 6525EN Nijmegen, The Netherlands n.lam at fcdonders.ru.nl +31-24-3668219 neurobiologyoflanguage.com _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Joram van Driel, MSc. PhD student @ University of Amsterdam Brain & Cognition @ Department of Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Wed Apr 2 20:47:13 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Wed, 2 Apr 2014 20:47:13 +0200 Subject: [FieldTrip] Fieldtrip ICA crashes Matlab In-Reply-To: <533c287d.43040e0a.3506.3700SMTPIN_ADDED_BROKEN@mx.google.com> References: <533c287d.43040e0a.3506.3700SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: Dear Jim, I figured that the error occurs when I tried to plot the ICA components using ft_databrowser, with viewmode as "component". For the PC, I'm running a 64 bit Windows 7, 32 GB of RAM, and 1000 MB of graphics memory (NIVDIA Quadro 600). I've also tried the command on another PC running 64 bit Windows 7, Matlab R2012b, 64 GB of RAM and 457 MB of graphics memory. Both PCs produced the same internal error that crashes Matlab. I was not able to copy the message, as it was a pop out window that informs me of the fatal error, and I would have to end the program. The funny thing was that I was able to plot the ICA components a month ago, but not able to. This error occurred once to me as well. I've also updated my fieldtrip toolbox to the version on 30 March 2014. For the Macbook Pro, I did not get this error when I plotted the ICA components using the same data and the same commands. I suspect that it may be a problem with my graphics memory, however, the error seems strange to me as it occurs on some times, and the error "disappears" on some other times. I'm contemplating of converting one of my PC to a linux workstation. Do you think this will resolve my problems? Thanks for your help. I'm totally lost here. Best regards, Hweeling On 2 April 2014 17:10, Herring, J.D. (Jim) wrote: > Hi Hweeling, > > > > Could you please copy and paste the exact error message Matlab is > producing? Also, which version (e.g. 2013a) of Matlab are you using? > > > > Best, > > > > Jim > > > > > > > > *From:* fieldtrip-bounces at science.ru.nl [mailto: > fieldtrip-bounces at science.ru.nl] *On Behalf Of *Hwee Ling Lee > *Sent:* maandag 31 maart 2014 17:25 > *To:* Stephen Politzer-Ahles; FieldTrip discussion list > *Subject:* Re: [FieldTrip] Fieldtrip ICA crashes Matlab > > > > Hi, > > > > Thanks for your reply. I'm running Matlab with 64 bit. I've got 32GB of > RAM installed. In the previous month, I was able to run ICA and plot its > components without any error message from Matlab. Recently, I keep > experiencing the error message, and Matlab crashes completely. I have no > clue what could have gone wrong. > > > > Cheers, > > Hweeling > > > > On 31 March 2014 17:08, Stephen Politzer-Ahles > wrote: > > Hello Hweeling, > > > > What kind of error do you get in MATLAB when you try to do ICA, is it an > "Out of memory" error? I'm asking because this is a fairly common issue in > MATLAB on Windows systems (I don't know the details of your data, but I've > experienced this issue on 32-channel, 1000-Hz epoched EEG data if the > epochs are long enough and numerous enough). For me the only solutions > (other than shortening the epochs or downsampling the data, which might not > be good options depending on your research question) were to use a > Unix-based operating system (like Mac OS) or to upgrade my Windows (I had > errors like this when using a 32-bit version of Windows with 2 GB of RAM, > but not so much after I upgraded to 64-bit and 8 GB of RAM). I'm not sure > if this is the issue you're having, though. > > > > Best, > > Steve > > > > > > > Stephen Politzer-Ahles > New York University, Abu Dhabi > Neuroscience of Language Lab > http://www.nyu.edu/projects/politzer-ahles/ > > > > On Mon, Mar 31, 2014 at 7:02 PM, wrote: > > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Fieldtrip ICA crashes Matlab (Hwee Ling Lee) > 2. Re: plotting interpolated sources with ft_sourceplot > (J?rn M. Horschig) > 3. Re: help about ' fieldtrip2fiff ' (Gio Piantoni) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 31 Mar 2014 16:48:34 +0200 > From: Hwee Ling Lee > To: FieldTrip discussion list > Subject: [FieldTrip] Fieldtrip ICA crashes Matlab > Message-ID: > poVtb-1ApZuDQ at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Dear all, > > I'm encountering a problem with running ICA in Matlab. After ICA, when I > tried to plot the components, Matlab keeps prompting an internal problem > and needs to be closed. I wonder why this is the case. Could someone please > tell me what went wrong? > > Here's part of my script for ICA: > > cfg = []; % if data were cleaned, then use this > > if sub == 5 %|| sub == 7 > cfg.channel = {'all', '-AFz', '-FT7'}; > elseif sub == 7 > cfg.channel = {'all' '-AFz'}; > else > cfg.channel = {'all'}; > end > > % cfg.runica.pca = 121; % using the rank of my data > % ic_data = ft_componentanalysis(cfg,cleandata); % if data were > cleaned then use this > ic_data = ft_componentanalysis(cfg, cleandata); > > % after ICA, look for components that we want to substract from our > data, > % only looking at ten channels (components) at a time > cfg = []; > cfg.dataset = rawdatafile; > cfg.viewmode = 'component'; > cfg.continuous = 'no'; > cfg.blocksize = 8; > cfg.channels = 'all'; > cfg.layout = 'EEG1020.lay'; > ft_databrowser(cfg,ic_data); > > > The internal problem appears even when I downsampled my data from 5000 Hz > to 1000 Hz. > > The internal problem appears also when I have short segments of my data > (i.e. 2s per trial), and long segments of my data (i.e. 6s per trial). > > The memory of my PC workstation is: > Maximum possible array: 60253 MB (6.318e+10 bytes) * > Memory available for all arrays: 60253 MB (6.318e+10 bytes) * > Memory used by MATLAB: 560 MB (5.872e+08 bytes) > Physical Memory (RAM): 32685 MB (3.427e+10 bytes) > > Interestingly, this internal problem does not occur when I ran my script on > my Macbook Pro. > > I'm feeling very lost here. Any help is highly appreciated. > > Cheers, > Hweeling > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/f756367f/attachment-0001.html > > > > > > > > -- > > ================================================= > Dr. rer. nat. Lee, Hwee Ling > Postdoc > German Center for Neurodegenerative Diseases (DZNE) Bonn > > Email 1: hwee-ling.leedzne.de > Email 2: hweeling.leegmail.com > > > > https://sites.google.com/site/hweelinglee/home > > Correspondence Address: > Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany > ================================================= > -- ================================================= Dr. rer. nat. Lee, Hwee Ling Postdoc German Center for Neurodegenerative Diseases (DZNE) Bonn Email 1: hwee-ling.leedzne.de Email 2: hweeling.leegmail.com https://sites.google.com/site/hweelinglee/home Correspondence Address: Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany ================================================= -------------- next part -------------- An HTML attachment was scrubbed... URL: From elmeri.syrjanen at gmail.com Wed Apr 2 22:17:51 2014 From: elmeri.syrjanen at gmail.com (=?ISO-8859-1?Q?Elmeri_Syrj=E4nen?=) Date: Wed, 2 Apr 2014 22:17:51 +0200 Subject: [FieldTrip] Fieldtrip ICA crashes Matlab In-Reply-To: References: <533c287d.43040e0a.3506.3700SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: Dear Whee Ling, this is an old bug that has been in FieldTrip since October last year. You can see the bug report here: http://bugzilla.fcdonders.nl/show_bug.cgi?id=2316 Safest way to avoid it is to use a mac computer or revert to a FieldTrip version from September last year. /elmeri On Wed, Apr 2, 2014 at 8:47 PM, Hwee Ling Lee wrote: > Dear Jim, > > I figured that the error occurs when I tried to plot the ICA components > using ft_databrowser, with viewmode as "component". > > For the PC, I'm running a 64 bit Windows 7, 32 GB of RAM, and 1000 MB of > graphics memory (NIVDIA Quadro 600). I've also tried the command on another > PC running 64 bit Windows 7, Matlab R2012b, 64 GB of RAM and 457 MB of > graphics memory. Both PCs produced the same internal error that crashes > Matlab. I was not able to copy the message, as it was a pop out window that > informs me of the fatal error, and I would have to end the program. > > The funny thing was that I was able to plot the ICA components a month > ago, but not able to. This error occurred once to me as well. I've also > updated my fieldtrip toolbox to the version on 30 March 2014. > > For the Macbook Pro, I did not get this error when I plotted the ICA > components using the same data and the same commands. > > I suspect that it may be a problem with my graphics memory, however, the > error seems strange to me as it occurs on some times, and the error > "disappears" on some other times. > > I'm contemplating of converting one of my PC to a linux workstation. Do > you think this will resolve my problems? > > Thanks for your help. I'm totally lost here. > > Best regards, > Hweeling > > > > > On 2 April 2014 17:10, Herring, J.D. (Jim) wrote: > >> Hi Hweeling, >> >> >> >> Could you please copy and paste the exact error message Matlab is >> producing? Also, which version (e.g. 2013a) of Matlab are you using? >> >> >> >> Best, >> >> >> >> Jim >> >> >> >> >> >> >> >> *From:* fieldtrip-bounces at science.ru.nl [mailto: >> fieldtrip-bounces at science.ru.nl] *On Behalf Of *Hwee Ling Lee >> >> *Sent:* maandag 31 maart 2014 17:25 >> *To:* Stephen Politzer-Ahles; FieldTrip discussion list >> *Subject:* Re: [FieldTrip] Fieldtrip ICA crashes Matlab >> >> >> >> Hi, >> >> >> >> Thanks for your reply. I'm running Matlab with 64 bit. I've got 32GB of >> RAM installed. In the previous month, I was able to run ICA and plot its >> components without any error message from Matlab. Recently, I keep >> experiencing the error message, and Matlab crashes completely. I have no >> clue what could have gone wrong. >> >> >> >> Cheers, >> >> Hweeling >> >> >> >> On 31 March 2014 17:08, Stephen Politzer-Ahles >> wrote: >> >> Hello Hweeling, >> >> >> >> What kind of error do you get in MATLAB when you try to do ICA, is it an >> "Out of memory" error? I'm asking because this is a fairly common issue in >> MATLAB on Windows systems (I don't know the details of your data, but I've >> experienced this issue on 32-channel, 1000-Hz epoched EEG data if the >> epochs are long enough and numerous enough). For me the only solutions >> (other than shortening the epochs or downsampling the data, which might not >> be good options depending on your research question) were to use a >> Unix-based operating system (like Mac OS) or to upgrade my Windows (I had >> errors like this when using a 32-bit version of Windows with 2 GB of RAM, >> but not so much after I upgraded to 64-bit and 8 GB of RAM). I'm not sure >> if this is the issue you're having, though. >> >> >> >> Best, >> >> Steve >> >> >> >> >> >> >> Stephen Politzer-Ahles >> New York University, Abu Dhabi >> Neuroscience of Language Lab >> http://www.nyu.edu/projects/politzer-ahles/ >> >> >> >> On Mon, Mar 31, 2014 at 7:02 PM, wrote: >> >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. Fieldtrip ICA crashes Matlab (Hwee Ling Lee) >> 2. Re: plotting interpolated sources with ft_sourceplot >> (J?rn M. Horschig) >> 3. Re: help about ' fieldtrip2fiff ' (Gio Piantoni) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Mon, 31 Mar 2014 16:48:34 +0200 >> From: Hwee Ling Lee >> To: FieldTrip discussion list >> Subject: [FieldTrip] Fieldtrip ICA crashes Matlab >> Message-ID: >> > poVtb-1ApZuDQ at mail.gmail.com> >> Content-Type: text/plain; charset="iso-8859-1" >> >> Dear all, >> >> I'm encountering a problem with running ICA in Matlab. After ICA, when I >> tried to plot the components, Matlab keeps prompting an internal problem >> and needs to be closed. I wonder why this is the case. Could someone >> please >> tell me what went wrong? >> >> Here's part of my script for ICA: >> >> cfg = []; % if data were cleaned, then use this >> >> if sub == 5 %|| sub == 7 >> cfg.channel = {'all', '-AFz', '-FT7'}; >> elseif sub == 7 >> cfg.channel = {'all' '-AFz'}; >> else >> cfg.channel = {'all'}; >> end >> >> % cfg.runica.pca = 121; % using the rank of my data >> % ic_data = ft_componentanalysis(cfg,cleandata); % if data were >> cleaned then use this >> ic_data = ft_componentanalysis(cfg, cleandata); >> >> % after ICA, look for components that we want to substract from >> our >> data, >> % only looking at ten channels (components) at a time >> cfg = []; >> cfg.dataset = rawdatafile; >> cfg.viewmode = 'component'; >> cfg.continuous = 'no'; >> cfg.blocksize = 8; >> cfg.channels = 'all'; >> cfg.layout = 'EEG1020.lay'; >> ft_databrowser(cfg,ic_data); >> >> >> The internal problem appears even when I downsampled my data from 5000 Hz >> to 1000 Hz. >> >> The internal problem appears also when I have short segments of my data >> (i.e. 2s per trial), and long segments of my data (i.e. 6s per trial). >> >> The memory of my PC workstation is: >> Maximum possible array: 60253 MB (6.318e+10 bytes) * >> Memory available for all arrays: 60253 MB (6.318e+10 bytes) * >> Memory used by MATLAB: 560 MB (5.872e+08 bytes) >> Physical Memory (RAM): 32685 MB (3.427e+10 bytes) >> >> Interestingly, this internal problem does not occur when I ran my script >> on >> my Macbook Pro. >> >> I'm feeling very lost here. Any help is highly appreciated. >> >> Cheers, >> Hweeling >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: < >> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140331/f756367f/attachment-0001.html >> > >> >> >> >> >> >> -- >> >> ================================================= >> Dr. rer. nat. Lee, Hwee Ling >> Postdoc >> German Center for Neurodegenerative Diseases (DZNE) Bonn >> >> Email 1: hwee-ling.leedzne.de >> Email 2: hweeling.leegmail.com >> >> >> >> https://sites.google.com/site/hweelinglee/home >> >> Correspondence Address: >> Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany >> ================================================= >> > > > > -- > ================================================= > Dr. rer. nat. Lee, Hwee Ling > Postdoc > German Center for Neurodegenerative Diseases (DZNE) Bonn > > Email 1: hwee-ling.leedzne.de > Email 2: hweeling.leegmail.com > > https://sites.google.com/site/hweelinglee/home > > Correspondence Address: > Ernst-Robert-Curtius Strasse 12, 53117, Bonn, Germany > ================================================= > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.todorovic at fcdonders.ru.nl Thu Apr 3 00:54:42 2014 From: a.todorovic at fcdonders.ru.nl (Todorovic, A.) Date: Thu, 3 Apr 2014 00:54:42 +0200 (CEST) Subject: [FieldTrip] denoising data In-Reply-To: <800964494.215951.1396478020373.JavaMail.root@monoceros.zimbra.ru.nl> Message-ID: <124252612.215995.1396479282885.JavaMail.root@monoceros.zimbra.ru.nl> Dear 'trippers, I'm curious to hear your thoughts on how to best denoise data. What I'm doing is working, but I'd like to hear whether it's logical or reasonable. In particular, I have two issues. One is that I use ICA to remove blinks, so I have to fit denoising into a pipeline that incorporates ICA (which, I am guessing, works well only without including reference channels). The other is that I see there are two functions for denoising, ft_denoise_synthetic and ft_denoise_pca. In sum (1) I'm not really sure WHEN the best moment for denoising is, given that I use ICA, and (2) I don't understand when it's better to use ft_denoise_synthetic and when ft_denoise_pca. I do see that ft_denoise_pca has the option of preprocessing reference channels separately, which makes it easier to use after ICA. I used to know only about the first function, and my solution was to do ft_denoise_synthetic (using the 'G3BR' option) prior to the ICA. Then I would remove components which contain artifacts, and continue with making ERF/TFRs/whatever. This produces data that is somewhat cleaner than when I skip the denoising step. I was curious about the ft_denoise_pca when I saw it, so I tried running it on filtered, preprocessed data that I had after I rejected ICA components. [In the process of doing ICA, I used the ft_denoise_synthetic option, as above.] This produced a different TFR at the end of the road, which again looked cleaner. Significantly cleaner, actually, but N=1. Now I'm not sure if it was a logical step to use both denoising functions, and if it would have been a better idea to do things differently. I'd like to hear both whether something in the logic is wrong, and whether it's inelegant. Cheers, Ana From haiteng.jiang at gmail.com Thu Apr 3 07:53:36 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Thu, 3 Apr 2014 07:53:36 +0200 Subject: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data Message-ID: Dear Nithin, Cluster statistic works both for MEG and EEG data since the machinery is the same . You can organize the Non-FT in the Fieldtrip style. Please not that FT have a data structure (channel*frequency*time ), so you need to transpose your data matrix first. Besides , you also need to define the layout of your channels , then you know the neighbors of channels (see ft_prepare_neighbours) because clusters are formed on the basis of temporal, spatial and spectral adjacency. For more information, please have a look at the tutorial again http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq. All the best, Haiteng > > Message: 6 > Date: Wed, 2 Apr 2014 10:23:01 -0400 > From: "Nithin Krishna" > To: "list, FieldTrip discussion" > Subject: [FieldTrip] Question on Cluster-based permutation tests on > time-frequency data > Message-ID: <20140402T102301Z_155300170001 at mprc.umaryland.edu> > Content-Type: text/plain; charset="utf-8" > > Dear All, > I read the tutorial section on Cluster-based permutation tests on > time-frequency data as well as the Maris and Oostenveld, Journal of > Neuroscience Methods, 2007 report. I am interested in setting up a ERP > experiment on EEG data in this regard I like the procedure and processing > section of the tutorial, however I would like to know if there is any > section for EEG, I understand that megplanar is specific for MEG. > Also is it possible to use 3D matrix (TFR) (time, Freq channels ) non > feild trip output to run the cluster based permutation tests. > Looking forward > Nithin > > > > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Thu Apr 3 08:27:30 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Thu, 3 Apr 2014 08:27:30 +0200 Subject: [FieldTrip] denoising data Message-ID: > > Dear Ana, > If I understand correctly , we use ft_denoise_synthetic and ft_denoise_pca to reduce noise due to recording (e.g. environment noise , thermal noise... ) not the brain signal artefact (e.g eye blink). Normally ,I use these two functions in the very early stage . Best, Haiteng > > Message: 5 > Date: Thu, 3 Apr 2014 00:54:42 +0200 (CEST) > From: "Todorovic, A." > To: FieldTrip List > Subject: [FieldTrip] denoising data > Message-ID: > < > 124252612.215995.1396479282885.JavaMail.root at monoceros.zimbra.ru.nl> > Content-Type: text/plain; charset=utf-8 > > Dear 'trippers, > > I'm curious to hear your thoughts on how to best denoise data. What I'm > doing is working, but I'd like to hear whether it's logical or reasonable. > > In particular, I have two issues. One is that I use ICA to remove blinks, > so I have to fit denoising into a pipeline that incorporates ICA (which, I > am guessing, works well only without including reference channels). > > The other is that I see there are two functions for denoising, > ft_denoise_synthetic and ft_denoise_pca. > > In sum (1) I'm not really sure WHEN the best moment for denoising is, > given that I use ICA, and (2) I don't understand when it's better to use > ft_denoise_synthetic and when ft_denoise_pca. I do see that ft_denoise_pca > has the option of preprocessing reference channels separately, which makes > it easier to use after ICA. > > I used to know only about the first function, and my solution was to do > ft_denoise_synthetic (using the 'G3BR' option) prior to the ICA. Then I > would remove components which contain artifacts, and continue with making > ERF/TFRs/whatever. This produces data that is somewhat cleaner than when I > skip the denoising step. > > I was curious about the ft_denoise_pca when I saw it, so I tried running > it on filtered, preprocessed data that I had after I rejected ICA > components. [In the process of doing ICA, I used the ft_denoise_synthetic > option, as above.] This produced a different TFR at the end of the road, > which again looked cleaner. Significantly cleaner, actually, but N=1. > > Now I'm not sure if it was a logical step to use both denoising functions, > and if it would have been a better idea to do things differently. I'd like > to hear both whether something in the logic is wrong, and whether it's > inelegant. > > Cheers, > Ana > > > ------------------------------ > > Message: 6 > Date: Thu, 3 Apr 2014 07:53:36 +0200 > From: Haiteng Jiang > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] Question on Cluster-based permutation tests > on time-frequency data > Message-ID: > 2+knQ6iHyZqSfyu0r2xvLessob65w at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Dear Nithin, > > Cluster statistic works both for MEG and EEG data since the machinery > is the same . You can organize the Non-FT in the Fieldtrip style. > Please not that FT have a data structure (channel*frequency*time ), so you > need to transpose your data matrix first. Besides , you also need to > define the layout of your channels , then you know the neighbors of > channels (see ft_prepare_neighbours) because clusters are formed on the > basis of temporal, spatial and spectral adjacency. For more information, > please have a look at the tutorial again > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq. > > All > the best, > > Haiteng > > > > > > > > Message: 6 > > Date: Wed, 2 Apr 2014 10:23:01 -0400 > > From: "Nithin Krishna" > > To: "list, FieldTrip discussion" > > Subject: [FieldTrip] Question on Cluster-based permutation tests on > > time-frequency data > > Message-ID: <20140402T102301Z_155300170001 at mprc.umaryland.edu> > > Content-Type: text/plain; charset="utf-8" > > > > Dear All, > > I read the tutorial section on Cluster-based permutation tests on > > time-frequency data as well as the Maris and Oostenveld, Journal of > > Neuroscience Methods, 2007 report. I am interested in setting up a ERP > > experiment on EEG data in this regard I like the procedure and processing > > section of the tutorial, however I would like to know if there is any > > section for EEG, I understand that megplanar is specific for MEG. > > Also is it possible to use 3D matrix (TFR) (time, Freq channels ) non > > feild trip output to run the cluster based permutation tests. > > Looking forward > > Nithin > > > > > > > > -- > Haiteng Jiang > PhD candidate > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Visiting address > Room 2.32 > Donders Centre for Cognitive Neuroimaging > Kapittelweg 29 > 6525 EN Nijmegen > the Netherlands > > Tel.: +31 (0)243668291 > Web: https://sites.google.com/site/haitengjiang/ > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140403/31c1ca38/attachment.html > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 8 > **************************************** > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.roux at bcbl.eu Thu Apr 3 12:07:11 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Thu, 3 Apr 2014 12:07:11 +0200 (CEST) Subject: [FieldTrip] denoising data In-Reply-To: Message-ID: <867980492.1251689.1396519631090.JavaMail.root@bcbl.eu> Hi Ana, Haiteng and everyone else, I am joining in on this discussion as I am thinking about a way of combining ft_componentanalysis with ft_denoise_pca to remove EOG, ECG and EMG activity. The pipeline that I would like to try is the following: %% ICA decomposition cfg = []; cfg.method = 'runica'; ICs = ft_componentanalysis(cfg,meg_data); % here meg_data has undergone basic preprocessing including bp-filtering as well as & ft_artifact_jump and ft_artifact_clip %% Substract artifacts from ICA components cfg = []; cfg.refchannel = eeg_data.label(1); % eeg_data contains the EOG (1-2), ECG(3) and EMG(4) ref-channels cfg.channel = {'runica'}; cfg.zscore = 'yes'; cfg.pertrial = 'yes'; cfg.trials = 'all'; [ICs] = ft_denoise_pca(cfg,ICs,eeg_data); % substract VEOG activity from all ICs %% The idea is to repeat this step for all refchannels in order to substract the artifacts. Then backproject ICs to original data: %% Backproject data cfg = []; meg_data = ft_rejectcomponent(cfg,ICs,meg_data); The advantage is that you don't have to "throw away" the entire component as sometimes ICs contain a mix of artifacts and brain activity. So by regressing out the artifacts, you could avoid throwing away the good stuff. However, I don't know if this is a good approach. There may be pitfalls that I am not thinking of right now. Therefore any suggestions or comments about whether this is a good idea would be very welcome! I am hoping that some of the ft_guru's could drop a line or two about this! Fred ----- Original Message ----- From: "Haiteng Jiang" To: fieldtrip at science.ru.nl Sent: Thursday, April 3, 2014 8:27:30 AM Subject: Re: [FieldTrip] denoising data Dear Ana, If I understand correctly , we use ft_denoise_synthetic and ft_denoise_pca to reduce noise due to recording (e.g. environment noise , thermal noise... ) not the brain signal artefact (e.g eye blink). Normally ,I use these two functions in the very early stage . Best, Haiteng Message: 5 Date: Thu, 3 Apr 2014 00:54:42 +0200 (CEST) From: "Todorovic, A." < a.todorovic at fcdonders.ru.nl > To: FieldTrip List < fieldtrip at donders.ru.nl > Subject: [FieldTrip] denoising data Message-ID: < 124252612.215995.1396479282885.JavaMail.root at monoceros.zimbra.ru.nl > Content-Type: text/plain; charset=utf-8 Dear 'trippers, I'm curious to hear your thoughts on how to best denoise data. What I'm doing is working, but I'd like to hear whether it's logical or reasonable. In particular, I have two issues. One is that I use ICA to remove blinks, so I have to fit denoising into a pipeline that incorporates ICA (which, I am guessing, works well only without including reference channels). The other is that I see there are two functions for denoising, ft_denoise_synthetic and ft_denoise_pca. In sum (1) I'm not really sure WHEN the best moment for denoising is, given that I use ICA, and (2) I don't understand when it's better to use ft_denoise_synthetic and when ft_denoise_pca. I do see that ft_denoise_pca has the option of preprocessing reference channels separately, which makes it easier to use after ICA. I used to know only about the first function, and my solution was to do ft_denoise_synthetic (using the 'G3BR' option) prior to the ICA. Then I would remove components which contain artifacts, and continue with making ERF/TFRs/whatever. This produces data that is somewhat cleaner than when I skip the denoising step. I was curious about the ft_denoise_pca when I saw it, so I tried running it on filtered, preprocessed data that I had after I rejected ICA components. [In the process of doing ICA, I used the ft_denoise_synthetic option, as above.] This produced a different TFR at the end of the road, which again looked cleaner. Significantly cleaner, actually, but N=1. Now I'm not sure if it was a logical step to use both denoising functions, and if it would have been a better idea to do things differently. I'd like to hear both whether something in the logic is wrong, and whether it's inelegant. Cheers, Ana ------------------------------ Message: 6 Date: Thu, 3 Apr 2014 07:53:36 +0200 From: Haiteng Jiang < haiteng.jiang at gmail.com > To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] Question on Cluster-based permutation tests on time-frequency data Message-ID: Content-Type: text/plain; charset="iso-8859-1" Dear Nithin, Cluster statistic works both for MEG and EEG data since the machinery is the same . You can organize the Non-FT in the Fieldtrip style. Please not that FT have a data structure (channel*frequency*time ), so you need to transpose your data matrix first. Besides , you also need to define the layout of your channels , then you know the neighbors of channels (see ft_prepare_neighbours) because clusters are formed on the basis of temporal, spatial and spectral adjacency. For more information, please have a look at the tutorial again http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq . All the best, Haiteng > > Message: 6 > Date: Wed, 2 Apr 2014 10:23:01 -0400 > From: "Nithin Krishna" < nkrishna at mprc.umaryland.edu > > To: "list, FieldTrip discussion" < fieldtrip at science.ru.nl > > Subject: [FieldTrip] Question on Cluster-based permutation tests on > time-frequency data > Message-ID: < 20140402T102301Z_155300170001 at mprc.umaryland.edu > > Content-Type: text/plain; charset="utf-8" > > Dear All, > I read the tutorial section on Cluster-based permutation tests on > time-frequency data as well as the Maris and Oostenveld, Journal of > Neuroscience Methods, 2007 report. I am interested in setting up a ERP > experiment on EEG data in this regard I like the procedure and processing > section of the tutorial, however I would like to know if there is any > section for EEG, I understand that megplanar is specific for MEG. > Also is it possible to use 3D matrix (TFR) (time, Freq channels ) non > feild trip output to run the cluster based permutation tests. > Looking forward > Nithin > > > > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: < http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140403/31c1ca38/attachment.html > ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip End of fieldtrip Digest, Vol 41, Issue 8 **************************************** -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From luke.bloy at gmail.com Thu Apr 3 20:19:29 2014 From: luke.bloy at gmail.com (Luke Bloy) Date: Thu, 3 Apr 2014 14:19:29 -0400 Subject: [FieldTrip] fiff_read_epochs undefined Message-ID: I'm having trouble reading in headers from fif files. it seems like read_header now needs a file in /external/mne but that isn't being automatically added to the path via (ft_defaults) %----------------------------------- megFile = 'T110_012413_eyes_closed1_raw_tsss_mc.fif'; >> hdr = ft_read_header(megFile); grad = ft_convert_units(hdr.grad,'m'); 306 MEG channel locations transformed Undefined function 'fiff_read_epochs' for input arguments of type 'char'. Error in ft_read_header (line 1386) epochs = fiff_read_epochs(filename); %----------------------------------- am I missing something? THanks Luke -------------- next part -------------- An HTML attachment was scrubbed... URL: From luke.bloy at gmail.com Thu Apr 3 21:03:59 2014 From: luke.bloy at gmail.com (Luke Bloy) Date: Thu, 3 Apr 2014 15:03:59 -0400 Subject: [FieldTrip] fiff_read_epochs undefined In-Reply-To: References: Message-ID: Sorry ignore this last email. An update to the newest source fixed the issue. Sorry On Thu, Apr 3, 2014 at 2:19 PM, Luke Bloy wrote: > I'm having trouble reading in headers from fif files. > > it seems like read_header now needs a file in /external/mne but that isn't > being automatically added to the path via (ft_defaults) > > %----------------------------------- > megFile = 'T110_012413_eyes_closed1_raw_tsss_mc.fif'; > >> hdr = ft_read_header(megFile); > grad = ft_convert_units(hdr.grad,'m'); > 306 MEG channel locations transformed > Undefined function 'fiff_read_epochs' for input arguments of type 'char'. > > Error in ft_read_header (line 1386) > epochs = fiff_read_epochs(filename); > %----------------------------------- > > > am I missing something? > > THanks > Luke > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Fri Apr 4 02:08:02 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Fri, 4 Apr 2014 00:08:02 +0000 Subject: [FieldTrip] plotting interpolated sources with ft_sourceplot In-Reply-To: <533B22CA.8040305@donders.ru.nl> References: <84fe194b777b4895b25ff61488790168@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339129B.1030608@donders.ru.nl> <2f5cbc8ccde045b4bb614b98d23f3757@SIXPR03MB368.apcprd03.prod.outlook.com>, <53392ACA.2030108@donders.ru.nl> <23248628c6974213b918bc8d5c5c01f7@SIXPR03MB368.apcprd03.prod.outlook.com>, <5339578D.4050308@donders.ru.nl> <53398239.1010004@donders.ru.nl>, <533985D8.4080504@donders.ru.nl> <533AD84B.6060600@donders.ru.nl> , <533B22CA.8040305@donders.ru.nl> Message-ID: Hello Jorn and Robert, Can you please keep me updated on your plans for the previously discussed functions? Just to remind you, I wish apply the LCMV beamformer on continuous data with ICA components instead of electrodes. Kind regards, Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" Sent: Wednesday, 2 April 2014 7:04 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot Hi Robert, yes, I thought so, that's why I put it on the agenda for tomorrow's meeting to discuss in more detail to figure out what needs to be done :) Best, Jörn On 4/1/2014 7:19 PM, Robert Oostenveld wrote: > Hi Jorn > > I was browsing the FT list and see that you got involved with this question from Tyler. I can imagine there being problems with a pipeline like this > > preprocessing -> componentanalysis -> timelockanalysis -> dipolefitting > > although it should (i.e. "is meant to") work by fitting dipoles to component topographies. But the code is not frequently used like this and it might be possible that there has been regression of the code (i.e bugs in the latest version that were not there before). > > With sourceanalysis it depends on the method. Covariance estimates between components does not make much sense in the further inversion, and thereby beamforming won’t work. MNE should in principle work, but not with an estimated data covariance but rather a scaled identity covariance. > > Given the uncertain level of support , but clear expectations on what should (and should not) work, I suggest to file it as “bug” (i.e. the issue is that it should be tested) and to write a test script that goes (with e.g. some simulated data) over the various options. > > best regards, > Robert > > > On 01 Apr 2014, at 17:16, Jörn M. Horschig wrote: > >> Hi Tyler, >> >> any reason why you don't want to go back to sensor-space but stay in component-space with your data? I would assume that the error will be gone if you use the back-projected data (ft_rejectcomponent, with cfg.component = []). >> >> Best, >> Jörn >> >> On 4/1/2014 8:15 AM, Tyler Grummett wrote: >>> Hey Jorn, >>> >>> In addition to my previous emails, Ive been trying to debug the functions. >>> >>> In ft_sourceanalysis, line 661 to 677: >>> >>> % HACK: use the default code >>> % select the channels of interest >>> [dum, datchanindx] = match_str(cfg.channel, data.label); >>> if strcmp(data.dimord, 'chan_time') >>> % It is in principle possible to have timelockanalysis with >>> % keeptrial=yes and only a single trial in the raw data. >>> % In that case the covariance should be represented as Nchan*Nchan >>> data.avg = data.avg(datchanindx,:); >>> %data.cov = reshape(data.cov, length(datchanindx), length(datchanindx)); >>> data.cov = data.cov(datchanindx,datchanindx); >>> else >>> data.avg = data.avg(datchanindx,:); >>> data.cov = data.cov(:,datchanindx,datchanindx); >>> data.trial = data.trial(:,datchanindx,:); >>> end >>> data.label = data.label(datchanindx); >>> Nchans = length(data.label); >>> >>> I found that my cfg.channel is []; and the data.label is all my ICA components labelled ica_001 etc. >>> >>> So it is returned as a []; >>> which means data.cov = []; >>> >>> I think then it will crash later parts of the code. Does this function work on ICA components? >>> >>> I ran the ICA in eeglab. >>> >>> Tyler. >>> >>> ************************* >>> >>> Tyler Grummett ( BBSc, BSc(Hons I)) >>> PhD Candidate >>> Brain Signals Laboratory >>> Flinders University >>> Rm 5A301 >>> Ext 66124 >>> >>> ________________________________________ >>> From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" >>> Sent: Tuesday, 1 April 2014 1:42 AM >>> To: fieldtrip at science.ru.nl >>> Subject: Re: [FieldTrip] plotting interpolated sources with ft_sourceplot >>> >>> just to clarify and be precise >>>> The pos-matrix has to be a regular 3D grid, i.e. be representable as a >>>> 3x3x3 matrix. >>> it actually does not have to be as you can also beam individual grid >>> points, but if you have a .dim field, then is has to be like above. But >>> that does not affect the rest of the mail I wrote ;) >>> >>> >>>> I am not quite sure how the sourceinterpolate function is handeling >>>> the fact that you do not have that .dim field. Apparently, it is also >>>> confused ;) >>>> >>>> Do you want to reconstruct only some voxels? From your code it seems >>>> that you want to cover the whole brain with a 1cm resolution. If the >>>> latter is the case, maybe restart with creating your forward model by >>>> following the tutorial that I posted in my previous mail. There are >>>> some sanity checks that can help you figuring out if you are doing the >>>> correct thing. If the former one is the case, please explain again >>>> what exactly you want to achieve and how you are building your forward >>>> model. >>>> >>>> Best, >>>> Jörn >>>> >>>> btw, there's nothing wrong with being a PhD student, it's just a >>>> matter of experience in practice and theory as in all domains in life ;) >>>> >>>> >>>> On 3/31/2014 3:15 PM, Tyler Grummett wrote: >>>>> Hey Jorn, >>>>> >>>>> Yes I am definitely confused haha, this stuff is way out of my league >>>>> as a PhD student. >>>>> Anyway, I feel we are getting somewhere. >>>>> >>>>> timelock = >>>>> >>>>> avg: [121x19767 double] >>>>> var: [121x19767 double] >>>>> time: [1x19767 double] >>>>> dof: [121x19767 double] >>>>> label: {1x121 cell} >>>>> dimord: 'chan_time' >>>>> cov: [121x121 double] >>>>> elec: [1x1 struct] >>>>> cfg: [1x1 struct] >>>>> >>>>> source = >>>>> >>>>> time: [1x19767 double] >>>>> pos: [642x3 double] >>>>> inside: [642x1 double] >>>>> outside: [] >>>>> method: 'average' >>>>> avg: [1x1 struct] >>>>> cfg: [1x1 struct] >>>>> >>>>> sourceInt = >>>>> >>>>> time: [1x19767 double] >>>>> avg: [1x1 struct] >>>>> pos: [16777216x3 double] >>>>> dim: [256 256 256] >>>>> inside: [1x16777216 double] >>>>> outside: [1x0 double] >>>>> coordsys: 'ctf' >>>>> unit: 'mm' >>>>> cfg: [1x1 struct] >>>>> >>>>> Given what I said last time, I might not comment on the differences. >>>>> I hope you can see something wrong. >>>>> >>>>> One thing I should mention is that the data is continuous, around 30 >>>>> seconds. Therefore there is only one trial, >>>>> is that an issue? >>>>> >>>>> Tyler >>>>> >>>>> ************************* >>>>> >>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>> PhD Candidate >>>>> Brain Signals Laboratory >>>>> Flinders University >>>>> Rm 5A301 >>>>> Ext 66124 >>>>> >>>>> ________________________________________ >>>>> From: fieldtrip-bounces at science.ru.nl >>>>> on behalf of "Jörn M. Horschig" >>>>> >>>>> Sent: Monday, 31 March 2014 10:24 PM >>>>> To: FieldTrip discussion list >>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>> ft_sourceplot >>>>> >>>>> Hi Tyler, >>>>> >>>>> there is not much inherently different between time- and >>>>> freuqency-domain beamformer, at least in terms of computing the forward >>>>> and the inverse solution. But I see that you are obviously confused, so >>>>> let me try to help you out and shed some light on what you are actually >>>>> doing ;) >>>>> >>>>> >>>>>> I had a look at my variables. >>>>>> >>>>>> source.avg = >>>>>> >>>>>> pow: [642x1 double] >>>>>> filter: {642x1 cell} >>>>>> >>>>>> sourceInt.avg = >>>>>> >>>>>> pow: [16777216x1 double] >>>>>> >>>>>> So clearly, as both variables are completely different. Something >>>>>> has gone wrong. >>>>> No, that is actually how it should be. From below you can see that your >>>>> MRI has 3-dimensions, each with 256 elements, that is 256*256*256 = >>>>> 16777216 elements. In line with source.avg.pow, you should see that your >>>>> 'grid' consists of 642 elements, so you were computing your source >>>>> activity on a grid of in total 642 elements. Then you used the original >>>>> MRI to interpolate from 642 to these 16 million grid points. Actually, >>>>> since you specific cfg.downsample = 2, it should have been only 8 >>>>> million points, so that's where things already get a bit weird. >>>>> >>>>> So let's go into some sanity checks: >>>>> 1. are you using the latest version (or a recent, i.e. from this year) >>>>> of FielTrip? >>>>> 2. sourceInt should look something like this, does it? >>>>> >>>>> source_diff_int = >>>>> inside: [46x55x46 logical] >>>>> avg: [1x1 struct] >>>>> dim: [46 55 46] >>>>> transform: [4x4 double] >>>>> anatomy: [46x55x46 double] >>>>> unit: 'mm' >>>>> cfg: [1x1 struct] >>>>> >>>>> >>>>> >>>>> 3. source should look something like this: >>>>> >>>>> source = >>>>> dim: [20 25 22] >>>>> freq: 54.8287 >>>>> cumtapcnt: [338x1 double] >>>>> pos: [11000x3 double] >>>>> inside: [1x5798 double] >>>>> outside: [1x5202 double] >>>>> method: 'average' >>>>> avg: [1x1 struct] >>>>> trialinfo: [338x1 double] >>>>> cfg: [1x1 struct] >>>>> >>>>> 4. also check your grid, should be something like this: >>>>> >>>>> sourcemodel = >>>>> >>>>> pos: [11000x3 double] >>>>> dim: [20 25 22] >>>>> unit: 'cm' >>>>> inside: [1x5798 double] >>>>> outside: [1x5202 double] >>>>> params: [1x1 struct] >>>>> initial: [4x4 double] >>>>> cfg: [1x1 struct] >>>>> >>>>> >>>>> Of course, it should all look a bit different, because you are using >>>>> LCMV, but essentially it should be the same. Lastly, you can check other >>>>> source plotting methods, like 'ortho' or try to plot the source >>>>> structure rather than the sourceInt structure. In the end, the error >>>>> must be somewhere in your grid, be it in .pos or .inside, because >>>>> FieldTrip thinks that there is only one voxel to be plotted. There are >>>>> other things that may be the issue, but I am not sure about these. So, I >>>>> would suggest that you play a bit around and see where the error might >>>>> come from (e.g. follow this tutorial: >>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformingextended and adapt the >>>>> steps that you need for LCMV, maybe also check out: >>>>> http://fieldtrip.fcdonders.nl/tutorial/connectivity#connectivity_between_meg_virtual_channel_and_emg >>>>> >>>>> there, LCMV is used, but on one voxel only) >>>>> >>>>> Best, >>>>> Jörn >>>>> >>>>>> The next part of my code is the following: >>>>>> >>>>>> % interpolate sources >>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>> mri = ft_volumereslice([], mri); >>>>>> >>>>>> cfg = []; >>>>>> cfg.downsample = 2; >>>>>> cfg.parameter = 'avg.pow'; >>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>> parameter >>>>>> % does not vary over time, therefore the time >>>>>> dimension is not needed. >>>>>> >>>>>> mri = >>>>>> >>>>>> anatomy: [256x256x256 double] >>>>>> dim: [256 256 256] >>>>>> transform: [4x4 double] >>>>>> coordsys: 'ctf' >>>>>> unit: 'mm' >>>>>> cfg: [1x1 struct] >>>>>> >>>>>> I cant really see if the data works in the tutorial because it >>>>>> doesnt appear as though fieldtrip has a tutorial on lcmv >>>>>> beamformers, they seem to stick to frequency domain beamformers. >>>>>> >>>>>> Ive been wrong before though, >>>>>> >>>>>> thanks for your help. >>>>>> >>>>>> Tyler >>>>>> >>>>>> ************************* >>>>>> >>>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>>> PhD Candidate >>>>>> Brain Signals Laboratory >>>>>> Flinders University >>>>>> Rm 5A301 >>>>>> Ext 66124 >>>>>> >>>>>> ________________________________________ >>>>>> From: fieldtrip-bounces at science.ru.nl >>>>>> on behalf of "Jörn M. Horschig" >>>>>> >>>>>> Sent: Monday, 31 March 2014 7:13 PM >>>>>> To: FieldTrip discussion list >>>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>>> ft_sourceplot >>>>>> >>>>>> Hi Tyler, >>>>>> >>>>>> hm, okay, it could be that the issue with the leadfield and with the >>>>>> plot are related, but it could also be that they are separate issues. I >>>>>> just saw that you posted the same 'problem' on bugzilla and included a >>>>>> picture. Maybe for next time, include a picture on the mailinglist and >>>>>> just create a bug on bugzilla if you are sure it is a bug in Fieldtrip >>>>>> and not if you are not sure. That saves us a lot of time in separating >>>>>> code issues from user problems ;) >>>>>> >>>>>> So, back to you problem. It seems that your reconstruction results in >>>>>> one voxel only. Are you sure that your grid consistents of more than >>>>>> just one position? So, for example check the size of the matrices in >>>>>> source.avg, source- and headmodel, etc. >>>>>> >>>>>> Also, you can check in Matlab the respective fields of source and >>>>>> sourceInt and see whether that makes sense. >>>>>> >>>>>> Lastly, a neat way to check is always to use your code on data from the >>>>>> tutorial, and vice versa, use code from the tutorial on your data and >>>>>> see whether that works. Both should give sensible results, and if one >>>>>> does not, you know where to start looking for a solution ;) >>>>>> >>>>>> Best, >>>>>> Jörn >>>>>> >>>>>> >>>>>> On 3/31/2014 9:41 AM, Tyler Grummett wrote: >>>>>>> Hey Jorn, >>>>>>> >>>>>>> Previously I have let ft_sourceanalysis do a lead field because if >>>>>>> I use the following code: >>>>>>> >>>>>>> % compute lead field ( apparently source analysis computes >>>>>>> % lead field anyway >>>>>>> cfg = []; >>>>>>> cfg.elec = timelock.elec; >>>>>>> cfg.vol = vol; >>>>>>> cfg.reducerank = 3; >>>>>>> cfg.grid.resolution = 1; % use a 3-D grid with a 1 >>>>>>> cm resolution >>>>>>> cfg.grid.unit = 'cm'; >>>>>>> cfg.normalize = 'yes'; % if you are not >>>>>>> contrasting the activity of interest again another condition or >>>>>>> baseline time-window >>>>>>> grid = ft_prepare_leadfield( cfg); %% THIS IS WHERE >>>>>>> I AM UP TO >>>>>>> >>>>>>> and then calculate the source analysis: >>>>>>> >>>>>>> % Source Analysis: without contrasting condition >>>>>>> cfg = []; >>>>>>> cfg.method = 'lcmv'; >>>>>>> cfg.grid = grid; >>>>>>> cfg.vol = vol; >>>>>>> % cfg.grid.pos = maxpos; >>>>>>> cfg.keepfilter = 'yes'; >>>>>>> cfg.dics.projectnoise = 'yes'; >>>>>>> % cfg.dics.lambda = 0; >>>>>>> source = ft_sourceanalysis( cfg, timelock); >>>>>>> >>>>>>> then I get an error than says: >>>>>>> >>>>>>> Error using * >>>>>>> Inner matrix dimensions must agree. >>>>>>> >>>>>>> Error in beamformer_lcmv (line 268) >>>>>>> filt = pinv(lf' * invCy * lf) * lf' * >>>>>>> invCy; % van Veen eqn. 23, use >>>>>>> PINV/SVD to cover rank deficient leadfield >>>>>>> >>>>>>> Error in ft_sourceanalysis (line 794) >>>>>>> dip(i) = beamformer_lcmv(grid, sens, vol, >>>>>>> squeeze_avg, squeeze(Cy(i,:,:)), >>>>>>> optarg{:}); >>>>>>> >>>>>>> I just removed the leadfield code and it successfully ran. I could >>>>>>> also interpolate it later. >>>>>>> Is this the correct approach. >>>>>>> >>>>>>> Thankyou in advance! >>>>>>> >>>>>>> Tyler >>>>>>> >>>>>>> ************************* >>>>>>> >>>>>>> Tyler Grummett ( BBSc, BSc(Hons I)) >>>>>>> PhD Candidate >>>>>>> Brain Signals Laboratory >>>>>>> Flinders University >>>>>>> Rm 5A301 >>>>>>> Ext 66124 >>>>>>> >>>>>>> ________________________________________ >>>>>>> From: fieldtrip-bounces at science.ru.nl >>>>>>> on behalf of "Jörn M. Horschig" >>>>>>> >>>>>>> Sent: Monday, 31 March 2014 5:30 PM >>>>>>> To: FieldTrip discussion list >>>>>>> Subject: Re: [FieldTrip] plotting interpolated sources with >>>>>>> ft_sourceplot >>>>>>> >>>>>>> Hi Tyler, >>>>>>> >>>>>>> what you are describing sounds to me like the center bias of the >>>>>>> beamformer. Did you contrast the activity with anything, or did you >>>>>>> normalize your leadfield? >>>>>>> Check this out: >>>>>>> http://fieldtrip.fcdonders.nl/tutorial/beamformer#source_analysiswithout_contrasting_condition >>>>>>> >>>>>>> >>>>>>> Best, >>>>>>> Jörn >>>>>>> >>>>>>> On 3/31/2014 5:46 AM, Tyler Grummett wrote: >>>>>>>> I have been trying to plot my interpolated source data using the >>>>>>>> code: >>>>>>>> >>>>>>>> % interpolate sources >>>>>>>> mri = ft_read_mri('Subject01.mri'); >>>>>>>> mri = ft_volumereslice([], mri); >>>>>>>> cfg = []; >>>>>>>> cfg.downsample = 2; >>>>>>>> cfg.parameter = 'avg.pow'; >>>>>>>> sourceInt = ft_sourceinterpolate( cfg, source, mri); >>>>>>>> sourceInt = rmfield( sourceInt,'time'); % The avg.pow >>>>>>>> parameter >>>>>>>> % does not vary over time, therefore the time >>>>>>>> dimension >>>>>>>> is not needed. >>>>>>>> >>>>>>>> % Plot interpolated data >>>>>>>> cfg = []; %#ok >>>>>>>> cfg.method = 'ortho'; % spline >>>>>>>> cfg.funparameter = 'avg.pow'; >>>>>>>> ft_sourceplot( cfg, sourceInt); >>>>>>>> >>>>>>>> However the figure that comes up just had orange squares in the >>>>>>>> subplots. >>>>>>>> >>>>>>>> I dont know where Ive gone wrong. >>>>>>>> >>>>>>>> >>>>>>>> Tyler >>>>>>>> >>>>>>>> >>>>>>>> ************************* >>>>>>>> >>>>>>>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>>>>>>> /PhD Candidate/ >>>>>>>> /Brain Signals Laboratory/ >>>>>>>> /Flinders University/ >>>>>>>> /Rm 5A301/ >>>>>>>> /Ext 66124/ >>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> fieldtrip mailing list >>>>>>>> fieldtrip at donders.ru.nl >>>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> -- >>>>>>> Jörn M. Horschig >>>>>>> PhD Student >>>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>>> Centre for Cognitive Neuroimaging >>>>>>> Radboud University Nijmegen >>>>>>> Neuronal Oscillations Group >>>>>>> FieldTrip Development Team >>>>>>> >>>>>>> P.O. Box 9101 >>>>>>> NL-6500 HB Nijmegen >>>>>>> The Netherlands >>>>>>> >>>>>>> Contact: >>>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>>> Tel: +31-(0)24-36-68493 >>>>>>> Web: http://www.ru.nl/donders >>>>>>> >>>>>>> Visiting address: >>>>>>> Trigon, room 2.30 >>>>>>> Kapittelweg 29 >>>>>>> NL-6525 EN Nijmegen >>>>>>> The Netherlands >>>>>>> >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>>> _______________________________________________ >>>>>>> fieldtrip mailing list >>>>>>> fieldtrip at donders.ru.nl >>>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> -- >>>>>> Jörn M. Horschig >>>>>> PhD Student >>>>>> Donders Institute for Brain, Cognition and Behaviour >>>>>> Centre for Cognitive Neuroimaging >>>>>> Radboud University Nijmegen >>>>>> Neuronal Oscillations Group >>>>>> FieldTrip Development Team >>>>>> >>>>>> P.O. Box 9101 >>>>>> NL-6500 HB Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> Contact: >>>>>> E-Mail: jm.horschig at donders.ru.nl >>>>>> Tel: +31-(0)24-36-68493 >>>>>> Web: http://www.ru.nl/donders >>>>>> >>>>>> Visiting address: >>>>>> Trigon, room 2.30 >>>>>> Kapittelweg 29 >>>>>> NL-6525 EN Nijmegen >>>>>> The Netherlands >>>>>> >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>>> _______________________________________________ >>>>>> fieldtrip mailing list >>>>>> fieldtrip at donders.ru.nl >>>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> -- >>>>> Jörn M. Horschig >>>>> PhD Student >>>>> Donders Institute for Brain, Cognition and Behaviour >>>>> Centre for Cognitive Neuroimaging >>>>> Radboud University Nijmegen >>>>> Neuronal Oscillations Group >>>>> FieldTrip Development Team >>>>> >>>>> P.O. Box 9101 >>>>> NL-6500 HB Nijmegen >>>>> The Netherlands >>>>> >>>>> Contact: >>>>> E-Mail: jm.horschig at donders.ru.nl >>>>> Tel: +31-(0)24-36-68493 >>>>> Web: http://www.ru.nl/donders >>>>> >>>>> Visiting address: >>>>> Trigon, room 2.30 >>>>> Kapittelweg 29 >>>>> NL-6525 EN Nijmegen >>>>> The Netherlands >>>>> >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>>>> _______________________________________________ >>>>> fieldtrip mailing list >>>>> fieldtrip at donders.ru.nl >>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> -- >>> Jörn M. Horschig >>> PhD Student >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognitive Neuroimaging >>> Radboud University Nijmegen >>> Neuronal Oscillations Group >>> FieldTrip Development Team >>> >>> P.O. Box 9101 >>> NL-6500 HB Nijmegen >>> The Netherlands >>> >>> Contact: >>> E-Mail: jm.horschig at donders.ru.nl >>> Tel: +31-(0)24-36-68493 >>> Web: http://www.ru.nl/donders >>> >>> Visiting address: >>> Trigon, room 2.30 >>> Kapittelweg 29 >>> NL-6525 EN Nijmegen >>> The Netherlands >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tyler.grummett at flinders.edu.au Fri Apr 4 07:23:48 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Fri, 4 Apr 2014 05:23:48 +0000 Subject: [FieldTrip] spatial and temporal ICA after beamformer Message-ID: Hello fieldtrip, I was wondering whether it was possible in the fieldtrip toolbox to run a spatial and temporal ICA on data after it has been run through ft_sourceanalysis (We can a LCMV beamformer on EEG data that had been timelocked). Currently it is saying that I need raw data for it to be processed. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Fri Apr 4 10:17:55 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Fri, 04 Apr 2014 10:17:55 +0200 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: References: Message-ID: <533E6AB3.3080003@donders.ru.nl> Hi Tyler, sorry, I realized too late that you want to use LCMV on ICA components - mostly because your approach resulted in many different erros ;). Afaik, it is not possible to use beamforming on ICA components. On Wednesday we talked about this in our weekly FieldTrip meeting and identified some occasions where FieldTrip is not handling IC-data well. This can lead to unexpected results and missing warnings or errors. However, you can use dipole modelling (like EEGlab does) or MNE if you want to. These should work with ICs. Any reason why you want to use LCMV on ICs? In theory, both steps constitute a spatial filter, so you can try to be smart and first to LCMV on all your channel level data, and then apply the LCMV spatial filter on the individual backprojected ICs. Somewhat a complicated procedure, but I think it would work? Best, Jörn On 4/4/2014 7:23 AM, Tyler Grummett wrote: > > Hello fieldtrip, > > > I was wondering whether it was possible in the fieldtrip toolbox to > run a spatial and temporal ICA on data after it has been run through > ft_sourceanalysis (We can a LCMV beamformer on EEG data that had been > timelocked). > > > Currently it is saying that I need raw data for it to be processed. > > > Tyler > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jan.schoffelen at donders.ru.nl Fri Apr 4 10:32:14 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Fri, 4 Apr 2014 10:32:14 +0200 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: <533E6AB3.3080003@donders.ru.nl> References: <533E6AB3.3080003@donders.ru.nl> Message-ID: Hi all, Allow me to chime in here. As I understand it Tyler wants to do ICA on the output of an LCMV beamformer. This is in general allowed, and can be done if you know how to handle the data. In Fieldtrip there is no pre-cooked way of doing it. What you need is to fool ft_componentanalysis into believing that your source reconstructed data is of the type 'raw'. To get started, you can have a look at http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors. In this particular tutorial, only a few 'virtual channels' are created. You probably want many of those, defined on a 3D grid. The only constraint there is probably the amount of RAM on your computer. Note that you want to do (and will do) temporal ICA in this case. Also, note that you probably should pre-PCA your data (this will be a parameter in the specs for the options for the ICA algorithm you are going to use). If you want to apply the ICA algorithm on amplitude envelope timeseries of band-limited activity, rumour has it that the fastica method works quite well. Cheers, Jan-Mathijs On Apr 4, 2014, at 10:17 AM, Jörn M. Horschig wrote: > Hi Tyler, > > sorry, I realized too late that you want to use LCMV on ICA components - mostly because your approach resulted in many different erros ;). Afaik, it is not possible to use beamforming on ICA components. On Wednesday we talked about this in our weekly FieldTrip meeting and identified some occasions where FieldTrip is not handling IC-data well. This can lead to unexpected results and missing warnings or errors. However, you can use dipole modelling (like EEGlab does) or MNE if you want to. These should work with ICs. > > Any reason why you want to use LCMV on ICs? In theory, both steps constitute a spatial filter, so you can try to be smart and first to LCMV on all your channel level data, and then apply the LCMV spatial filter on the individual backprojected ICs. Somewhat a complicated procedure, but I think it would work? > > Best, > Jörn > > > > On 4/4/2014 7:23 AM, Tyler Grummett wrote: >> >> Hello fieldtrip, >> >> >> I was wondering whether it was possible in the fieldtrip toolbox to run a spatial and temporal ICA on data after it has been run through ft_sourceanalysis (We can a LCMV beamformer on EEG data that had been timelocked). >> >> >> Currently it is saying that I need raw data for it to be processed. >> >> >> Tyler >> >> >> ************************* >> >> /Tyler Grummett ( BBSc, BSc(Hons I))/ >> /PhD Candidate/ >> /Brain Signals Laboratory/ >> /Flinders University/ >> /Rm 5A301/ >> /Ext 66124/ >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Fri Apr 4 11:37:25 2014 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Fri, 4 Apr 2014 10:37:25 +0100 Subject: [FieldTrip] 1 PostDoc + 2 PhD positions in Computational Cognitive NeuroImaging Message-ID: 2 PhD and 1 PostDoc positions in Computational Cognitive Neuroimaging; University of Birmingham, UK In our natural dynamic environment the senses are constantly bombarded with many different signals. How does the human brain integrate information from multiple senses during perception? To study the neural mechanisms of multisensory integration and learning, we combine psychophysics, functional imaging (fMRI, EEG/MEG & interleaved TMS-fMRI) and models of Bayesian Inference and learning. The Computational Cognitive Neuroimaging Group (Prof Uta Noppeney) is seeking 1 enthusiastic PostDoc and 2 PhD candidates. Applicants should have a strong quantitative background and a degree in neuroscience, psychology, computer science, physics, medicine or related areas. Prior experience in functional imaging, MatLab, data analysis and/or machine learning would be an advantage. The lab is part of the Computational Neuroscience and Cognitive Robotics Centre and the Department of Psychology of the University of Birmingham, UK. The centre provides an excellent multidisciplinary and collaborative research environment combining expertise in cognitive neuroimaging, psychophysics and computational neuroscience. The psychology department was rated 3rd in the UK research assessment exercise. Applications will be considered until the positions are filled. Starting dates are flexible. For further information, please contact u.noppeney at bham.ac.uk and see http://www.birmingham.ac.uk/research/activity/cncr/index.aspx< http://www.birmingham.ac.uk/schools/psychology/index.aspx> http://www.birmingham.ac.uk/schools/psychology/index.aspx< http://www.birmingham.ac.uk/schools/psychology/people/profile.aspx?ReferenceId=29516 > http://www.birmingham.ac.uk/schools/psychology/people/profile.aspx?ReferenceId=29516 For application to the PostDoc positions, please send applications to http://www.jobs.ac.uk/job/AIM528/research-fellow/ For application to the PhD positions, please send application including CV, statement of research interests, and the names and full contact details of two referees to: u.noppeney at bham.ac.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From luca.turella at unitn.it Fri Apr 4 13:31:47 2014 From: luca.turella at unitn.it (Luca Turella) Date: Fri, 4 Apr 2014 13:31:47 +0200 Subject: [FieldTrip] PostDoc opportunity at CIMeC - Neural substrates and temporal dynamics of prehension (fMRI/MEG) Message-ID: PostDoc opportunity at CIMeC - University of Trento Neural substrates and temporal dynamics of prehension (fMRI/MEG) A postdoctoral position (funded by italian "FIRB 2013" grant) will be available soon at Center for Mind/Brain Sciences (CIMeC, www.unitn.it/en/cimec) at the University of Trento (Italy). The topic of investigation will cover the neural substrates and temporal dynamics of action representations during planning and execution. The focus of the project is on the investigation of the coding of prehension movements at the level of their neural representations using fMRI and at the level of their dynamics using MEG. The requirements for the candidates are the following. Candidates must have a Ph.D. degree in a field related to Cognitive Neuroscience. Previous experience with EEG/MEG or fMRI methods and data analysis is required. The ideal candidate should have good programming skills in Matlab, preferably related to EEG/MEG data analysis (Fieldtrip) and/or to fMRI data analysis (SPM/BrainVoyager). Knowledge of kinematic data analysis is also a plus. Knowledge of Italian language is not required. The Center for Mind/Brain Sciences at the University of Trento is an outstanding working place situated in a beautiful surrounding (e.g. Dolomites, Garda Lake; see http://www.visittrentino.it/en). CIMeC offers an international and vibrant research setting with access to state-of-the-art neuroimaging methodologies, including a research-only MR scanner, MEG, EEG and TMS, as well as behavioural, eye tracking and motion tracking laboratories. The University of Trento is ranked first among research universities in Italy and the Trentino region is consistently at the top for quality of life and for the most efficient services in Italy. English is the official language of the CIMeC, where a large proportion of the faculty, post-docs and students come from a wide range of countries outside of Italy. The salary will be proportional to the level of experience and the starting date of the appointment is negotiable, but within the next 6 months. Applications will be considered until the position is filled. The contract will have a duration of 2 years. Applications should be sent to luca.turella at unitn.it, including complete CV, statement of research interests, and contact details of two referees. Potential candidates are also encouraged to send me directly informal inquires luca.turella at unitn.it . -- Luca Turella, PhD Assistant Professor CIMeC - Center for Mind/Brain Sciences University of Trento Mattarello (TN), Via Delle Regole 101 Tel.+39 0461-28 3098 http://www.unitn.it/cimec -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Fri Apr 4 14:27:17 2014 From: julian.keil at gmail.com (Julian Keil) Date: Fri, 4 Apr 2014 14:27:17 +0200 Subject: [FieldTrip] =?iso-8859-1?q?PhD-Position_in_Multisensory_Integrati?= =?iso-8859-1?q?on_=28Charit=E9_Berlin=29?= Message-ID: <758A5578-4860-4834-B8AB-071E74B039A9@gmail.com> The Department of Psychiatry and Psychotherapy, Charité – Universitätsmedizin Berlin invites applications for a PhD position A project grant of the Deutsche Forschungsgemeinschaft (DFG), entitled “Predicting the multisensory future: Role of neuronal connectivity for integrative information processing across modalities“ will fund the currently open position (initially 24 months). The main objective of this project is to examine neural markers of multisensory integration and to test a new hypothesis that considers dynamic interplay of synchronized neural populations as a key to multisensory processes (Senkowski et al. 2008, TINS; Keil et al. 2013, Cerebral Cortex). The studies within this program include EEG, TMS and possibly other neuroimaging methods. Multisensory processes will be examined in a series of experiments requiring both bottom-up and top-down processing. Applicants should have a background in psychology, medicine, biology, physics, engineering, or neuroscience. Basic experience in human EEG or MEG studies, Matlab programming skills, as well as basic German language skills for interacting with the study participants are prerequisites for the position. An interest in neurophysiological studies including clinical populations is expected. Applicants are asked to submit their CV, a motivation letter including information about a possible starting date, 2 names of referees, and documentation of relevant qualifications (e.g., copies of diplomas and/or transcripts of grades) until April 30, 2014, electronically to: julian.keil at charite.de http://psy-ccm.charite.de/en/research/neuroimaging/multisensory_integration/ ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 495 bytes Desc: Message signed with OpenPGP using GPGMail URL: From Heng-RuMay.Tan at glasgow.ac.uk Fri Apr 4 15:12:04 2014 From: Heng-RuMay.Tan at glasgow.ac.uk (Heng-Ru May Tan) Date: Fri, 4 Apr 2014 14:12:04 +0100 Subject: [FieldTrip] MRC-Ph.D. Studentship at University of Glasgow Message-ID: <533EAFA4.9010105@glasgow.ac.uk> An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Fri Apr 4 16:19:11 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Fri, 4 Apr 2014 14:19:11 +0000 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: References: <533E6AB3.3080003@donders.ru.nl>, Message-ID: <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com> Hello All, So once I have calculated the preprocessing data, timelock data, headmodel, lead field and source. I have the following code to create virtual EEG channels of data (similar to the tutorial): % find sensor names and indices chans = ft_channelselection( 'EEG', data.label); chans = match_str( data.label, chans); % compute virtual channels virtual_chans = []; virtual_chans.label = data.label; virtual_chans.time = data.time; virtual_chans.trial = source.avg.filter{ 1} * timelock.trial{ 1}(chans,:); However as I have 642 source.avg.filter, which filter do I chose? Or do I calculate EEG channels for each voxel I landed with (I only had one trial). Btw, the source was calculated with the following code: cfg = []; cfg.method = 'lcmv'; cfg.grid.inside = grid.inside; cfg.grid.outside = []; cfg.vol = vol; cfg.keepfilter = 'yes'; source = ft_sourceanalysis( cfg, timelock); Thankyou for all the help you have provided me thus far. tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of jan-mathijs schoffelen Sent: Friday, 4 April 2014 7:02 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] spatial and temporal ICA after beamformer Hi all, Allow me to chime in here. As I understand it Tyler wants to do ICA on the output of an LCMV beamformer. This is in general allowed, and can be done if you know how to handle the data. In Fieldtrip there is no pre-cooked way of doing it. What you need is to fool ft_componentanalysis into believing that your source reconstructed data is of the type 'raw'. To get started, you can have a look at http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors. In this particular tutorial, only a few 'virtual channels' are created. You probably want many of those, defined on a 3D grid. The only constraint there is probably the amount of RAM on your computer. Note that you want to do (and will do) temporal ICA in this case. Also, note that you probably should pre-PCA your data (this will be a parameter in the specs for the options for the ICA algorithm you are going to use). If you want to apply the ICA algorithm on amplitude envelope timeseries of band-limited activity, rumour has it that the fastica method works quite well. Cheers, Jan-Mathijs On Apr 4, 2014, at 10:17 AM, Jörn M. Horschig wrote: Hi Tyler, sorry, I realized too late that you want to use LCMV on ICA components - mostly because your approach resulted in many different erros ;). Afaik, it is not possible to use beamforming on ICA components. On Wednesday we talked about this in our weekly FieldTrip meeting and identified some occasions where FieldTrip is not handling IC-data well. This can lead to unexpected results and missing warnings or errors. However, you can use dipole modelling (like EEGlab does) or MNE if you want to. These should work with ICs. Any reason why you want to use LCMV on ICs? In theory, both steps constitute a spatial filter, so you can try to be smart and first to LCMV on all your channel level data, and then apply the LCMV spatial filter on the individual backprojected ICs. Somewhat a complicated procedure, but I think it would work? Best, Jörn On 4/4/2014 7:23 AM, Tyler Grummett wrote: Hello fieldtrip, I was wondering whether it was possible in the fieldtrip toolbox to run a spatial and temporal ICA on data after it has been run through ft_sourceanalysis (We can a LCMV beamformer on EEG data that had been timelocked). Currently it is saying that I need raw data for it to be processed. Tyler ************************* /Tyler Grummett ( BBSc, BSc(Hons I))/ /PhD Candidate/ /Brain Signals Laboratory/ /Flinders University/ /Rm 5A301/ /Ext 66124/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Fri Apr 4 17:40:26 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Fri, 4 Apr 2014 15:40:26 +0000 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com> References: <533E6AB3.3080003@donders.ru.nl>, , <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com> Message-ID: <2E1BAFBE-15C2-46FD-B507-69A274CCB79D@flinders.edu.au> This line was meant to be: virtual_chans.trial = source.avg.filter{ 1} * data.trial{ 1}(chans,:); Tyler > On 5 Apr 2014, at 12:52 am, "Tyler Grummett" wrote: > > virtual_chans.trial = source.avg.filter{ 1} * timelock.trial{ 1}(chans,:); From dave at davebritton.com Fri Apr 4 19:35:09 2014 From: dave at davebritton.com (Dave Britton) Date: Fri, 04 Apr 2014 13:35:09 -0400 Subject: [FieldTrip] grandaveraging EEG question Message-ID: <533EED4D.1070904@davebritton.com> I have EEG data that consist of two separate file sets for each subject, and 20 subjects. When I process this to get ERPs for various conditions, does it matter if I just use ft_appenddata to concatenate all 40 files together and then run ft_timelockanalysis on the result, or should I use ft_grandaverage to combine the two runs for each subject, using the "within" parameter" and then combine the 20 resulting grandaverages with another call to ft_grandaverage using the "between parameter? -Dave From jm.horschig at donders.ru.nl Sat Apr 5 10:51:38 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Sat, 05 Apr 2014 10:51:38 +0200 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com> References: <533E6AB3.3080003@donders.ru.nl>, <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com> Message-ID: <533FC41A.8060309@donders.ru.nl> Hi Tyler, > However as I have 642 source.avg.filter, which filter do I chose? Or > do I calculate EEG channels for each voxel I landed with (I only had > one trial). Yep, you will (should) get 642 virtual channels, where each of these virtual channels correspond to the activity at the grid-point you specified when computing the spatial filter. Best, Jörn On 4/4/2014 4:19 PM, Tyler Grummett wrote: > > Hello All, > > > So once I have calculated the preprocessing data, timelock data, > headmodel, lead field and source. > > > I have the following code to create virtual EEG channels of data > (similar to the tutorial): > > % find sensor names and indices > chans = ft_channelselection( 'EEG', data.label); > chans = match_str( data.label, chans); > % compute virtual channels > virtual_chans = []; > virtual_chans.label = data.label; > virtual_chans.time = data.time; > virtual_chans.trial = source.avg.filter{ 1} * > timelock.trial{ 1}(chans,:); > > However as I have 642 source.avg.filter, which filter do I chose? Or > do I calculate EEG channels for each voxel I landed with (I only had > one trial). > > Btw, the source was calculated with the following code: > > ** > cfg = []; > cfg.method = 'lcmv'; > cfg.grid.inside = grid.inside; > cfg.grid.outside = []; > cfg.vol = vol; > cfg.keepfilter = 'yes'; > source = ft_sourceanalysis( cfg, timelock); > > Thankyou for all the help you have provided me thus far. > > tyler > > > > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > ------------------------------------------------------------------------ > *From:* fieldtrip-bounces at science.ru.nl > on behalf of jan-mathijs schoffelen > > *Sent:* Friday, 4 April 2014 7:02 PM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] spatial and temporal ICA after beamformer > Hi all, > > Allow me to chime in here. As I understand it Tyler wants to do ICA on > the output of an LCMV beamformer. This is in general allowed, and can > be done if you know how to handle the data. In Fieldtrip there is no > pre-cooked way of doing it. What you need is to fool > ft_componentanalysis into believing that your source reconstructed > data is of the type 'raw'. To get started, you can have a look at > http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors. In this > particular tutorial, only a few 'virtual channels' are created. You > probably want many of those, defined on a 3D grid. The only constraint > there is probably the amount of RAM on your computer. Note that you > want to do (and will do) temporal ICA in this case. Also, note that > you probably should pre-PCA your data (this will be a parameter in the > specs for the options for the ICA algorithm you are going to use). If > you want to apply the ICA algorithm on amplitude envelope timeseries > of band-limited activity, rumour has it that the fastica method works > quite well. > > Cheers, > Jan-Mathijs > > On Apr 4, 2014, at 10:17 AM, Jörn M. Horschig wrote: > >> Hi Tyler, >> >> sorry, I realized too late that you want to use LCMV on ICA >> components - mostly because your approach resulted in many different >> erros ;). Afaik, it is not possible to use beamforming on ICA >> components. On Wednesday we talked about this in our weekly FieldTrip >> meeting and identified some occasions where FieldTrip is not handling >> IC-data well. This can lead to unexpected results and missing >> warnings or errors. However, you can use dipole modelling (like >> EEGlab does) or MNE if you want to. These should work with ICs. >> >> Any reason why you want to use LCMV on ICs? In theory, both steps >> constitute a spatial filter, so you can try to be smart and first to >> LCMV on all your channel level data, and then apply the LCMV spatial >> filter on the individual backprojected ICs. Somewhat a complicated >> procedure, but I think it would work? >> >> Best, >> Jörn >> >> >> >> On 4/4/2014 7:23 AM, Tyler Grummett wrote: >>> >>> Hello fieldtrip, >>> >>> >>> I was wondering whether it was possible in the fieldtrip toolbox to >>> run a spatial and temporal ICA on data after it has been run through >>> ft_sourceanalysis (We can a LCMV beamformer on EEG data that had >>> been timelocked). >>> >>> >>> Currently it is saying that I need raw data for it to be processed. >>> >>> >>> Tyler >>> >>> >>> ************************* >>> >>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>> /PhD Candidate/ >>> /Brain Signals Laboratory/ >>> /Flinders University/ >>> /Rm 5A301/ >>> /Ext 66124/ >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From j.herring at fcdonders.ru.nl Sat Apr 5 22:20:53 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Sat, 5 Apr 2014 22:20:53 +0200 (CEST) Subject: [FieldTrip] grandaveraging EEG question In-Reply-To: <533EED4D.1070904@davebritton.com> References: <533EED4D.1070904@davebritton.com> Message-ID: Hi Dave, I would read in, and preprocess, the two files per subject and run ft_appenddata to combine the data from both files. Then I would run ft_timelockanalysis to get the erps for each condition. As soon as you have done this for all subjects, run ft_timelockgrandaverage to get the group averaged erps. Best, Jim > On 4 apr. 2014, at 19:38, Dave Britton wrote: > > I have EEG data that consist of two separate file sets for each subject, and 20 subjects. When I process this to get ERPs for various conditions, does it matter if I just use ft_appenddata to concatenate all 40 files together and then run ft_timelockanalysis on the result, or should I use ft_grandaverage to combine the two runs for each subject, using the "within" parameter" and then combine the 20 resulting grandaverages with another call to ft_grandaverage using the "between parameter? > -Dave > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tyler.grummett at flinders.edu.au Sun Apr 6 07:43:25 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Sun, 6 Apr 2014 05:43:25 +0000 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: <533FC41A.8060309@donders.ru.nl> References: <533E6AB3.3080003@donders.ru.nl>, <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com>, <533FC41A.8060309@donders.ru.nl> Message-ID: <99348662ba6848c587a589caa50167d4@SIXPR03MB368.apcprd03.prod.outlook.com> Hi Jorn, I think the fundamental issue with this is that the spatial filter has three dimensions, each corresponding to either x y or z. I must admit I am confused at this point, because I dont know whether to choose x, y or z or somehow combine them or have them as additional channels. >> source_inside.avg.filter ans = [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] etc.... Currently I am chosing only the first dimension ie source_inside.avg.filter{ 1}( 1, :) and then multiplying that by the data. for j = 1:numel( source_inside.avg.filter), temp{ j} = source_inside.avg.filter{ j}( 1, :) * data.trial{ 1}(chans,:); virtual_chans.trial( j, :) = temp{ j}; end to end up with: virtual_chans = label: {1x642 cell} time: {[1x19767 double]} trial: [642x19767 double] Like I said, I dont know what to with the 2nd and 3rd dimension filters. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of "Jörn M. Horschig" Sent: Saturday, 5 April 2014 7:21 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] spatial and temporal ICA after beamformer Hi Tyler, > However as I have 642 source.avg.filter, which filter do I chose? Or > do I calculate EEG channels for each voxel I landed with (I only had > one trial). Yep, you will (should) get 642 virtual channels, where each of these virtual channels correspond to the activity at the grid-point you specified when computing the spatial filter. Best, Jörn On 4/4/2014 4:19 PM, Tyler Grummett wrote: > > Hello All, > > > So once I have calculated the preprocessing data, timelock data, > headmodel, lead field and source. > > > I have the following code to create virtual EEG channels of data > (similar to the tutorial): > > % find sensor names and indices > chans = ft_channelselection( 'EEG', data.label); > chans = match_str( data.label, chans); > % compute virtual channels > virtual_chans = []; > virtual_chans.label = data.label; > virtual_chans.time = data.time; > virtual_chans.trial = source.avg.filter{ 1} * > timelock.trial{ 1}(chans,:); > > However as I have 642 source.avg.filter, which filter do I chose? Or > do I calculate EEG channels for each voxel I landed with (I only had > one trial). > > Btw, the source was calculated with the following code: > > ** > cfg = []; > cfg.method = 'lcmv'; > cfg.grid.inside = grid.inside; > cfg.grid.outside = []; > cfg.vol = vol; > cfg.keepfilter = 'yes'; > source = ft_sourceanalysis( cfg, timelock); > > Thankyou for all the help you have provided me thus far. > > tyler > > > > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > ------------------------------------------------------------------------ > *From:* fieldtrip-bounces at science.ru.nl > on behalf of jan-mathijs schoffelen > > *Sent:* Friday, 4 April 2014 7:02 PM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] spatial and temporal ICA after beamformer > Hi all, > > Allow me to chime in here. As I understand it Tyler wants to do ICA on > the output of an LCMV beamformer. This is in general allowed, and can > be done if you know how to handle the data. In Fieldtrip there is no > pre-cooked way of doing it. What you need is to fool > ft_componentanalysis into believing that your source reconstructed > data is of the type 'raw'. To get started, you can have a look at > http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors. In this > particular tutorial, only a few 'virtual channels' are created. You > probably want many of those, defined on a 3D grid. The only constraint > there is probably the amount of RAM on your computer. Note that you > want to do (and will do) temporal ICA in this case. Also, note that > you probably should pre-PCA your data (this will be a parameter in the > specs for the options for the ICA algorithm you are going to use). If > you want to apply the ICA algorithm on amplitude envelope timeseries > of band-limited activity, rumour has it that the fastica method works > quite well. > > Cheers, > Jan-Mathijs > > On Apr 4, 2014, at 10:17 AM, Jörn M. Horschig wrote: > >> Hi Tyler, >> >> sorry, I realized too late that you want to use LCMV on ICA >> components - mostly because your approach resulted in many different >> erros ;). Afaik, it is not possible to use beamforming on ICA >> components. On Wednesday we talked about this in our weekly FieldTrip >> meeting and identified some occasions where FieldTrip is not handling >> IC-data well. This can lead to unexpected results and missing >> warnings or errors. However, you can use dipole modelling (like >> EEGlab does) or MNE if you want to. These should work with ICs. >> >> Any reason why you want to use LCMV on ICs? In theory, both steps >> constitute a spatial filter, so you can try to be smart and first to >> LCMV on all your channel level data, and then apply the LCMV spatial >> filter on the individual backprojected ICs. Somewhat a complicated >> procedure, but I think it would work? >> >> Best, >> Jörn >> >> >> >> On 4/4/2014 7:23 AM, Tyler Grummett wrote: >>> >>> Hello fieldtrip, >>> >>> >>> I was wondering whether it was possible in the fieldtrip toolbox to >>> run a spatial and temporal ICA on data after it has been run through >>> ft_sourceanalysis (We can a LCMV beamformer on EEG data that had >>> been timelocked). >>> >>> >>> Currently it is saying that I need raw data for it to be processed. >>> >>> >>> Tyler >>> >>> >>> ************************* >>> >>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>> /PhD Candidate/ >>> /Brain Signals Laboratory/ >>> /Flinders University/ >>> /Rm 5A301/ >>> /Ext 66124/ >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From haiteng.jiang at gmail.com Sun Apr 6 09:54:38 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Sun, 6 Apr 2014 09:54:38 +0200 Subject: [FieldTrip] denoising data Message-ID: Hi Fred , This is an interesting/smart pipeline. However, I don't think it is proper to use EEG VEOG/ECG channel as reference on the IC component. The argument is that character of artifact components in EEG and MEG are different though similar . Best, Haiteng > > > > > Hi Ana, Haiteng and everyone else, > > I am joining in on this discussion as I am thinking about a way of > combining > ft_componentanalysis with ft_denoise_pca to remove EOG, ECG and EMG > activity. > > The pipeline that I would like to try is the following: > > %% ICA decomposition > cfg = []; > cfg.method = 'runica'; > > ICs = ft_componentanalysis(cfg,meg_data); % here meg_data has undergone > basic preprocessing including bp-filtering as well as > & ft_artifact_jump and > ft_artifact_clip > %% Substract artifacts from ICA components > cfg = []; > cfg.refchannel = eeg_data.label(1); % eeg_data contains the EOG (1-2), > ECG(3) and EMG(4) ref-channels > cfg.channel = {'runica'}; > cfg.zscore = 'yes'; > cfg.pertrial = 'yes'; > cfg.trials = 'all'; > > [ICs] = ft_denoise_pca(cfg,ICs,eeg_data); % substract VEOG activity from > all ICs > %% > > The idea is to repeat this step for all refchannels in order to substract > the artifacts. > > Then backproject ICs to original data: > > %% Backproject data > cfg = []; > meg_data = ft_rejectcomponent(cfg,ICs,meg_data); > > The advantage is that you don't have to "throw away" the entire component > as sometimes ICs > contain a mix of artifacts and brain activity. So by regressing out the > artifacts, you could > avoid throwing away the good stuff. > > However, I don't know if this is a good approach. There may be pitfalls > that I am not thinking > of right now. > Therefore any suggestions or comments about whether this is a good idea > would be very welcome! > I am hoping that some of the ft_guru's could drop a line or two about this! > > Fred > > > ----- Original Message ----- > From: "Haiteng Jiang" > To: fieldtrip at science.ru.nl > Sent: Thursday, April 3, 2014 8:27:30 AM > Subject: Re: [FieldTrip] denoising data > > > > > > > > Dear Ana, > > > If I understand correctly , we use ft_denoise_synthetic and ft_denoise_pca > to reduce noise due to recording (e.g. environment noise , thermal noise... > ) not the brain signal artefact (e.g eye blink). Normally ,I use these two > functions in the very early stage . > > Best, > Haiteng > > > > Message: 5 > Date: Thu, 3 Apr 2014 00:54:42 +0200 (CEST) > From: "Todorovic, A." < a.todorovic at fcdonders.ru.nl > > To: FieldTrip List < fieldtrip at donders.ru.nl > > Subject: [FieldTrip] denoising data > Message-ID: > < 124252612.215995.1396479282885.JavaMail.root at monoceros.zimbra.ru.nl > > Content-Type: text/plain; charset=utf-8 > > Dear 'trippers, > > I'm curious to hear your thoughts on how to best denoise data. What I'm > doing is working, but I'd like to hear whether it's logical or reasonable. > > In particular, I have two issues. One is that I use ICA to remove blinks, > so I have to fit denoising into a pipeline that incorporates ICA (which, I > am guessing, works well only without including reference channels). > > The other is that I see there are two functions for denoising, > ft_denoise_synthetic and ft_denoise_pca. > > In sum (1) I'm not really sure WHEN the best moment for denoising is, > given that I use ICA, and (2) I don't understand when it's better to use > ft_denoise_synthetic and when ft_denoise_pca. I do see that ft_denoise_pca > has the option of preprocessing reference channels separately, which makes > it easier to use after ICA. > > I used to know only about the first function, and my solution was to do > ft_denoise_synthetic (using the 'G3BR' option) prior to the ICA. Then I > would remove components which contain artifacts, and continue with making > ERF/TFRs/whatever. This produces data that is somewhat cleaner than when I > skip the denoising step. > > I was curious about the ft_denoise_pca when I saw it, so I tried running > it on filtered, preprocessed data that I had after I rejected ICA > components. [In the process of doing ICA, I used the ft_denoise_synthetic > option, as above.] This produced a different TFR at the end of the road, > which again looked cleaner. Significantly cleaner, actually, but N=1. > > Now I'm not sure if it was a logical step to use both denoising functions, > and if it would have been a better idea to do things differently. I'd like > to hear both whether something in the logic is wrong, and whether it's > inelegant. > > Cheers, > Ana > > > > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From sarathykousik at gmail.com Sun Apr 6 11:09:24 2014 From: sarathykousik at gmail.com (kousik sarathy) Date: Sun, 6 Apr 2014 11:09:24 +0200 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: <99348662ba6848c587a589caa50167d4@SIXPR03MB368.apcprd03.prod.outlook.com> References: <533E6AB3.3080003@donders.ru.nl> <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com> <533FC41A.8060309@donders.ru.nl> <99348662ba6848c587a589caa50167d4@SIXPR03MB368.apcprd03.prod.outlook.com> Message-ID: Hey Tyler, Check out the "Computation of virtual MEG channels in source-space" in this page (http://fieldtrip.fcdonders.nl/tutorial/connectivityextended). It gives some hints on what x-y-z components are, how to collapse it and use the filters. -- Regards, Kousik Sarathy, S On Sun, Apr 6, 2014 at 7:43 AM, Tyler Grummett < tyler.grummett at flinders.edu.au> wrote: > Hi Jorn, > > I think the fundamental issue with this is that the spatial filter has > three dimensions, each corresponding to either x y or z. > > I must admit I am confused at this point, because I dont know whether to > choose x, y or z or somehow combine them or have them as additional > channels. > > >> source_inside.avg.filter > > ans = > > [3x123 double] > [3x123 double] > [3x123 double] > [3x123 double] > [3x123 double] > [3x123 double] > [3x123 double] > [3x123 double] > [3x123 double] > [3x123 double] > etc.... > > Currently I am chosing only the first dimension ie > source_inside.avg.filter{ 1}( 1, :) and then multiplying that by the data. > > for j = 1:numel( source_inside.avg.filter), > temp{ j} = source_inside.avg.filter{ j}( 1, :) * > data.trial{ 1}(chans,:); > virtual_chans.trial( j, :) = temp{ j}; > end > > to end up with: > > virtual_chans = > > label: {1x642 cell} > time: {[1x19767 double]} > trial: [642x19767 double] > > Like I said, I dont know what to with the 2nd and 3rd dimension filters. > > Tyler > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl > on behalf of "Jörn M. Horschig" > Sent: Saturday, 5 April 2014 7:21 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] spatial and temporal ICA after beamformer > > Hi Tyler, > > > However as I have 642 source.avg.filter, which filter do I chose? Or > > do I calculate EEG channels for each voxel I landed with (I only had > > one trial). > > Yep, you will (should) get 642 virtual channels, where each of these > virtual channels correspond to the activity at the grid-point you > specified when computing the spatial filter. > > > Best, > Jörn > > > On 4/4/2014 4:19 PM, Tyler Grummett wrote: > > > > Hello All, > > > > > > So once I have calculated the preprocessing data, timelock data, > > headmodel, lead field and source. > > > > > > I have the following code to create virtual EEG channels of data > > (similar to the tutorial): > > > > % find sensor names and indices > > chans = ft_channelselection( 'EEG', data.label); > > chans = match_str( data.label, chans); > > % compute virtual channels > > virtual_chans = []; > > virtual_chans.label = data.label; > > virtual_chans.time = data.time; > > virtual_chans.trial = source.avg.filter{ 1} * > > timelock.trial{ 1}(chans,:); > > > > However as I have 642 source.avg.filter, which filter do I chose? Or > > do I calculate EEG channels for each voxel I landed with (I only had > > one trial). > > > > Btw, the source was calculated with the following code: > > > > ** > > cfg = []; > > cfg.method = 'lcmv'; > > cfg.grid.inside = grid.inside; > > cfg.grid.outside = []; > > cfg.vol = vol; > > cfg.keepfilter = 'yes'; > > source = ft_sourceanalysis( cfg, timelock); > > > > Thankyou for all the help you have provided me thus far. > > > > tyler > > > > > > > > > > > > ************************* > > > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > > /PhD Candidate/ > > /Brain Signals Laboratory/ > > /Flinders University/ > > /Rm 5A301/ > > /Ext 66124/ > > ------------------------------------------------------------------------ > > *From:* fieldtrip-bounces at science.ru.nl > > on behalf of jan-mathijs schoffelen > > > > *Sent:* Friday, 4 April 2014 7:02 PM > > *To:* FieldTrip discussion list > > *Subject:* Re: [FieldTrip] spatial and temporal ICA after beamformer > > Hi all, > > > > Allow me to chime in here. As I understand it Tyler wants to do ICA on > > the output of an LCMV beamformer. This is in general allowed, and can > > be done if you know how to handle the data. In Fieldtrip there is no > > pre-cooked way of doing it. What you need is to fool > > ft_componentanalysis into believing that your source reconstructed > > data is of the type 'raw'. To get started, you can have a look at > > http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors. In this > > particular tutorial, only a few 'virtual channels' are created. You > > probably want many of those, defined on a 3D grid. The only constraint > > there is probably the amount of RAM on your computer. Note that you > > want to do (and will do) temporal ICA in this case. Also, note that > > you probably should pre-PCA your data (this will be a parameter in the > > specs for the options for the ICA algorithm you are going to use). If > > you want to apply the ICA algorithm on amplitude envelope timeseries > > of band-limited activity, rumour has it that the fastica method works > > quite well. > > > > Cheers, > > Jan-Mathijs > > > > On Apr 4, 2014, at 10:17 AM, Jörn M. Horschig wrote: > > > >> Hi Tyler, > >> > >> sorry, I realized too late that you want to use LCMV on ICA > >> components - mostly because your approach resulted in many different > >> erros ;). Afaik, it is not possible to use beamforming on ICA > >> components. On Wednesday we talked about this in our weekly FieldTrip > >> meeting and identified some occasions where FieldTrip is not handling > >> IC-data well. This can lead to unexpected results and missing > >> warnings or errors. However, you can use dipole modelling (like > >> EEGlab does) or MNE if you want to. These should work with ICs. > >> > >> Any reason why you want to use LCMV on ICs? In theory, both steps > >> constitute a spatial filter, so you can try to be smart and first to > >> LCMV on all your channel level data, and then apply the LCMV spatial > >> filter on the individual backprojected ICs. Somewhat a complicated > >> procedure, but I think it would work? > >> > >> Best, > >> Jörn > >> > >> > >> > >> On 4/4/2014 7:23 AM, Tyler Grummett wrote: > >>> > >>> Hello fieldtrip, > >>> > >>> > >>> I was wondering whether it was possible in the fieldtrip toolbox to > >>> run a spatial and temporal ICA on data after it has been run through > >>> ft_sourceanalysis (We can a LCMV beamformer on EEG data that had > >>> been timelocked). > >>> > >>> > >>> Currently it is saying that I need raw data for it to be processed. > >>> > >>> > >>> Tyler > >>> > >>> > >>> ************************* > >>> > >>> /Tyler Grummett ( BBSc, BSc(Hons I))/ > >>> /PhD Candidate/ > >>> /Brain Signals Laboratory/ > >>> /Flinders University/ > >>> /Rm 5A301/ > >>> /Ext 66124/ > >>> > >>> > >>> _______________________________________________ > >>> fieldtrip mailing list > >>> fieldtrip at donders.ru.nl > >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> > >> -- > >> Jörn M. Horschig > >> PhD Student > >> Donders Institute for Brain, Cognition and Behaviour > >> Centre for Cognitive Neuroimaging > >> Radboud University Nijmegen > >> Neuronal Oscillations Group > >> FieldTrip Development Team > >> > >> P.O. Box 9101 > >> NL-6500 HB Nijmegen > >> The Netherlands > >> > >> Contact: > >> E-Mail: jm.horschig at donders.ru.nl > >> Tel: +31-(0)24-36-68493 > >> Web: http://www.ru.nl/donders > >> > >> Visiting address: > >> Trigon, room 2.30 > >> Kapittelweg 29 > >> NL-6525 EN Nijmegen > >> The Netherlands > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > Jan-Mathijs Schoffelen, MD PhD > > > > Donders Institute for Brain, Cognition and Behaviour, > > Centre for Cognitive Neuroimaging, > > Radboud University Nijmegen, The Netherlands > > > > Max Planck Institute for Psycholinguistics, > > Nijmegen, The Netherlands > > > > J.Schoffelen at donders.ru.nl > > Telephone: +31-24-3614793 > > > > http://www.hettaligebrein.nl > > > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -- > Jörn M. Horschig > PhD Student > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > Neuronal Oscillations Group > FieldTrip Development Team > > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Contact: > E-Mail: jm.horschig at donders.ru.nl > Tel: +31-(0)24-36-68493 > Web: http://www.ru.nl/donders > > Visiting address: > Trigon, room 2.30 > Kapittelweg 29 > NL-6525 EN Nijmegen > The Netherlands > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bibi.raquel at gmail.com Sun Apr 6 22:01:49 2014 From: bibi.raquel at gmail.com (Raquel Bibi) Date: Sun, 6 Apr 2014 16:01:49 -0400 Subject: [FieldTrip] grandaveraging EEG question In-Reply-To: References: <533EED4D.1070904@davebritton.com> Message-ID: <32A64FF3-34C1-4260-B21E-E917E725B239@gmail.com> Hi Dave I would think that appending the data would weigh each subject by the number of trials, something that isn't done when we use timelock_grandaverage. Best, Raquel Sent from my iPhone > On Apr 5, 2014, at 4:20 PM, "Herring, J.D. (Jim)" wrote: > > Hi Dave, > > I would read in, and preprocess, the two files per subject and run ft_appenddata to combine the data from both files. Then I would run ft_timelockanalysis to get the erps for each condition. As soon as you have done this for all subjects, run ft_timelockgrandaverage to get the group averaged erps. > > Best, > > Jim > >> On 4 apr. 2014, at 19:38, Dave Britton wrote: >> >> I have EEG data that consist of two separate file sets for each subject, and 20 subjects. When I process this to get ERPs for various conditions, does it matter if I just use ft_appenddata to concatenate all 40 files together and then run ft_timelockanalysis on the result, or should I use ft_grandaverage to combine the two runs for each subject, using the "within" parameter" and then combine the 20 resulting grandaverages with another call to ft_grandaverage using the "between parameter? >> -Dave >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tyler.grummett at flinders.edu.au Mon Apr 7 02:18:28 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 7 Apr 2014 00:18:28 +0000 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: References: <533E6AB3.3080003@donders.ru.nl> <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com> <533FC41A.8060309@donders.ru.nl> <99348662ba6848c587a589caa50167d4@SIXPR03MB368.apcprd03.prod.outlook.com>, Message-ID: <4e7e440fb27846349d7033f7201328ce@SINPR03MB361.apcprd03.prod.outlook.com> ​Dear Kousik, Thank you very much, I was leading up to that tutorial but I didnt know that the information I was looking for was in it! Regards, Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of kousik sarathy Sent: Sunday, 6 April 2014 6:39 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] spatial and temporal ICA after beamformer Hey Tyler, Check out the "Computation of virtual MEG channels in source-space" in this page (http://fieldtrip.fcdonders.nl/tutorial/connectivityextended). It gives some hints on what x-y-z components are, how to collapse it and use the filters. -- Regards, Kousik Sarathy, S On Sun, Apr 6, 2014 at 7:43 AM, Tyler Grummett > wrote: Hi Jorn, I think the fundamental issue with this is that the spatial filter has three dimensions, each corresponding to either x y or z. I must admit I am confused at this point, because I dont know whether to choose x, y or z or somehow combine them or have them as additional channels. >> source_inside.avg.filter ans = [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] etc.... Currently I am chosing only the first dimension ie source_inside.avg.filter{ 1}( 1, :) and then multiplying that by the data. for j = 1:numel( source_inside.avg.filter), temp{ j} = source_inside.avg.filter{ j}( 1, :) * data.trial{ 1}(chans,:); virtual_chans.trial( j, :) = temp{ j}; end to end up with: virtual_chans = label: {1x642 cell} time: {[1x19767 double]} trial: [642x19767 double] Like I said, I dont know what to with the 2nd and 3rd dimension filters. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl > on behalf of "Jörn M. Horschig" > Sent: Saturday, 5 April 2014 7:21 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] spatial and temporal ICA after beamformer Hi Tyler, > However as I have 642 source.avg.filter, which filter do I chose? Or > do I calculate EEG channels for each voxel I landed with (I only had > one trial). Yep, you will (should) get 642 virtual channels, where each of these virtual channels correspond to the activity at the grid-point you specified when computing the spatial filter. Best, Jörn On 4/4/2014 4:19 PM, Tyler Grummett wrote: > > Hello All, > > > So once I have calculated the preprocessing data, timelock data, > headmodel, lead field and source. > > > I have the following code to create virtual EEG channels of data > (similar to the tutorial): > > % find sensor names and indices > chans = ft_channelselection( 'EEG', data.label); > chans = match_str( data.label, chans); > % compute virtual channels > virtual_chans = []; > virtual_chans.label = data.label; > virtual_chans.time = data.time; > virtual_chans.trial = source.avg.filter{ 1} * > timelock.trial{ 1}(chans,:); > > However as I have 642 source.avg.filter, which filter do I chose? Or > do I calculate EEG channels for each voxel I landed with (I only had > one trial). > > Btw, the source was calculated with the following code: > > ** > cfg = []; > cfg.method = 'lcmv'; > cfg.grid.inside = grid.inside; > cfg.grid.outside = []; > cfg.vol = vol; > cfg.keepfilter = 'yes'; > source = ft_sourceanalysis( cfg, timelock); > > Thankyou for all the help you have provided me thus far. > > tyler > > > > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > ------------------------------------------------------------------------ > *From:* fieldtrip-bounces at science.ru.nl > > on behalf of jan-mathijs schoffelen > > > *Sent:* Friday, 4 April 2014 7:02 PM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] spatial and temporal ICA after beamformer > Hi all, > > Allow me to chime in here. As I understand it Tyler wants to do ICA on > the output of an LCMV beamformer. This is in general allowed, and can > be done if you know how to handle the data. In Fieldtrip there is no > pre-cooked way of doing it. What you need is to fool > ft_componentanalysis into believing that your source reconstructed > data is of the type 'raw'. To get started, you can have a look at > http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors. In this > particular tutorial, only a few 'virtual channels' are created. You > probably want many of those, defined on a 3D grid. The only constraint > there is probably the amount of RAM on your computer. Note that you > want to do (and will do) temporal ICA in this case. Also, note that > you probably should pre-PCA your data (this will be a parameter in the > specs for the options for the ICA algorithm you are going to use). If > you want to apply the ICA algorithm on amplitude envelope timeseries > of band-limited activity, rumour has it that the fastica method works > quite well. > > Cheers, > Jan-Mathijs > > On Apr 4, 2014, at 10:17 AM, Jörn M. Horschig wrote: > >> Hi Tyler, >> >> sorry, I realized too late that you want to use LCMV on ICA >> components - mostly because your approach resulted in many different >> erros ;). Afaik, it is not possible to use beamforming on ICA >> components. On Wednesday we talked about this in our weekly FieldTrip >> meeting and identified some occasions where FieldTrip is not handling >> IC-data well. This can lead to unexpected results and missing >> warnings or errors. However, you can use dipole modelling (like >> EEGlab does) or MNE if you want to. These should work with ICs. >> >> Any reason why you want to use LCMV on ICs? In theory, both steps >> constitute a spatial filter, so you can try to be smart and first to >> LCMV on all your channel level data, and then apply the LCMV spatial >> filter on the individual backprojected ICs. Somewhat a complicated >> procedure, but I think it would work? >> >> Best, >> Jörn >> >> >> >> On 4/4/2014 7:23 AM, Tyler Grummett wrote: >>> >>> Hello fieldtrip, >>> >>> >>> I was wondering whether it was possible in the fieldtrip toolbox to >>> run a spatial and temporal ICA on data after it has been run through >>> ft_sourceanalysis (We can a LCMV beamformer on EEG data that had >>> been timelocked). >>> >>> >>> Currently it is saying that I need raw data for it to be processed. >>> >>> >>> Tyler >>> >>> >>> ************************* >>> >>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>> /PhD Candidate/ >>> /Brain Signals Laboratory/ >>> /Flinders University/ >>> /Rm 5A301/ >>> /Ext 66124/ >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl > >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl > >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Mon Apr 7 07:49:23 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 7 Apr 2014 05:49:23 +0000 Subject: [FieldTrip] spatial and temporal ICA after beamformer In-Reply-To: References: <533E6AB3.3080003@donders.ru.nl> <3c45f6ca8ce04e978bc7ad97b439eacb@SIXPR03MB368.apcprd03.prod.outlook.com> <533FC41A.8060309@donders.ru.nl> <99348662ba6848c587a589caa50167d4@SIXPR03MB368.apcprd03.prod.outlook.com>, Message-ID: Hello all, Im really interested in calculating granger causality using method in connectivity extended (last bit of the document). Specifically, I would like to compute the spectrally resolved granger connectivity. How would one go about doing that? Is it just be cfg = []; cfg.output = 'fourier'; cfg.method = 'mtmfft'; cfg.foilim = [5 100]; cfg.tapsmofrq = 5; cfg.keeptrials = 'yes'; cfg.channel = {'visual' 'motor' 'EMGlft' 'EMGrgt'}; freq = ft_freqanalysis(cfg, combineddata); cfg = []; cfg.method = 'granger'; coherence = ft_connectivityanalysis(cfg, freq); or would you need to calculate multivariate autoregressive coefficients. Because my data keeps crashing when I try to running it. cfg = []; cfg.order = 5; cfg.toolbox = 'bsmart'; mdata = ft_mvaranalysis( cfg, comp);​ With an error of: Index exceeds matrix dimensions. Error in ft_mvaranalysis (line 321) tmpcfg.toilim = [timeaxis(sample-floor(tfwin/2)) timeaxis(sample+ceil(tfwin/2)-1)];​ Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of kousik sarathy Sent: Sunday, 6 April 2014 6:39 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] spatial and temporal ICA after beamformer Hey Tyler, Check out the "Computation of virtual MEG channels in source-space" in this page (http://fieldtrip.fcdonders.nl/tutorial/connectivityextended). It gives some hints on what x-y-z components are, how to collapse it and use the filters. -- Regards, Kousik Sarathy, S On Sun, Apr 6, 2014 at 7:43 AM, Tyler Grummett > wrote: Hi Jorn, I think the fundamental issue with this is that the spatial filter has three dimensions, each corresponding to either x y or z. I must admit I am confused at this point, because I dont know whether to choose x, y or z or somehow combine them or have them as additional channels. >> source_inside.avg.filter ans = [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] [3x123 double] etc.... Currently I am chosing only the first dimension ie source_inside.avg.filter{ 1}( 1, :) and then multiplying that by the data. for j = 1:numel( source_inside.avg.filter), temp{ j} = source_inside.avg.filter{ j}( 1, :) * data.trial{ 1}(chans,:); virtual_chans.trial( j, :) = temp{ j}; end to end up with: virtual_chans = label: {1x642 cell} time: {[1x19767 double]} trial: [642x19767 double] Like I said, I dont know what to with the 2nd and 3rd dimension filters. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________________ From: fieldtrip-bounces at science.ru.nl > on behalf of "Jörn M. Horschig" > Sent: Saturday, 5 April 2014 7:21 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] spatial and temporal ICA after beamformer Hi Tyler, > However as I have 642 source.avg.filter, which filter do I chose? Or > do I calculate EEG channels for each voxel I landed with (I only had > one trial). Yep, you will (should) get 642 virtual channels, where each of these virtual channels correspond to the activity at the grid-point you specified when computing the spatial filter. Best, Jörn On 4/4/2014 4:19 PM, Tyler Grummett wrote: > > Hello All, > > > So once I have calculated the preprocessing data, timelock data, > headmodel, lead field and source. > > > I have the following code to create virtual EEG channels of data > (similar to the tutorial): > > % find sensor names and indices > chans = ft_channelselection( 'EEG', data.label); > chans = match_str( data.label, chans); > % compute virtual channels > virtual_chans = []; > virtual_chans.label = data.label; > virtual_chans.time = data.time; > virtual_chans.trial = source.avg.filter{ 1} * > timelock.trial{ 1}(chans,:); > > However as I have 642 source.avg.filter, which filter do I chose? Or > do I calculate EEG channels for each voxel I landed with (I only had > one trial). > > Btw, the source was calculated with the following code: > > ** > cfg = []; > cfg.method = 'lcmv'; > cfg.grid.inside = grid.inside; > cfg.grid.outside = []; > cfg.vol = vol; > cfg.keepfilter = 'yes'; > source = ft_sourceanalysis( cfg, timelock); > > Thankyou for all the help you have provided me thus far. > > tyler > > > > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > ------------------------------------------------------------------------ > *From:* fieldtrip-bounces at science.ru.nl > > on behalf of jan-mathijs schoffelen > > > *Sent:* Friday, 4 April 2014 7:02 PM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] spatial and temporal ICA after beamformer > Hi all, > > Allow me to chime in here. As I understand it Tyler wants to do ICA on > the output of an LCMV beamformer. This is in general allowed, and can > be done if you know how to handle the data. In Fieldtrip there is no > pre-cooked way of doing it. What you need is to fool > ft_componentanalysis into believing that your source reconstructed > data is of the type 'raw'. To get started, you can have a look at > http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors. In this > particular tutorial, only a few 'virtual channels' are created. You > probably want many of those, defined on a 3D grid. The only constraint > there is probably the amount of RAM on your computer. Note that you > want to do (and will do) temporal ICA in this case. Also, note that > you probably should pre-PCA your data (this will be a parameter in the > specs for the options for the ICA algorithm you are going to use). If > you want to apply the ICA algorithm on amplitude envelope timeseries > of band-limited activity, rumour has it that the fastica method works > quite well. > > Cheers, > Jan-Mathijs > > On Apr 4, 2014, at 10:17 AM, Jörn M. Horschig wrote: > >> Hi Tyler, >> >> sorry, I realized too late that you want to use LCMV on ICA >> components - mostly because your approach resulted in many different >> erros ;). Afaik, it is not possible to use beamforming on ICA >> components. On Wednesday we talked about this in our weekly FieldTrip >> meeting and identified some occasions where FieldTrip is not handling >> IC-data well. This can lead to unexpected results and missing >> warnings or errors. However, you can use dipole modelling (like >> EEGlab does) or MNE if you want to. These should work with ICs. >> >> Any reason why you want to use LCMV on ICs? In theory, both steps >> constitute a spatial filter, so you can try to be smart and first to >> LCMV on all your channel level data, and then apply the LCMV spatial >> filter on the individual backprojected ICs. Somewhat a complicated >> procedure, but I think it would work? >> >> Best, >> Jörn >> >> >> >> On 4/4/2014 7:23 AM, Tyler Grummett wrote: >>> >>> Hello fieldtrip, >>> >>> >>> I was wondering whether it was possible in the fieldtrip toolbox to >>> run a spatial and temporal ICA on data after it has been run through >>> ft_sourceanalysis (We can a LCMV beamformer on EEG data that had >>> been timelocked). >>> >>> >>> Currently it is saying that I need raw data for it to be processed. >>> >>> >>> Tyler >>> >>> >>> ************************* >>> >>> /Tyler Grummett ( BBSc, BSc(Hons I))/ >>> /PhD Candidate/ >>> /Brain Signals Laboratory/ >>> /Flinders University/ >>> /Rm 5A301/ >>> /Ext 66124/ >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl > >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> -- >> Jörn M. Horschig >> PhD Student >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> Neuronal Oscillations Group >> FieldTrip Development Team >> >> P.O. Box 9101 >> NL-6500 HB Nijmegen >> The Netherlands >> >> Contact: >> E-Mail: jm.horschig at donders.ru.nl > >> Tel: +31-(0)24-36-68493 >> Web: http://www.ru.nl/donders >> >> Visiting address: >> Trigon, room 2.30 >> Kapittelweg 29 >> NL-6525 EN Nijmegen >> The Netherlands >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From lmelloni at gmail.com Mon Apr 7 12:45:22 2014 From: lmelloni at gmail.com (Lucia Melloni) Date: Mon, 7 Apr 2014 06:45:22 -0400 Subject: [FieldTrip] Applications open for the Neurobiology of Cognition GRC/GRS! In-Reply-To: References: Message-ID: Dear colleague, Applications are now open for the Gordon Research Seminar (GRS) and Conference (GRC) on the Neurobiology of Cognition to be held from the 19-20 July (Seminar) and 20-25 July (Conference), 2014. Space is limited. Don't forger to apply soon! Looking forward to seeing you at the GRS/GRC! Lucia Melloni. Ayelet A. Landau [image: Gordon Research Conferences] Join us at the 2014 *Gordon Conference* and *Seminar* On *Neurobiology of Cognition* Circuits, Dynamics, Action and Perception We are meeting *July 20-25, 2014 -*New GRC site: *Sunday River Resort* Newry, Maine Click *here*to see the *GRC* program. There is also an associated *GRS* *July 19-20 *for students and postdocs Click *here*to see the *GRS* website. *GRS* application & abstract deadline to be considered for oral presentation- *April 30* *Please use attached **flyer **to help spread the word! * The Neurobiology of Cognition is a recently-inaugurated GRC designed to foster convergence of traditional neuroscience investigations with more recent developments in systems, cellular and molecular neurobiology, in engineering and imaging and in computational sciences. Cognition is construed broadly to embrace empirical findings in a range of species including humans, and there is a strong focus on integration of findings and principles across species and levels of analysis. In the opening Keynote Session, two leading neuroscientists with provide an experimental and computational perspective on the recent initiative, termed Brain Research through Advancing Innovative Neurotechnologies (BRAIN). This initiative, spearheaded by the President and NIH, is aimed at developing innovative methodologies to study how complex systems of neurons interact in time and in space during complex behaviors. Along with recent findings in a few traditional "core" areas, formal sessions will then explore several new themes, including: 1) the neuroanatomy and 2) coordination of cognitive circuits in the brain, 3) motor cognition and brain-computer interfaces, 4) music and language, and 5) learning and plasticity. The program juxtaposes human psychophysical, neuroimaging and electrophysiological studies with parallel investigations in rodents and non-human primates, and with computational approaches that explicate empirical findings and construct robust, detailed models to represent the developing picture and guide future experimentation. The program also underscores novel experimental and theoretical approaches that promise to define fundamental principles that guide and integrate the understanding of cognition at a fundamental level, and to extend these to improved treatment of brain dysfunction. The format of the meeting promotes intensive interactions among investigators and trainees from different perspectives and analytic levels, and in particular, between experimentalists and theorists. There is a linked Gordon Research Seminar for trainees, most of whom also attend the GRC. All that is missing now is your *application* to attend. Click *here*for the *GRC*. Click* here*for the *GRS*. (You must apply to both to attend both.) Best regards, GRC Chair: *Charles E. Schroeder* GRC V. Chair:*Tatiana Pasternak* GRS Chair: *Lucia Melloni* GRS Assoc. Chair: *Ayelet N. Landau* *Apply* now and see why our attendees consistently rate GRCs "the best conference I've attended this year"! [image: Like us on Facebook] [image: Follow us on Twitter] [image: View our profile on LinkedIn] *Forward this email * -- -- Lucia. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Tue Apr 8 04:48:08 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 8 Apr 2014 02:48:08 +0000 Subject: [FieldTrip] ft_sourceanalysis using LCMV beamformer and grid from ft_prepare_leadfield Message-ID: Hello fieldtrip, I am trying to perform an LCMV beamformer on timelockanalysis data. timelock = avg: [124x20517 double] var: [124x20517 double] time: [1x20517 double] dof: [124x20517 double] label: {1x124 cell} dimord: 'chan_time' cov: [124x124 double] elec: [1x1 struct] cfg: [1x1 struct] I first run ft_prepare_leadfield cfg = []; cfg.elec = timelock.elec; cfg.vol = vol; cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution cfg.grid.unit = 'cm'; cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window grid = ft_prepare_leadfield( cfg); grid = xgrid: [-5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8] ygrid: [-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7] zgrid: [0 1 2 3 4 5 6 7 8 9 10 11 12] dim: [14 14 13] pos: [2548x3 double] unit: 'cm' inside: [1x1409 double] outside: [1x1139 double] cfg: [1x1 struct] leadfield: {1x2548 cell} I then try to run the ft_sourceanalysis code: cfg = []; cfg.channel = timelock.label; cfg.method = 'lcmv'; cfg.grid = grid; cfg.vol = vol; cfg.keepfilter = 'yes'; source = ft_sourceanalysis( cfg, timelock); And it crashes with the error message: Error using * Inner matrix dimensions must agree. Error in beamformer_lcmv (line 268) filt = pinv(lf' * invCy * lf) * lf' * invCy; % van Veen eqn. 23, use PINV/SVD to cover rank deficient leadfield Error in ft_sourceanalysis (line 794) dip(i) = beamformer_lcmv(grid, sens, vol, squeeze_avg, squeeze(Cy(i,:,:)), optarg{:}); However, the code does work if it is: cfg = []; cfg.channel = timelock.label; cfg.method = 'lcmv'; cfg.grid.inside = grid.inside; cfg.vol = vol; cfg.keepfilter = 'yes'; source = ft_sourceanalysis( cfg, timelock); However, I run the sourceplot code produces something that looks like the picture attached. What is interesting is that when I run the interp code: the input is source data with 16777216 positions on a [256 256 256] grid not plotting anatomy But when you run the same code from sourcePost_nocon from the beamformer tutorial, you get the following when you run the code: the input is source data with 3042 positions on a [18 13 13] grid the input is volume data with dimensions [256 256 256] I have used the same mri file for both. ? Please help, I cant work out the issue. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: sourceplot_example.png Type: image/png Size: 15766 bytes Desc: sourceplot_example.png URL: From tyler.grummett at flinders.edu.au Tue Apr 8 07:15:08 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 8 Apr 2014 05:15:08 +0000 Subject: [FieldTrip] ft_sourceanalysis using LCMV beamformer and grid from ft_prepare_leadfield In-Reply-To: References: Message-ID: <4b26ee20682b439b8bca1332f9ec9d66@SIXPR03MB368.apcprd03.prod.outlook.com> Fieldtrip, Ive got it working now. The follow error: ***************************************************************** Error using * Inner matrix dimensions must agree. Error in beamformer_lcmv (line 268) filt = pinv(lf' * invCy * lf) * lf' * invCy; % van Veen eqn. 23, use PINV/SVD to cover rank deficient leadfield Error in ft_sourceanalysis (line 794) dip(i) = beamformer_lcmv(grid, sens, vol, squeeze_avg, squeeze(Cy(i,:,:)), optarg{:}); ***************************************************************** It is because: if is 128x3 invCy is 124x124 When I ran the code: cfg = []; cfg.channel = 'EEG'; % only works for preprocessing cfg.vartrllength = 2; % accept variable length trials cfg.covariance = 'yes'; cfg.covariancewindow = 'all'; cfg.keeptrials = 'no'; timelock = ft_timelockanalysis(cfg, data); It did the timelockanalysis on 124 channels, but it didnt remove the non-EEG channels from timelock.elec and so the four EOG channels explains the 128. timelock = avg: [124x11758 double] var: [124x11758 double] time: [1x11758 double] dof: [124x11758 double] label: {1x124 cell} dimord: 'chan_time' cov: [124x124 double] elec: [1x1 struct] cfg: [1x1 struct] timelock.elec = chanpos: [128x3 double] elecpos: [128x3 double] label: {1x128 cell} type: 'eeg1005' unit: 'mm' I dont know if this is a bug or not. Please advise. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Tyler Grummett Sent: Tuesday, 8 April 2014 12:18 PM To: FieldTrip discussion list Subject: [FieldTrip] ft_sourceanalysis using LCMV beamformer and grid from ft_prepare_leadfield Hello fieldtrip, I am trying to perform an LCMV beamformer on timelockanalysis data. timelock = avg: [124x20517 double] var: [124x20517 double] time: [1x20517 double] dof: [124x20517 double] label: {1x124 cell} dimord: 'chan_time' cov: [124x124 double] elec: [1x1 struct] cfg: [1x1 struct] I first run ft_prepare_leadfield cfg = []; cfg.elec = timelock.elec; cfg.vol = vol; cfg.grid.resolution = 1; % use a 3-D grid with a 1 cm resolution cfg.grid.unit = 'cm'; cfg.normalize = 'yes'; % if you are not contrasting the activity of interest again another condition or baseline time-window grid = ft_prepare_leadfield( cfg); grid = xgrid: [-5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8] ygrid: [-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7] zgrid: [0 1 2 3 4 5 6 7 8 9 10 11 12] dim: [14 14 13] pos: [2548x3 double] unit: 'cm' inside: [1x1409 double] outside: [1x1139 double] cfg: [1x1 struct] leadfield: {1x2548 cell} I then try to run the ft_sourceanalysis code: cfg = []; cfg.channel = timelock.label; cfg.method = 'lcmv'; cfg.grid = grid; cfg.vol = vol; cfg.keepfilter = 'yes'; source = ft_sourceanalysis( cfg, timelock); And it crashes with the error message: Error using * Inner matrix dimensions must agree. Error in beamformer_lcmv (line 268) filt = pinv(lf' * invCy * lf) * lf' * invCy; % van Veen eqn. 23, use PINV/SVD to cover rank deficient leadfield Error in ft_sourceanalysis (line 794) dip(i) = beamformer_lcmv(grid, sens, vol, squeeze_avg, squeeze(Cy(i,:,:)), optarg{:}); However, the code does work if it is: cfg = []; cfg.channel = timelock.label; cfg.method = 'lcmv'; cfg.grid.inside = grid.inside; cfg.vol = vol; cfg.keepfilter = 'yes'; source = ft_sourceanalysis( cfg, timelock); However, I run the sourceplot code produces something that looks like the picture attached. What is interesting is that when I run the interp code: the input is source data with 16777216 positions on a [256 256 256] grid not plotting anatomy But when you run the same code from sourcePost_nocon from the beamformer tutorial, you get the following when you run the code: the input is source data with 3042 positions on a [18 13 13] grid the input is volume data with dimensions [256 256 256] I have used the same mri file for both. ? Please help, I cant work out the issue. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.todorovic at fcdonders.ru.nl Tue Apr 8 07:25:18 2014 From: a.todorovic at fcdonders.ru.nl (Todorovic, A.) Date: Tue, 8 Apr 2014 07:25:18 +0200 (CEST) Subject: [FieldTrip] denoising data Message-ID: <818248357.305942.1396934718615.JavaMail.root@monoceros.zimbra.ru.nl> Hi Haiteng, Thanks for your reply. Just to be sure if I understand you correctly - do you use BOTH denoise_pca and denoise_synthetic on the same data? If not, how do you choose which one to use? Cheers, Ana > > Dear Ana, > > > If I understand correctly , we use ft_denoise_synthetic and > ft_denoise_pca to reduce noise due to recording (e.g. environment noise , > thermal noise... ) not the brain signal artefact (e.g eye blink). Normally > ,I use these two functions in the very early stage . > > Best, > Haiteng From marlene.boenstrup at googlemail.com Tue Apr 8 09:07:46 2014 From: marlene.boenstrup at googlemail.com (=?ISO-8859-1?Q?Marlene_B=F6nstrup?=) Date: Tue, 8 Apr 2014 09:07:46 +0200 Subject: [FieldTrip] surfaceplot made by ft_sourceplot sparing the frontal lobes Message-ID: Dear fieldtrip-experts, The plot I generated by ft_sourceplot using cfg.method = 'surface' with either projectionemthod 'nearest' or 'project' looks funny. The frontal lobes don't show any activation, they are just left grey. And also specific activations on the cortex are shifted towards the back (y-axis). I compared the same 3-D- sourceactivation data (interpolated on the standard T1 output of ft_interpolate with ft_interpolate) in an orthoplot and there the sourceactivation is neatly arranged in the whole brain volume, including the frontal lobes. So that the mistake must origin in the ft_sourceplot function. I use the version of the 18th of December 2013. Do you know this problem and can help me with it? If not, do you have an idea to solve it or cirumvent it? Thanks in advance, Marlene -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk8 at gmail.com Tue Apr 8 10:59:00 2014 From: a.stolk8 at gmail.com (Arjen Stolk) Date: Tue, 8 Apr 2014 10:59:00 +0200 Subject: [FieldTrip] surfaceplot made by ft_sourceplot sparing the frontal lobes In-Reply-To: References: Message-ID: Hi Marlene, Could you download today's version of FieldTrip, and let us know whether this problem still occurs? I'm saying because we just made an update to surface plotting, potentially solving your issue. Best, Arjen 2014-04-08 9:07 GMT+02:00 Marlene Bönstrup : > Dear fieldtrip-experts, > > The plot I generated by ft_sourceplot using cfg.method = 'surface' with > either projectionemthod 'nearest' or 'project' looks funny. The frontal > lobes don't show any activation, they are just left grey. And also specific > activations on the cortex are shifted towards the back (y-axis). I compared > the same 3-D- sourceactivation data (interpolated on the standard T1 output > of ft_interpolate with ft_interpolate) in an orthoplot and there the > sourceactivation is neatly arranged in the whole brain volume, including > the frontal lobes. So that the mistake must origin in the ft_sourceplot > function. > I use the version of the 18th of December 2013. > > Do you know this problem and can help me with it? > If not, do you have an idea to solve it or cirumvent it? > > Thanks in advance, > Marlene > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Tue Apr 8 11:01:47 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 8 Apr 2014 09:01:47 +0000 Subject: [FieldTrip] fieldtrip2eeglab Message-ID: <36a06a30eef54304859a734a2deb7153@SIXPR03MB368.apcprd03.prod.outlook.com> ?Hey fieldtrip, Is there a fieldtrip2eeglab function somewhere? It says in the documentation of 'integrating with eeglab', and I was wondering whether there already was one. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Tue Apr 8 11:19:34 2014 From: julian.keil at gmail.com (Julian Keil) Date: Tue, 8 Apr 2014 11:19:34 +0200 Subject: [FieldTrip] fieldtrip2eeglab References: Message-ID: <60EC99B5-A742-420D-84A2-3B86336EB37A@gmail.com> Hi Tyler, there was a mail by Arno Delorme last year containing the function. See below. Best, Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Anfang der weitergeleiteten E-Mail: > Von: Arnaud Delorme > Betreff: Re: [FieldTrip] Channel layout FT to EEGLAB > Datum: 29. Oktober 2013 01:27:53 MEZ > An: FieldTrip discussion list > Antwort an: FieldTrip discussion list > > Dear Rajat, > > this old function transforms EEG data contained in the Fieldtrip structure into an EEGLAB structure. > After you have done that, to transform a channel location file, simply type in > > EEG.chanlocs = struct('labels', cfg.elec.label, 'X', mattocell(cfg.elec.pnt(1,:)), 'Y', mattocell(cfg.elec.pnt(2,:)),'Z', mattocell(cfg.elec.pnt(3,:))); > EEG.chanlocs = convertlocs(EEG.chanlocs, 'cart2all'); > > This code is untested. You might have to switch X, Y and Z to obtain the correct orientation for the electrode cap. > Best, > > Arno > > > > On Oct 28, 2013, at 7:36 AM, Raquel Bibi wrote: > >> Hi Rajat, >> I don't know EEGLAB, but I use the "ordered" option in Fieldtrip to display my time-locked ICA components. >> >> Best, >> >> Raquel >> >> >> On Mon, Oct 28, 2013 at 9:39 AM, Rajat Thomas wrote: >> Dear all, >> >> I made a layout file using the image of the ecog array I had, just like described in the >> tutorial. >> >> I would like to port this to EEGLAB, so that I can use the various ICA options to plot >> the components at the channel locations and so on. >> >> Could anyone either point me to a file that does this conversion? or >> Any way of using ICA within fieldtrip to plot the various components on the different >> channels using the layout file? >> >> I know it is used for channel rejection and so on but any help on plotting the components >> back on the ICA would be appreciated. >> >> Thanks a lot in advance. >> >> Rajat >> >> -- >> Rajat Mani Thomas >> Netherlands Institute for Neuroscience >> Amsterdam, The Netherlands >> http://www.cita.utoronto.ca/~thomas >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fieldtrip2eeglab.m Type: application/octet-stream Size: 1141 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.rombetto at cib.na.cnr.it Tue Apr 8 11:51:12 2014 From: s.rombetto at cib.na.cnr.it (s.rombetto at cib.na.cnr.it) Date: Tue, 8 Apr 2014 11:51:12 +0200 Subject: [FieldTrip] denoising data In-Reply-To: <818248357.305942.1396934718615.JavaMail.root@monoceros.zimbra.ru.nl> References: <818248357.305942.1396934718615.JavaMail.root@monoceros.zimbra.ru.nl> Message-ID: <20140408115112.cn1ddeuo840s8s84@arco.cib.na.cnr.it> Hi I am interested in this topic too. As I have mainly environmental noise I use denoise_pca but I would like to understand if with a different code I couold improve my S/N ratio. Moreover I would ask if there is any difference if you apply first one denoising procedure or the other. Regards Sara Rombetto, PhD > Hi Haiteng, > > Thanks for your reply. > > Just to be sure if I understand you correctly - do you use BOTH > denoise_pca and denoise_synthetic on the same data? > > If not, how do you choose which one to use? > > Cheers, > Ana > >> >> Dear Ana, >> >> >> If I understand correctly , we use ft_denoise_synthetic and >> ft_denoise_pca to reduce noise due to recording (e.g. environment noise , >> thermal noise... ) not the brain signal artefact (e.g eye blink). Normally >> ,I use these two functions in the very early stage . >> >> Best, >> Haiteng > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > ------------------------- Dott.ssa Sara Rombetto Istituto di Cibernetica "E. Caianiello" Via Campi Flegrei, 34 80078 Pozzuoli (NA) Italy mob +39 3401689815 tel +39 0818675361 fax +39 0818675128 Lab MEG 0817483511 -------------------------- "I disapprove of what you say, but I will defend to the death your right to say it." [Evelyn Beatrice Hall, The Friends Of Voltaire] ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. From marlene.boenstrup at googlemail.com Tue Apr 8 13:31:25 2014 From: marlene.boenstrup at googlemail.com (=?ISO-8859-1?Q?Marlene_B=F6nstrup?=) Date: Tue, 8 Apr 2014 13:31:25 +0200 Subject: [FieldTrip] fieldtrip Digest, Vol 41, Issue 16 In-Reply-To: References: Message-ID: Dear Arjen, thanks for your quick reply. With the version of sunday (yesterdays version the file was invalid, my windows couldn't open it and there is not yet a version of today) the misplotting still occurs. I dont know if attachments work in this email list, but attached there is the surface and the orthoplot of exactly the same interploated data. 2014-04-08 12:00 GMT+02:00 : > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: denoising data (Todorovic, A.) > 2. surfaceplot made by ft_sourceplot sparing the frontal lobes > (Marlene B?nstrup) > 3. Re: surfaceplot made by ft_sourceplot sparing the frontal > lobes (Arjen Stolk) > 4. fieldtrip2eeglab (Tyler Grummett) > 5. fieldtrip2eeglab (Julian Keil) > 6. Re: denoising data (s.rombetto at cib.na.cnr.it) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 8 Apr 2014 07:25:18 +0200 (CEST) > From: "Todorovic, A." > To: FieldTrip List > Subject: Re: [FieldTrip] denoising data > Message-ID: > < > 818248357.305942.1396934718615.JavaMail.root at monoceros.zimbra.ru.nl> > Content-Type: text/plain; charset=utf-8 > > Hi Haiteng, > > Thanks for your reply. > > Just to be sure if I understand you correctly - do you use BOTH > denoise_pca and denoise_synthetic on the same data? > > If not, how do you choose which one to use? > > Cheers, > Ana > > > > > Dear Ana, > > > > > > If I understand correctly , we use ft_denoise_synthetic and > > ft_denoise_pca to reduce noise due to recording (e.g. environment > noise , > > thermal noise... ) not the brain signal artefact (e.g eye blink). > Normally > > ,I use these two functions in the very early stage . > > > > Best, > > Haiteng > > > ------------------------------ > > Message: 2 > Date: Tue, 8 Apr 2014 09:07:46 +0200 > From: Marlene B?nstrup > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] surfaceplot made by ft_sourceplot sparing the > frontal lobes > Message-ID: > hQuwNwyu2qf-GFmF84qzVje7ENjq86MSsrpE31_J2vQ at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Dear fieldtrip-experts, > > The plot I generated by ft_sourceplot using cfg.method = 'surface' with > either projectionemthod 'nearest' or 'project' looks funny. The frontal > lobes don't show any activation, they are just left grey. And also specific > activations on the cortex are shifted towards the back (y-axis). I compared > the same 3-D- sourceactivation data (interpolated on the standard T1 output > of ft_interpolate with ft_interpolate) in an orthoplot and there the > sourceactivation is neatly arranged in the whole brain volume, including > the frontal lobes. So that the mistake must origin in the ft_sourceplot > function. > I use the version of the 18th of December 2013. > > Do you know this problem and can help me with it? > If not, do you have an idea to solve it or cirumvent it? > > Thanks in advance, > Marlene > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/80ef0af7/attachment-0001.html > > > > ------------------------------ > > Message: 3 > Date: Tue, 8 Apr 2014 10:59:00 +0200 > From: Arjen Stolk > To: FieldTrip discussion list > Subject: Re: [FieldTrip] surfaceplot made by ft_sourceplot sparing the > frontal lobes > Message-ID: > nRhoRBQ at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Hi Marlene, > > Could you download today's version of FieldTrip, and let us know whether > this problem still occurs? I'm saying because we just made an update to > surface plotting, potentially solving your issue. > > Best, > Arjen > > > 2014-04-08 9:07 GMT+02:00 Marlene B?nstrup < > marlene.boenstrup at googlemail.com > >: > > > Dear fieldtrip-experts, > > > > The plot I generated by ft_sourceplot using cfg.method = 'surface' with > > either projectionemthod 'nearest' or 'project' looks funny. The frontal > > lobes don't show any activation, they are just left grey. And also > specific > > activations on the cortex are shifted towards the back (y-axis). I > compared > > the same 3-D- sourceactivation data (interpolated on the standard T1 > output > > of ft_interpolate with ft_interpolate) in an orthoplot and there the > > sourceactivation is neatly arranged in the whole brain volume, including > > the frontal lobes. So that the mistake must origin in the ft_sourceplot > > function. > > I use the version of the 18th of December 2013. > > > > Do you know this problem and can help me with it? > > If not, do you have an idea to solve it or cirumvent it? > > > > Thanks in advance, > > Marlene > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/842e34a6/attachment-0001.html > > > > ------------------------------ > > Message: 4 > Date: Tue, 8 Apr 2014 09:01:47 +0000 > From: Tyler Grummett > To: FieldTrip discussion list > Subject: [FieldTrip] fieldtrip2eeglab > Message-ID: > < > 36a06a30eef54304859a734a2deb7153 at SIXPR03MB368.apcprd03.prod.outlook.com> > > Content-Type: text/plain; charset="us-ascii" > > ?Hey fieldtrip, > > > Is there a fieldtrip2eeglab function somewhere? > > > It says in the documentation of 'integrating with eeglab', and I was > wondering whether there already was one. > > > Tyler > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/6cd8cccb/attachment-0001.html > > > > ------------------------------ > > Message: 5 > Date: Tue, 8 Apr 2014 11:19:34 +0200 > From: Julian Keil > To: Tyler Grummett , FieldTrip > discussion list > Subject: [FieldTrip] fieldtrip2eeglab > Message-ID: <60EC99B5-A742-420D-84A2-3B86336EB37A at gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Hi Tyler, > > there was a mail by Arno Delorme last year containing the function. > > See below. > > Best, > > Julian > ******************** > Dr. Julian Keil > > AG Multisensorische Integration > Psychiatrische Universit?tsklinik > der Charit? im St. Hedwig-Krankenhaus > Gro?e Hamburger Stra?e 5-11, Raum E 307 > 10115 Berlin > > Telefon: +49-30-2311-1879 > Fax: +49-30-2311-2209 > > http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration > > Anfang der weitergeleiteten E-Mail: > > > Von: Arnaud Delorme > > Betreff: Re: [FieldTrip] Channel layout FT to EEGLAB > > Datum: 29. Oktober 2013 01:27:53 MEZ > > An: FieldTrip discussion list > > Antwort an: FieldTrip discussion list > > > > Dear Rajat, > > > > this old function transforms EEG data contained in the Fieldtrip > structure into an EEGLAB structure. > > After you have done that, to transform a channel location file, simply > type in > > > > EEG.chanlocs = struct('labels', cfg.elec.label, 'X', > mattocell(cfg.elec.pnt(1,:)), 'Y', mattocell(cfg.elec.pnt(2,:)),'Z', > mattocell(cfg.elec.pnt(3,:))); > > EEG.chanlocs = convertlocs(EEG.chanlocs, 'cart2all'); > > > > This code is untested. You might have to switch X, Y and Z to obtain the > correct orientation for the electrode cap. > > Best, > > > > Arno > > > > > > > > On Oct 28, 2013, at 7:36 AM, Raquel Bibi wrote: > > > >> Hi Rajat, > >> I don't know EEGLAB, but I use the "ordered" option in Fieldtrip to > display my time-locked ICA components. > >> > >> Best, > >> > >> Raquel > >> > >> > >> On Mon, Oct 28, 2013 at 9:39 AM, Rajat Thomas > wrote: > >> Dear all, > >> > >> I made a layout file using the image of the ecog array I had, just like > described in the > >> tutorial. > >> > >> I would like to port this to EEGLAB, so that I can use the various ICA > options to plot > >> the components at the channel locations and so on. > >> > >> Could anyone either point me to a file that does this conversion? or > >> Any way of using ICA within fieldtrip to plot the various components on > the different > >> channels using the layout file? > >> > >> I know it is used for channel rejection and so on but any help on > plotting the components > >> back on the ICA would be appreciated. > >> > >> Thanks a lot in advance. > >> > >> Rajat > >> > >> -- > >> Rajat Mani Thomas > >> Netherlands Institute for Neuroscience > >> Amsterdam, The Netherlands > >> http://www.cita.utoronto.ca/~thomas > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0002.html > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: fieldtrip2eeglab.m > Type: application/octet-stream > Size: 1141 bytes > Desc: not available > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0001.obj > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0003.html > > > > ------------------------------ > > Message: 6 > Date: Tue, 8 Apr 2014 11:51:12 +0200 > From: s.rombetto at cib.na.cnr.it > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] denoising data > Message-ID: <20140408115112.cn1ddeuo840s8s84 at arco.cib.na.cnr.it> > Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; > format="flowed" > > Hi > I am interested in this topic too. > As I have mainly environmental noise I use denoise_pca but I would > like to understand if with a different code I couold improve my S/N > ratio. Moreover I would ask if there is any difference if you apply > first one denoising procedure or the other. > > Regards > Sara Rombetto, PhD > > > Hi Haiteng, > > > > Thanks for your reply. > > > > Just to be sure if I understand you correctly - do you use BOTH > > denoise_pca and denoise_synthetic on the same data? > > > > If not, how do you choose which one to use? > > > > Cheers, > > Ana > > > >> > >> Dear Ana, > >> > >> > >> If I understand correctly , we use ft_denoise_synthetic and > >> ft_denoise_pca to reduce noise due to recording (e.g. environment > noise , > >> thermal noise... ) not the brain signal artefact (e.g eye blink). > Normally > >> ,I use these two functions in the very early stage . > >> > >> Best, > >> Haiteng > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > ------------------------- > Dott.ssa Sara Rombetto > Istituto di Cibernetica > "E. Caianiello" > Via Campi Flegrei, 34 > 80078 Pozzuoli (NA) > Italy > mob +39 3401689815 > tel +39 0818675361 > fax +39 0818675128 > Lab MEG 0817483511 > -------------------------- > "I disapprove of what you say, but I will defend to the death your > right to say > it." [Evelyn Beatrice Hall, The Friends Of Voltaire] > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 16 > ***************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ortho.png Type: image/png Size: 48141 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: surface.png Type: image/png Size: 136550 bytes Desc: not available URL: From f.roux at bcbl.eu Tue Apr 8 14:46:22 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Tue, 8 Apr 2014 14:46:22 +0200 (CEST) Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs Message-ID: <591175772.1312154.1396961182187.JavaMail.root@bcbl.eu> Dear all, I have a general question relating to the usage of cfg.runica.pca during the call to ft_componentanalysis. Is it correct to assume that cfg.runica.pca = length(meg_data.label) will force the algorithm to return n = length(meg_data.label) ICs, and that as a result artifacts can be "spread" across several ICs? If that's true, then I imagine that cfg.runica.pac = n/4 will return less components and reduce the "spread" of artifacts over several components. My question is how to choose the number of principal components to which the data is reduced before ICA? Best, Fred --------------------------------------------------------------------------- From Holger.Krause at med.uni-duesseldorf.de Tue Apr 8 15:11:45 2014 From: Holger.Krause at med.uni-duesseldorf.de (Holger Krause) Date: Tue, 08 Apr 2014 15:11:45 +0200 Subject: [FieldTrip] Zip file of yesterday's version seems to be corrupted (2014-04-07) Message-ID: <201404081511.46850.Holger.Krause@med.uni-duesseldorf.de> Hi, Yesterday night my script for downloading the latest fieldtrip version failed. Today I manually downloaded , of which the md5sum is 7ebc176eedc038581d17ecbb46bd0832. zipinfo complains about invalid archive: $ zipinfo fieldtrip-20140407.zip Archive: fieldtrip-20140407.zip Zip file size: 296098459 bytes, number of entries: 8079 error [fieldtrip-20140407.zip]: start of central directory not found; zipfile corrupt. Other users seem to be affected as well (see Marlene Bönstrup's mail from today.) BR, Holger -- Dr. rer. nat. Holger Krause MEG-Labor, Raum 13.54.-1.84 Telefon: +49 211 81-19031 Institut für klinische Neurowissenschaften http://www.uniklinik-duesseldorf.de/klinneurowiss Uniklinik Düsseldorf From haiteng.jiang at gmail.com Tue Apr 8 15:15:01 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Tue, 8 Apr 2014 15:15:01 +0200 Subject: [FieldTrip] denoising data Message-ID: Hi Ana& Sara, denoise_synthetic use linear regression to regress the noise out . The parameters are set by the manufacture company technicians while denoise_pca is a data- driven method by removing reference channels background noise. In principle , either is fine. Personally, I prefer to only use denoise_synthetic. You don't need to denoise twice and you do the component analysis later anyway. Best, Haiteng On 8 April 2014 12:00, wrote: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: denoising data (Todorovic, A.) > 2. surfaceplot made by ft_sourceplot sparing the frontal lobes > (Marlene B?nstrup) > 3. Re: surfaceplot made by ft_sourceplot sparing the frontal > lobes (Arjen Stolk) > 4. fieldtrip2eeglab (Tyler Grummett) > 5. fieldtrip2eeglab (Julian Keil) > 6. Re: denoising data (s.rombetto at cib.na.cnr.it) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 8 Apr 2014 07:25:18 +0200 (CEST) > From: "Todorovic, A." > To: FieldTrip List > Subject: Re: [FieldTrip] denoising data > Message-ID: > < > 818248357.305942.1396934718615.JavaMail.root at monoceros.zimbra.ru.nl> > Content-Type: text/plain; charset=utf-8 > > Hi Haiteng, > > Thanks for your reply. > > Just to be sure if I understand you correctly - do you use BOTH > denoise_pca and denoise_synthetic on the same data? > > If not, how do you choose which one to use? > > Cheers, > Ana > > > > > Dear Ana, > > > > > > If I understand correctly , we use ft_denoise_synthetic and > > ft_denoise_pca to reduce noise due to recording (e.g. environment > noise , > > thermal noise... ) not the brain signal artefact (e.g eye blink). > Normally > > ,I use these two functions in the very early stage . > > > > Best, > > Haiteng > > > ------------------------------ > > Message: 2 > Date: Tue, 8 Apr 2014 09:07:46 +0200 > From: Marlene B?nstrup > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] surfaceplot made by ft_sourceplot sparing the > frontal lobes > Message-ID: > hQuwNwyu2qf-GFmF84qzVje7ENjq86MSsrpE31_J2vQ at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Dear fieldtrip-experts, > > The plot I generated by ft_sourceplot using cfg.method = 'surface' with > either projectionemthod 'nearest' or 'project' looks funny. The frontal > lobes don't show any activation, they are just left grey. And also specific > activations on the cortex are shifted towards the back (y-axis). I compared > the same 3-D- sourceactivation data (interpolated on the standard T1 output > of ft_interpolate with ft_interpolate) in an orthoplot and there the > sourceactivation is neatly arranged in the whole brain volume, including > the frontal lobes. So that the mistake must origin in the ft_sourceplot > function. > I use the version of the 18th of December 2013. > > Do you know this problem and can help me with it? > If not, do you have an idea to solve it or cirumvent it? > > Thanks in advance, > Marlene > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/80ef0af7/attachment-0001.html > > > > ------------------------------ > > Message: 3 > Date: Tue, 8 Apr 2014 10:59:00 +0200 > From: Arjen Stolk > To: FieldTrip discussion list > Subject: Re: [FieldTrip] surfaceplot made by ft_sourceplot sparing the > frontal lobes > Message-ID: > nRhoRBQ at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Hi Marlene, > > Could you download today's version of FieldTrip, and let us know whether > this problem still occurs? I'm saying because we just made an update to > surface plotting, potentially solving your issue. > > Best, > Arjen > > > 2014-04-08 9:07 GMT+02:00 Marlene B?nstrup < > marlene.boenstrup at googlemail.com > >: > > > Dear fieldtrip-experts, > > > > The plot I generated by ft_sourceplot using cfg.method = 'surface' with > > either projectionemthod 'nearest' or 'project' looks funny. The frontal > > lobes don't show any activation, they are just left grey. And also > specific > > activations on the cortex are shifted towards the back (y-axis). I > compared > > the same 3-D- sourceactivation data (interpolated on the standard T1 > output > > of ft_interpolate with ft_interpolate) in an orthoplot and there the > > sourceactivation is neatly arranged in the whole brain volume, including > > the frontal lobes. So that the mistake must origin in the ft_sourceplot > > function. > > I use the version of the 18th of December 2013. > > > > Do you know this problem and can help me with it? > > If not, do you have an idea to solve it or cirumvent it? > > > > Thanks in advance, > > Marlene > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/842e34a6/attachment-0001.html > > > > ------------------------------ > > Message: 4 > Date: Tue, 8 Apr 2014 09:01:47 +0000 > From: Tyler Grummett > To: FieldTrip discussion list > Subject: [FieldTrip] fieldtrip2eeglab > Message-ID: > < > 36a06a30eef54304859a734a2deb7153 at SIXPR03MB368.apcprd03.prod.outlook.com> > > Content-Type: text/plain; charset="us-ascii" > > ?Hey fieldtrip, > > > Is there a fieldtrip2eeglab function somewhere? > > > It says in the documentation of 'integrating with eeglab', and I was > wondering whether there already was one. > > > Tyler > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/6cd8cccb/attachment-0001.html > > > > ------------------------------ > > Message: 5 > Date: Tue, 8 Apr 2014 11:19:34 +0200 > From: Julian Keil > To: Tyler Grummett , FieldTrip > discussion list > Subject: [FieldTrip] fieldtrip2eeglab > Message-ID: <60EC99B5-A742-420D-84A2-3B86336EB37A at gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Hi Tyler, > > there was a mail by Arno Delorme last year containing the function. > > See below. > > Best, > > Julian > ******************** > Dr. Julian Keil > > AG Multisensorische Integration > Psychiatrische Universit?tsklinik > der Charit? im St. Hedwig-Krankenhaus > Gro?e Hamburger Stra?e 5-11, Raum E 307 > 10115 Berlin > > Telefon: +49-30-2311-1879 > Fax: +49-30-2311-2209 > > http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration > > Anfang der weitergeleiteten E-Mail: > > > Von: Arnaud Delorme > > Betreff: Re: [FieldTrip] Channel layout FT to EEGLAB > > Datum: 29. Oktober 2013 01:27:53 MEZ > > An: FieldTrip discussion list > > Antwort an: FieldTrip discussion list > > > > Dear Rajat, > > > > this old function transforms EEG data contained in the Fieldtrip > structure into an EEGLAB structure. > > After you have done that, to transform a channel location file, simply > type in > > > > EEG.chanlocs = struct('labels', cfg.elec.label, 'X', > mattocell(cfg.elec.pnt(1,:)), 'Y', mattocell(cfg.elec.pnt(2,:)),'Z', > mattocell(cfg.elec.pnt(3,:))); > > EEG.chanlocs = convertlocs(EEG.chanlocs, 'cart2all'); > > > > This code is untested. You might have to switch X, Y and Z to obtain the > correct orientation for the electrode cap. > > Best, > > > > Arno > > > > > > > > On Oct 28, 2013, at 7:36 AM, Raquel Bibi wrote: > > > >> Hi Rajat, > >> I don't know EEGLAB, but I use the "ordered" option in Fieldtrip to > display my time-locked ICA components. > >> > >> Best, > >> > >> Raquel > >> > >> > >> On Mon, Oct 28, 2013 at 9:39 AM, Rajat Thomas > wrote: > >> Dear all, > >> > >> I made a layout file using the image of the ecog array I had, just like > described in the > >> tutorial. > >> > >> I would like to port this to EEGLAB, so that I can use the various ICA > options to plot > >> the components at the channel locations and so on. > >> > >> Could anyone either point me to a file that does this conversion? or > >> Any way of using ICA within fieldtrip to plot the various components on > the different > >> channels using the layout file? > >> > >> I know it is used for channel rejection and so on but any help on > plotting the components > >> back on the ICA would be appreciated. > >> > >> Thanks a lot in advance. > >> > >> Rajat > >> > >> -- > >> Rajat Mani Thomas > >> Netherlands Institute for Neuroscience > >> Amsterdam, The Netherlands > >> http://www.cita.utoronto.ca/~thomas > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0002.html > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: fieldtrip2eeglab.m > Type: application/octet-stream > Size: 1141 bytes > Desc: not available > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0001.obj > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0003.html > > > > ------------------------------ > > Message: 6 > Date: Tue, 8 Apr 2014 11:51:12 +0200 > From: s.rombetto at cib.na.cnr.it > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] denoising data > Message-ID: <20140408115112.cn1ddeuo840s8s84 at arco.cib.na.cnr.it> > Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; > format="flowed" > > Hi > I am interested in this topic too. > As I have mainly environmental noise I use denoise_pca but I would > like to understand if with a different code I couold improve my S/N > ratio. Moreover I would ask if there is any difference if you apply > first one denoising procedure or the other. > > Regards > Sara Rombetto, PhD > > > Hi Haiteng, > > > > Thanks for your reply. > > > > Just to be sure if I understand you correctly - do you use BOTH > > denoise_pca and denoise_synthetic on the same data? > > > > If not, how do you choose which one to use? > > > > Cheers, > > Ana > > > >> > >> Dear Ana, > >> > >> > >> If I understand correctly , we use ft_denoise_synthetic and > >> ft_denoise_pca to reduce noise due to recording (e.g. environment > noise , > >> thermal noise... ) not the brain signal artefact (e.g eye blink). > Normally > >> ,I use these two functions in the very early stage . > >> > >> Best, > >> Haiteng > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > ------------------------- > Dott.ssa Sara Rombetto > Istituto di Cibernetica > "E. Caianiello" > Via Campi Flegrei, 34 > 80078 Pozzuoli (NA) > Italy > mob +39 3401689815 > tel +39 0818675361 > fax +39 0818675128 > Lab MEG 0817483511 > -------------------------- > "I disapprove of what you say, but I will defend to the death your > right to say > it." [Evelyn Beatrice Hall, The Friends Of Voltaire] > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 16 > ***************************************** > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Tue Apr 8 15:29:03 2014 From: d.lozanosoldevilla at fcdonders.ru.nl (Lozano Soldevilla, D. (Diego)) Date: Tue, 8 Apr 2014 15:29:03 +0200 (CEST) Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs In-Reply-To: <591175772.1312154.1396961182187.JavaMail.root@bcbl.eu> Message-ID: <477456701.6274998.1396963743697.JavaMail.root@sculptor.zimbra.ru.nl> Hi Fred, I don't know the magical number but I see the following options: a) Before ICA, concatenate all single trials and ask for the rank of your data. Use it as your cfg.runica.pca input. b) Some users notice that when you sort IC by variance, beyond component 30, the IC topo/activation does not look like physiologically meaningfull. It matches with the PCA reduction before ICA with other papers: http://www.ncbi.nlm.nih.gov/pubmed/15219593 http://www.ncbi.nlm.nih.gov/pubmed/19699307 Might be somebody in the forum have tried (by simulations or in real data) on the effects of PCA component reduction on ICA. I hope it helps, Diego ----- Original Message ----- > From: "Frédéric Roux" > To: "FieldTrip discussion list" > Sent: Tuesday, 8 April, 2014 2:46:22 PM > Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs > Dear all, > > I have a general question relating to the usage of cfg.runica.pca > during the call to ft_componentanalysis. > > Is it correct to assume that cfg.runica.pca = length(meg_data.label) > will > force the algorithm to return n = length(meg_data.label) ICs, and that > as a > result artifacts can be "spread" across several ICs? > > If that's true, then I imagine that cfg.runica.pac = n/4 will return > less components > and reduce the "spread" of artifacts over several components. > > My question is how to choose the number of principal components to > which the data > is reduced before ICA? > > Best, > Fred > --------------------------------------------------------------------------- > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- PhD Student Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen NL-6525 EN Nijmegen The Netherlands http://www.ru.nl/people/donders/lozano-soldevilla-d/ From mauricio.antelis at gmail.com Tue Apr 8 15:36:42 2014 From: mauricio.antelis at gmail.com (Mauricio Antelis) Date: Tue, 8 Apr 2014 08:36:42 -0500 Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs In-Reply-To: <477456701.6274998.1396963743697.JavaMail.root@sculptor.zimbra.ru.nl> References: <591175772.1312154.1396961182187.JavaMail.root@bcbl.eu> <477456701.6274998.1396963743697.JavaMail.root@sculptor.zimbra.ru.nl> Message-ID: Roberto, Aqui algo sobre el cuentionamiento del numero de componentes para realizar ICA, sin embargo en nuestro caso, creo que no sera un parametro sensible ya que tenemos un numero bajo (21) de mediciones Saludos Mauricio On Tue, Apr 8, 2014 at 8:29 AM, Lozano Soldevilla, D. (Diego) < d.lozanosoldevilla at fcdonders.ru.nl> wrote: > Hi Fred, > > I don't know the magical number but I see the following options: > > a) Before ICA, concatenate all single trials and ask for the rank of your > data. Use it as your cfg.runica.pca input. > > b) Some users notice that when you sort IC by variance, beyond component > 30, the IC topo/activation does not look like physiologically meaningfull. > It matches with the PCA reduction before ICA with other papers: > > http://www.ncbi.nlm.nih.gov/pubmed/15219593 > http://www.ncbi.nlm.nih.gov/pubmed/19699307 > > Might be somebody in the forum have tried (by simulations or in real data) > on the effects of PCA component reduction on ICA. > > I hope it helps, > > Diego > > ----- Original Message ----- > > From: "Frédéric Roux" > > To: "FieldTrip discussion list" > > Sent: Tuesday, 8 April, 2014 2:46:22 PM > > Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs > > Dear all, > > > > I have a general question relating to the usage of cfg.runica.pca > > during the call to ft_componentanalysis. > > > > Is it correct to assume that cfg.runica.pca = length(meg_data.label) > > will > > force the algorithm to return n = length(meg_data.label) ICs, and that > > as a > > result artifacts can be "spread" across several ICs? > > > > If that's true, then I imagine that cfg.runica.pac = n/4 will return > > less components > > and reduce the "spread" of artifacts over several components. > > > > My question is how to choose the number of principal components to > > which the data > > is reduced before ICA? > > > > Best, > > Fred > > > --------------------------------------------------------------------------- > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > PhD Student > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > NL-6525 EN Nijmegen > The Netherlands > http://www.ru.nl/people/donders/lozano-soldevilla-d/ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Javier M. Antelis -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Tue Apr 8 15:38:38 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Tue, 8 Apr 2014 15:38:38 +0200 (CEST) Subject: [FieldTrip] fieldtrip Digest, Vol 41, Issue 16 In-Reply-To: Message-ID: <213148632.6275386.1396964318753.JavaMail.root@sculptor.zimbra.ru.nl> Hi Marlene, The fix was implemented yesterday, so Sunday's version unfortunately does not contain it. It seems there is currently a problem with the ftp file, so please try again as soon as you can download the latest version. If the problem still exists, please file a bug at http://bugzilla.fcdonders.nl/ and we'll try to replicate your issue. Best, Arjen ----- Oorspronkelijk bericht ----- > Van: "Marlene Bönstrup" > Aan: fieldtrip at science.ru.nl > Verzonden: Dinsdag 8 april 2014 13:31:25 > Onderwerp: Re: [FieldTrip] fieldtrip Digest, Vol 41, Issue 16 > Dear Arjen, > thanks for your quick reply. > With the version of sunday (yesterdays version the file was invalid, > my windows couldn't open it and there is not yet a version of today) > the misplotting still occurs. > I dont know if attachments work in this email list, but attached there > is the surface and the orthoplot of exactly the same interploated > data. > 2014-04-08 12:00 GMT+02:00 < fieldtrip-request at science.ru.nl > : > > Send fieldtrip mailing list submissions to > > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > or, via email, send a message with subject or body 'help' to > > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > > than "Re: Contents of fieldtrip digest..." > > Today's Topics: > > 1. Re: denoising data (Todorovic, A.) > > 2. surfaceplot made by ft_sourceplot sparing the frontal lobes > > (Marlene B?nstrup) > > 3. Re: surfaceplot made by ft_sourceplot sparing the frontal > > lobes (Arjen Stolk) > > 4. fieldtrip2eeglab (Tyler Grummett) > > 5. fieldtrip2eeglab (Julian Keil) > > 6. Re: denoising data ( s.rombetto at cib.na.cnr.it ) > > ---------------------------------------------------------------------- > > Message: 1 > > Date: Tue, 8 Apr 2014 07:25:18 +0200 (CEST) > > From: "Todorovic, A." < a.todorovic at fcdonders.ru.nl > > > To: FieldTrip List < fieldtrip at donders.ru.nl > > > Subject: Re: [FieldTrip] denoising data > > Message-ID: > > < > > 818248357.305942.1396934718615.JavaMail.root at monoceros.zimbra.ru.nl > > > > > Content-Type: text/plain; charset=utf-8 > > Hi Haiteng, > > Thanks for your reply. > > Just to be sure if I understand you correctly - do you use BOTH > > denoise_pca and denoise_synthetic on the same data? > > If not, how do you choose which one to use? > > Cheers, > > Ana > > > > > > Dear Ana, > > > > > > > > > If I understand correctly , we use ft_denoise_synthetic and > > > ft_denoise_pca to reduce noise due to recording (e.g. environment > > > noise , > > > thermal noise... ) not the brain signal artefact (e.g eye blink). > > > Normally > > > ,I use these two functions in the very early stage . > > > > > > Best, > > > Haiteng > > ------------------------------ > > Message: 2 > > Date: Tue, 8 Apr 2014 09:07:46 +0200 > > From: Marlene B?nstrup < marlene.boenstrup at googlemail.com > > > To: fieldtrip at science.ru.nl > > Subject: [FieldTrip] surfaceplot made by ft_sourceplot sparing the > > frontal lobes > > Message-ID: > > > > > > Content-Type: text/plain; charset="iso-8859-1" > > Dear fieldtrip-experts, > > The plot I generated by ft_sourceplot using cfg.method = 'surface' > > with > > either projectionemthod 'nearest' or 'project' looks funny. The > > frontal > > lobes don't show any activation, they are just left grey. And also > > specific > > activations on the cortex are shifted towards the back (y-axis). I > > compared > > the same 3-D- sourceactivation data (interpolated on the standard T1 > > output > > of ft_interpolate with ft_interpolate) in an orthoplot and there the > > sourceactivation is neatly arranged in the whole brain volume, > > including > > the frontal lobes. So that the mistake must origin in the > > ft_sourceplot > > function. > > I use the version of the 18th of December 2013. > > Do you know this problem and can help me with it? > > If not, do you have an idea to solve it or cirumvent it? > > Thanks in advance, > > Marlene > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: < > > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/80ef0af7/attachment-0001.html > > > > > ------------------------------ > > Message: 3 > > Date: Tue, 8 Apr 2014 10:59:00 +0200 > > From: Arjen Stolk < a.stolk8 at gmail.com > > > To: FieldTrip discussion list < fieldtrip at science.ru.nl > > > Subject: Re: [FieldTrip] surfaceplot made by ft_sourceplot sparing > > the > > frontal lobes > > Message-ID: > > > > > > Content-Type: text/plain; charset="iso-8859-1" > > Hi Marlene, > > Could you download today's version of FieldTrip, and let us know > > whether > > this problem still occurs? I'm saying because we just made an update > > to > > surface plotting, potentially solving your issue. > > Best, > > Arjen > > 2014-04-08 9:07 GMT+02:00 Marlene B?nstrup < > > marlene.boenstrup at googlemail.com > > >: > > > Dear fieldtrip-experts, > > > > > > The plot I generated by ft_sourceplot using cfg.method = 'surface' > > > with > > > either projectionemthod 'nearest' or 'project' looks funny. The > > > frontal > > > lobes don't show any activation, they are just left grey. And also > > > specific > > > activations on the cortex are shifted towards the back (y-axis). I > > > compared > > > the same 3-D- sourceactivation data (interpolated on the standard > > > T1 > > > output > > > of ft_interpolate with ft_interpolate) in an orthoplot and there > > > the > > > sourceactivation is neatly arranged in the whole brain volume, > > > including > > > the frontal lobes. So that the mistake must origin in the > > > ft_sourceplot > > > function. > > > I use the version of the 18th of December 2013. > > > > > > Do you know this problem and can help me with it? > > > If not, do you have an idea to solve it or cirumvent it? > > > > > > Thanks in advance, > > > Marlene > > > > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: < > > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/842e34a6/attachment-0001.html > > > > > ------------------------------ > > Message: 4 > > Date: Tue, 8 Apr 2014 09:01:47 +0000 > > From: Tyler Grummett < tyler.grummett at flinders.edu.au > > > To: FieldTrip discussion list < fieldtrip at science.ru.nl > > > Subject: [FieldTrip] fieldtrip2eeglab > > Message-ID: > > < > > 36a06a30eef54304859a734a2deb7153 at SIXPR03MB368.apcprd03.prod.outlook.com > > > > > Content-Type: text/plain; charset="us-ascii" > > ?Hey fieldtrip, > > Is there a fieldtrip2eeglab function somewhere? > > It says in the documentation of 'integrating with eeglab', and I was > > wondering whether there already was one. > > Tyler > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > > PhD Candidate > > Brain Signals Laboratory > > Flinders University > > Rm 5A301 > > Ext 66124 > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: < > > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/6cd8cccb/attachment-0001.html > > > > > ------------------------------ > > Message: 5 > > Date: Tue, 8 Apr 2014 11:19:34 +0200 > > From: Julian Keil < julian.keil at gmail.com > > > To: Tyler Grummett < tyler.grummett at flinders.edu.au >, FieldTrip > > discussion list < fieldtrip at science.ru.nl > > > Subject: [FieldTrip] fieldtrip2eeglab > > Message-ID: < 60EC99B5-A742-420D-84A2-3B86336EB37A at gmail.com > > > Content-Type: text/plain; charset="iso-8859-1" > > Hi Tyler, > > there was a mail by Arno Delorme last year containing the function. > > See below. > > Best, > > Julian > > ******************** > > Dr. Julian Keil > > AG Multisensorische Integration > > Psychiatrische Universit?tsklinik > > der Charit? im St. Hedwig-Krankenhaus > > Gro?e Hamburger Stra?e 5-11, Raum E 307 > > 10115 Berlin > > Telefon: +49-30-2311-1879 > > Fax: +49-30-2311-2209 > > http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration > > Anfang der weitergeleiteten E-Mail: > > > Von: Arnaud Delorme < arno at cerco.ups-tlse.fr > > > > Betreff: Re: [FieldTrip] Channel layout FT to EEGLAB > > > Datum: 29. Oktober 2013 01:27:53 MEZ > > > An: FieldTrip discussion list < fieldtrip at science.ru.nl > > > > Antwort an: FieldTrip discussion list < fieldtrip at science.ru.nl > > > > > > > Dear Rajat, > > > > > > this old function transforms EEG data contained in the Fieldtrip > > > structure into an EEGLAB structure. > > > After you have done that, to transform a channel location file, > > > simply type in > > > > > > EEG.chanlocs = struct('labels', cfg.elec.label, 'X', > > > mattocell(cfg.elec.pnt(1,:)), 'Y', > > > mattocell(cfg.elec.pnt(2,:)),'Z', > > > mattocell(cfg.elec.pnt(3,:))); > > > EEG.chanlocs = convertlocs(EEG.chanlocs, 'cart2all'); > > > > > > This code is untested. You might have to switch X, Y and Z to > > > obtain > > > the correct orientation for the electrode cap. > > > Best, > > > > > > Arno > > > > > > > > > > > > On Oct 28, 2013, at 7:36 AM, Raquel Bibi < bibi.raquel at gmail.com > > > > wrote: > > > > > >> Hi Rajat, > > >> I don't know EEGLAB, but I use the "ordered" option in Fieldtrip > > >> to > > >> display my time-locked ICA components. > > >> > > >> Best, > > >> > > >> Raquel > > >> > > >> > > >> On Mon, Oct 28, 2013 at 9:39 AM, Rajat Thomas < > > >> rajatthomas at gmail.com > wrote: > > >> Dear all, > > >> > > >> I made a layout file using the image of the ecog array I had, > > >> just > > >> like described in the > > >> tutorial. > > >> > > >> I would like to port this to EEGLAB, so that I can use the > > >> various > > >> ICA options to plot > > >> the components at the channel locations and so on. > > >> > > >> Could anyone either point me to a file that does this conversion? > > >> or > > >> Any way of using ICA within fieldtrip to plot the various > > >> components on the different > > >> channels using the layout file? > > >> > > >> I know it is used for channel rejection and so on but any help on > > >> plotting the components > > >> back on the ICA would be appreciated. > > >> > > >> Thanks a lot in advance. > > >> > > >> Rajat > > >> > > >> -- > > >> Rajat Mani Thomas > > >> Netherlands Institute for Neuroscience > > >> Amsterdam, The Netherlands > > >> http://www.cita.utoronto.ca/~thomas > > >> > > >> _______________________________________________ > > >> fieldtrip mailing list > > >> fieldtrip at donders.ru.nl > > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > >> > > >> _______________________________________________ > > >> fieldtrip mailing list > > >> fieldtrip at donders.ru.nl > > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: < > > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0002.html > > > > > -------------- next part -------------- > > A non-text attachment was scrubbed... > > Name: fieldtrip2eeglab.m > > Type: application/octet-stream > > Size: 1141 bytes > > Desc: not available > > URL: < > > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0001.obj > > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: < > > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/e25e10c1/attachment-0003.html > > > > > ------------------------------ > > Message: 6 > > Date: Tue, 8 Apr 2014 11:51:12 +0200 > > From: s.rombetto at cib.na.cnr.it > > To: fieldtrip at science.ru.nl > > Subject: Re: [FieldTrip] denoising data > > Message-ID: < 20140408115112.cn1ddeuo840s8s84 at arco.cib.na.cnr.it > > > Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; > > format="flowed" > > Hi > > I am interested in this topic too. > > As I have mainly environmental noise I use denoise_pca but I would > > like to understand if with a different code I couold improve my S/N > > ratio. Moreover I would ask if there is any difference if you apply > > first one denoising procedure or the other. > > Regards > > Sara Rombetto, PhD > > > Hi Haiteng, > > > > > > Thanks for your reply. > > > > > > Just to be sure if I understand you correctly - do you use BOTH > > > denoise_pca and denoise_synthetic on the same data? > > > > > > If not, how do you choose which one to use? > > > > > > Cheers, > > > Ana > > > > > >> > > >> Dear Ana, > > >> > > >> > > >> If I understand correctly , we use ft_denoise_synthetic and > > >> ft_denoise_pca to reduce noise due to recording (e.g. environment > > >> noise , > > >> thermal noise... ) not the brain signal artefact (e.g eye blink). > > >> Normally > > >> ,I use these two functions in the very early stage . > > >> > > >> Best, > > >> Haiteng > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > ------------------------- > > Dott.ssa Sara Rombetto > > Istituto di Cibernetica > > "E. Caianiello" > > Via Campi Flegrei, 34 > > 80078 Pozzuoli (NA) > > Italy > > mob +39 3401689815 > > tel +39 0818675361 > > fax +39 0818675128 > > Lab MEG 0817483511 > > -------------------------- > > "I disapprove of what you say, but I will defend to the death your > > right to say > > it." [Evelyn Beatrice Hall, The Friends Of Voltaire] > > ---------------------------------------------------------------- > > This message was sent using IMP, the Internet Messaging Program. > > ------------------------------ > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 16 > > ***************************************** > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From hweeling.lee at gmail.com Tue Apr 8 15:56:09 2014 From: hweeling.lee at gmail.com (Hwee Ling Lee) Date: Tue, 8 Apr 2014 15:56:09 +0200 Subject: [FieldTrip] Investigating phase synchronisation in resting state eeg data Message-ID: Dear all, I'm investigating phase synchronisation on resting state eeg data. However, I'm not sure if what I'm doing is appropriate. It will be great if someone could help me on this. So, I've segmented my resting state data into smaller chunks of 10240 timepoints, which is approximately 2s per trial for my dataset. Since I'm mainly interested to know the phase changes at each frequency band, I thought the best way is to perform a mtmfft, using a hanning taper, with 'fourier' as output. I then performed a connectivity analysis on all the channels paired with all channels. Is this appropriate at all? Can one look at phase changes at each frequency band without taking account into time? Or should one look at phase changes at each frequency band along the temporal domain (time, in this case, it would be 2 s per trial)? Also, I noticed that there's the possibility to calculate phase locking value (PLV) and weighted paired wise consistency (WPPC). What are the differences between these two methods? As I'm interested to know which pair of channels are phase synchronised, how should I perform the statistical calculation? Also, how do I represent the data in this case, given that my reference channel is all against all channels? Thanks. Best regards, Hweeling -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.roux at bcbl.eu Tue Apr 8 16:06:36 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Tue, 8 Apr 2014 16:06:36 +0200 (CEST) Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs In-Reply-To: Message-ID: <39462649.1313399.1396965996516.JavaMail.root@bcbl.eu> Hi Diego, thanks for the quick reply. When I compute the rank of the concatenated trials I get rank(concat1) = 202, which is the number of channels that are in the data (planar gradiometers only). So in fact that number corresponds to the default output returned by ft_componentanalysis. Alos, I usually run ICA without PCA component reduction and can identify EOG and ECG quite easily by eye-balling. But, I'd like to figure out what the advantages of PCA reduction are. For instance, will reducing the number of ICs through PCA help to isolate better EOG and ECG components or will the decomposition be the same the only difference being that the algorithm will run faster? Best, Fred Frédéric Roux ----- Original Message ----- From: "Mauricio Antelis" To: "Diego Lozano" , "FieldTrip discussion list" Sent: Tuesday, April 8, 2014 3:36:42 PM Subject: Re: [FieldTrip] using cfg.runica.pca to reduce number of ICs Roberto, Aqui algo sobre el cuentionamiento del numero de componentes para realizar ICA, sin embargo en nuestro caso, creo que no sera un parametro sensible ya que tenemos un numero bajo (21) de mediciones Saludos Mauricio On Tue, Apr 8, 2014 at 8:29 AM, Lozano Soldevilla, D. (Diego) < d.lozanosoldevilla at fcdonders.ru.nl > wrote: Hi Fred, I don't know the magical number but I see the following options: a) Before ICA, concatenate all single trials and ask for the rank of your data. Use it as your cfg.runica.pca input. b) Some users notice that when you sort IC by variance, beyond component 30, the IC topo/activation does not look like physiologically meaningfull. It matches with the PCA reduction before ICA with other papers: http://www.ncbi.nlm.nih.gov/pubmed/15219593 http://www.ncbi.nlm.nih.gov/pubmed/19699307 Might be somebody in the forum have tried (by simulations or in real data) on the effects of PCA component reduction on ICA. I hope it helps, Diego ----- Original Message ----- > From: "Frédéric Roux" < f.roux at bcbl.eu > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > > Sent: Tuesday, 8 April, 2014 2:46:22 PM > Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs > Dear all, > > I have a general question relating to the usage of cfg.runica.pca > during the call to ft_componentanalysis. > > Is it correct to assume that cfg.runica.pca = length(meg_data.label) > will > force the algorithm to return n = length(meg_data.label) ICs, and that > as a > result artifacts can be "spread" across several ICs? > > If that's true, then I imagine that cfg.runica.pac = n/4 will return > less components > and reduce the "spread" of artifacts over several components. > > My question is how to choose the number of principal components to > which the data > is reduced before ICA? > > Best, > Fred > --------------------------------------------------------------------------- > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- PhD Student Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen NL-6525 EN Nijmegen The Netherlands http://www.ru.nl/people/donders/lozano-soldevilla-d/ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Javier M. Antelis _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From gopalar.ccf at gmail.com Tue Apr 8 16:14:56 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Tue, 8 Apr 2014 10:14:56 -0400 Subject: [FieldTrip] regressconfound and timefrequency Message-ID: Arjen, Thanks for all your previous help on using regressconfound. It would be great if you can shed light on some questions I asked earlier (See below). Also, when applying regressconfound to time-frequency (TF) data, regressconfound removes variance from TF from individual trials. So, utimately regressconfound helps to improve the induced TF responses rather than evoked responses. (By induced, I mean calculating TF on trial by trial basis and then computing average, But evoked I mean calculating TF on averaged data) If one is interested in only evoked, then regressconfound would not be of much help. Is that correct? Thanks, Raghavan Date: Wed, 26 Feb 2014 11:38:23 -0500 From: Raghavan Gopalakrishnan To: fieldtrip at science.ru.nl Arjen, I agree with your steps and your assumptions about my data, though I am only interested in evoked activity. I am indeed doing the steps 1 and 2 in the correct order. I just kept the 4 blocks and confounds associated with them separate from each other (for book keeping purposes), but I used the mean head position of all 4 blocks to demean the translations and rotations in each block. Technically, I guess this is the same as appending the blocks prior to running regress confound. When I said, "However, the problem is, whatever significance I found earlier (i.e. by comparing means rather than t-statistic) doesn?t test significant now.? I was comparing the means of the data that has been run through regress confound. When I plot (sum square of all gradiometers in each subject in each condition) before and after regress confound, I see some differences. Should I not see any differences at all? But there is one catch. What do I do if I am comparing a condition across different time points, rather than 2 conditions in one time point? MEG collected at two different time points will have different average head positions. In that case, should I use one average head position (computed from time point - 1) and use that to demean the translations and rotations in rest of the time points? Thanks for your support. -- *Raghavan Gopalakrishnan,* *Principal Research Engineer, * *Cleveland Clinic* -------------- next part -------------- An HTML attachment was scrubbed... URL: From gopalar.ccf at gmail.com Mon Apr 7 18:59:33 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Mon, 7 Apr 2014 12:59:33 -0400 Subject: [FieldTrip] regressconfound Message-ID: Arjen, Thanks for all your previous help on using regressconfound. It would be great if you can shed light on some questions I asked earlier (See below). Also, when applying regressconfound to time-frequency (TF) data, regressconfound removes variance from TF from individual trials. So, utimately regressconfound helps to improve the induced TF responses rather than evoked responses. (By induced, I mean calculating TF on trial by trial basis and then computing average, But evoked I mean calculating TF on averaged data) If one is interested in only evoked, then regressconfound would not be of much help. Is that correct? Thanks, Raghavan Date: Wed, 26 Feb 2014 11:38:23 -0500 From: Raghavan Gopalakrishnan To: fieldtrip at science.ru.nl Subject: [FieldTrip] regressconfound and statistics Message-ID: Content-Type: text/plain; charset=windows-1252 Arjen, I agree with your steps and your assumptions about my data, though I am only interested in evoked activity. I am indeed doing the steps 1 and 2 in the correct order. I just kept the 4 blocks and confounds associated with them separate from each other (for book keeping purposes), but I used the mean head position of all 4 blocks to demean the translations and rotations in each block. Technically, I guess this is the same as appending the blocks prior to running regress confound. When I said, "However, the problem is, whatever significance I found earlier (i.e. by comparing means rather than t-statistic) doesn?t test significant now.? I was comparing the means of the data that has been run through regress confound. When I plot (sum square of all gradiometers in each subject in each condition) before and after regress confound, I see some differences. Should I not see any differences at all? But there is one catch. What do I do if I am comparing a condition across different time points, rather than 2 conditions in one time point? MEG collected at two different time points will have different average head positions. In that case, should I use one average head position (computed from time point - 1) and use that to demean the translations and rotations in rest of the time points? Thanks for your support. Raghavan -- -------------- next part -------------- An HTML attachment was scrubbed... URL: From d.lozanosoldevilla at fcdonders.ru.nl Tue Apr 8 17:45:19 2014 From: d.lozanosoldevilla at fcdonders.ru.nl (Lozano Soldevilla, D. (Diego)) Date: Tue, 8 Apr 2014 17:45:19 +0200 (CEST) Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs In-Reply-To: <39462649.1313399.1396965996516.JavaMail.root@bcbl.eu> Message-ID: <2014237779.6280165.1396971919021.JavaMail.root@sculptor.zimbra.ru.nl> Hi Fred, This is a difficult question and I don't know the answer. Searching a bit more, I've found that some experts strongly do not recommend PCA before ICA with very good reasons: http://sccn.ucsd.edu/pipermail/eeglablist/2010/003339.html http://sccn.ucsd.edu/pipermail/eeglablist/2013/006101.html Another possibility (the one I'm using in my data) is to correlate the vertical EOG time courses (or the horizontal EOG) with all ICs. The rationale is that you want to find the independent component whose time courses are more similar to the EOG time courses. Then you can reduce the potential IC candidates that contain the prototypical artifacts using prior knowledge. You'll see that 2/3 of them show high correlations (in comparison with other ICs) with topographies that resemble blinks (or eye movements respectively). For ECG you can try the same strategy or use a very similar approach using coherence: http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts However, you should had recorded the ECG, vertical and horizontal EOGs, butI don't know if this is the case. If not, I'd recommend you to record them in future experiments (just by my own experience). Best, Diego ----- Original Message ----- > From: "Frédéric Roux" > To: "FieldTrip discussion list" > Sent: Tuesday, 8 April, 2014 4:06:36 PM > Subject: Re: [FieldTrip] using cfg.runica.pca to reduce number of ICs > Hi Diego, > > thanks for the quick reply. > > When I compute the rank of the concatenated trials I get rank(concat1) > = 202, which is the number of > channels that are in the data (planar gradiometers only). So in fact > that number corresponds to the default > output returned by ft_componentanalysis. > > Alos, I usually run ICA without PCA component reduction and can > identify EOG and ECG quite easily by > eye-balling. But, I'd like to figure out what the advantages of PCA > reduction are. > > For instance, will reducing the number of ICs through PCA help to > isolate better EOG and ECG components > or will the decomposition be the same the only difference being that > the algorithm will run faster? > > Best, > > Fred > > Frédéric Roux > > ----- Original Message ----- > From: "Mauricio Antelis" > To: "Diego Lozano" , "FieldTrip > discussion list" > Sent: Tuesday, April 8, 2014 3:36:42 PM > Subject: Re: [FieldTrip] using cfg.runica.pca to reduce number of ICs > > > > Roberto, > > > Aqui algo sobre el cuentionamiento del numero de componentes para > realizar ICA, sin embargo en nuestro caso, creo que no sera un > parametro sensible ya que tenemos un numero bajo (21) de mediciones > > > Saludos > > > Mauricio > > > > > > On Tue, Apr 8, 2014 at 8:29 AM, Lozano Soldevilla, D. (Diego) < > d.lozanosoldevilla at fcdonders.ru.nl > wrote: > > > Hi Fred, > > I don't know the magical number but I see the following options: > > a) Before ICA, concatenate all single trials and ask for the rank of > your data. Use it as your cfg.runica.pca input. > > b) Some users notice that when you sort IC by variance, beyond > component 30, the IC topo/activation does not look like > physiologically meaningfull. It matches with the PCA reduction before > ICA with other papers: > > http://www.ncbi.nlm.nih.gov/pubmed/15219593 > http://www.ncbi.nlm.nih.gov/pubmed/19699307 > > Might be somebody in the forum have tried (by simulations or in real > data) on the effects of PCA component reduction on ICA. > > I hope it helps, > > Diego > > ----- Original Message ----- > > From: "Frédéric Roux" < f.roux at bcbl.eu > > > To: "FieldTrip discussion list" < fieldtrip at science.ru.nl > > > Sent: Tuesday, 8 April, 2014 2:46:22 PM > > Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs > > Dear all, > > > > I have a general question relating to the usage of cfg.runica.pca > > during the call to ft_componentanalysis. > > > > Is it correct to assume that cfg.runica.pca = length(meg_data.label) > > will > > force the algorithm to return n = length(meg_data.label) ICs, and > > that > > as a > > result artifacts can be "spread" across several ICs? > > > > If that's true, then I imagine that cfg.runica.pac = n/4 will return > > less components > > and reduce the "spread" of artifacts over several components. > > > > My question is how to choose the number of principal components to > > which the data > > is reduced before ICA? > > > > Best, > > Fred > > --------------------------------------------------------------------------- > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- > PhD Student > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > NL-6525 EN Nijmegen > The Netherlands > http://www.ru.nl/people/donders/lozano-soldevilla-d/ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > > Javier M. Antelis > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- PhD Student Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen NL-6525 EN Nijmegen The Netherlands http://www.ru.nl/people/donders/lozano-soldevilla-d/ From a.stolk at fcdonders.ru.nl Tue Apr 8 18:16:37 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Tue, 8 Apr 2014 18:16:37 +0200 (CEST) Subject: [FieldTrip] regressconfound In-Reply-To: Message-ID: <1308756546.6280583.1396973797760.JavaMail.root@sculptor.zimbra.ru.nl> Hey Raghavan, You're welcome. A quick solution to set you in the right direction would be to point you to the respective documentation: http://www.sciencedirect.com/science/article/pii/S1053811912011597 I believe some, maybe most, of your points are addressed by that paper (saving some copy&pasting in here). best, Arjen ----- Oorspronkelijk bericht ----- > Van: "Raghavan Gopalakrishnan" > Aan: "fieldtrip" > Verzonden: Maandag 7 april 2014 18:59:33 > Onderwerp: [FieldTrip] regressconfound > Arjen, > Thanks for all your previous help on using regressconfound. > It would be great if you can shed light on some questions I asked > earlier (See below). > Also, when applying regressconfound to time-frequency (TF) data, > regressconfound removes variance from TF from individual trials. So, > utimately regressconfound helps to improve the induced TF responses > rather than evoked responses. (By induced, I mean calculating TF on > trial by trial basis and then computing average, But evoked I mean > calculating TF on averaged data) > If one is interested in only evoked, then regressconfound would not be > of much help. Is that correct? > Thanks, > Raghavan > Date: Wed, 26 Feb 2014 11:38:23 -0500 > From: Raghavan Gopalakrishnan < gopalar.ccf at gmail.com > > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] regressconfound and statistics > Message-ID: < A36DB35E-1C8A-4C8A-A0F3-083B8E1131C1 at gmail.com > > Content-Type: text/plain; charset=windows-1252 > Arjen , > I agree with your steps and your assumptions about my data, though I > am only interested in evoked activity. I am indeed doing the steps 1 > and 2 in the correct order. I just kept the 4 blocks and confounds > associated with them separate from each other (for book keeping > purposes), but I used the mean head position of all 4 blocks to demean > the translations and rotations in each block. Technically, I guess > this is the same as appending the blocks prior to running regress > confound. > When I said, "However, the problem is, whatever significance I found > earlier (i.e. by comparing means rather than t-statistic) doesn?t test > significant now.? I was comparing the means of the data that has been > run through regress confound. When I plot (sum square of all > gradiometers in each subject in each condition) before and after > regress confound, I see some differences. Should I not see any > differences at all? > But there is one catch. What do I do if I am comparing a condition > across different time points, rather than 2 conditions in one time > point? MEG collected at two different time points will have different > average head positions. In that case, should I use one average head > position (computed from time point - 1) and use that to demean the > translations and rotations in rest of the time points? > Thanks for your support. > Raghavan > -- > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Tue Apr 8 18:31:41 2014 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Tue, 8 Apr 2014 12:31:41 -0400 Subject: [FieldTrip] regressconfound In-Reply-To: References: Message-ID: Hello Raghavan, I am actually looking at GLM head motion correction method (FieldTrip regressconfound) with some phantom MEG data and found a few things that might be of interest to you: - the method is best for Evoked Response analysis as it requires trial averaging at the end of the correction (you want to average motion corrected data not data that has motion); the method works for the resting state too but with an error linearly increasing with the amount of motion - you should see differences in before and after regressconfound correction as the method re-aligns the waveforms for one (initial=averaged) head position; you will even see the differences if comparing true recordings (no motions) to recordings with the motion (which I did with the phantom) as the method is not perfect and can't possibly remove all motion confounds/effects completely - your question: "What do I do if I am comparing a condition across different time points, rather than 2 conditions in one time point?", my answer: I would use one (initial) averaged head position (for 1st trail for example) to compare, because you want to convert/correct your measurements for *relative comparison* and they should represent the same head position (for better statistical sensitivity). Arjen, Please correct me if I am mistaking. Cheers, Inna Wake Forest Baptist Health MEG lab Inna McGowin On Mon, Apr 7, 2014 at 12:59 PM, Raghavan Gopalakrishnan < gopalar.ccf at gmail.com> wrote: > Arjen, > > Thanks for all your previous help on using regressconfound. > It would be great if you can shed light on some questions I asked earlier > (See below). > Also, when applying regressconfound to time-frequency (TF) data, > regressconfound removes variance from TF from individual trials. So, > utimately regressconfound helps to improve the induced TF responses rather > than evoked responses. (By induced, I mean calculating TF on trial by trial > basis and then computing average, But evoked I mean calculating TF on > averaged data) > If one is interested in only evoked, then regressconfound would not be of > much help. Is that correct? > > Thanks, > Raghavan > > > > > > > Date: Wed, 26 Feb 2014 11:38:23 -0500 > From: Raghavan Gopalakrishnan > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] regressconfound and statistics > Message-ID: > Content-Type: text/plain; charset=windows-1252 > > Arjen, > > I agree with your steps and your assumptions about my data, though I am > only interested in evoked activity. I am indeed doing the steps 1 and 2 in > the correct order. I just kept the 4 blocks and confounds associated with > them separate from each other (for book keeping purposes), but I used the > mean head position of all 4 blocks to demean the translations and rotations > in each block. Technically, I guess this is the same as appending the > blocks prior to running regress confound. > > When I said, "However, the problem is, whatever significance I found > earlier (i.e. by comparing means rather than t-statistic) doesn?t test > significant now.? I was comparing the means of the data that has been run > through regress confound. When I plot (sum square of all gradiometers in > each subject in each condition) before and after regress confound, I see > some differences. Should I not see any differences at all? > > But there is one catch. What do I do if I am comparing a condition across > different time points, rather than 2 conditions in one time point? MEG > collected at two different time points will have different average head > positions. In that case, should I use one average head position (computed > from time point - 1) and use that to demean the translations and rotations > in rest of the time points? > > > Thanks for your support. > Raghavan > -- > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Wed Apr 9 09:21:24 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Wed, 9 Apr 2014 09:21:24 +0200 Subject: [FieldTrip] =?utf-8?q?Re=EF=BC=9AInvestigating_phase_synchronisat?= =?utf-8?q?ion_in_resting_state_eeg_data?= Message-ID: > > Dear Hwee, > In your case, you can calculate the phase consistency across trials at each frequency, thus , you don't temporal domain information within each trial. I recommend you to use imagery part of coherence since it is insensitive to the volume conduction . In FT . you can specify ft_connectivityanalysis with cfg.output = 'imag'. After this , you get chan*Chan connectivity matrix . Regarding to the statistic, you can do permutation test by randomize the time sequence within each trial 1000 times then calculate randomized chan*chan connectivity distribution. In the end ,you can use cluster-statistic framework to find the synchronized channel clusters. I don't know how to incorporate within FT. Hope it helps, Haiteng > Message: 7 > Date: Tue, 8 Apr 2014 15:56:09 +0200 > From: Hwee Ling Lee > To: FieldTrip discussion list > Subject: [FieldTrip] Investigating phase synchronisation in resting > state eeg data > Message-ID: > Z-zVfb2S-Zovo8_k9pw at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Dear all, > > I'm investigating phase synchronisation on resting state eeg data. However, > I'm not sure if what I'm doing is appropriate. It will be great if someone > could help me on this. > > So, I've segmented my resting state data into smaller chunks of 10240 > timepoints, which is approximately 2s per trial for my dataset. > > Since I'm mainly interested to know the phase changes at each frequency > band, I thought the best way is to perform a mtmfft, using a hanning taper, > with 'fourier' as output. I then performed a connectivity analysis on all > the channels paired with all channels. Is this appropriate at all? Can one > look at phase changes at each frequency band without taking account into > time? Or should one look at phase changes at each frequency band along the > temporal domain (time, in this case, it would be 2 s per trial)? > > > Also, I noticed that there's the possibility to calculate phase locking > value (PLV) and weighted paired wise consistency (WPPC). What are the > differences between these two methods? As I'm interested to know which pair > of channels are phase synchronised, how should I perform the statistical > calculation? Also, how do I represent the data in this case, given that my > reference channel is all against all channels? > > Thanks. > > Best regards, > Hweeling > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140408/96bf9c22/attachment.html > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 18 > ***************************************** > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From marlene.boenstrup at googlemail.com Wed Apr 9 10:35:16 2014 From: marlene.boenstrup at googlemail.com (=?ISO-8859-1?Q?Marlene_B=F6nstrup?=) Date: Wed, 9 Apr 2014 10:35:16 +0200 Subject: [FieldTrip] surfaceplot made by ft_sourceplot sparing the frontal lobes Message-ID: Dear Arjen, I followed your advice to use the most recent version of fieldtrip again for checking the update on ft_sourceplot . But the one of Monday and Tuesday (7th and 8th) don't seem to work. I can't unzip them, the file is apparently invalid. Would it be possible to send me the updated ft_sourceplot function until the problem with the serverversion is fixed? Best, Marlene -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.stolk at fcdonders.ru.nl Wed Apr 9 11:12:52 2014 From: a.stolk at fcdonders.ru.nl (Stolk, A. (Arjen)) Date: Wed, 9 Apr 2014 11:12:52 +0200 (CEST) Subject: [FieldTrip] surfaceplot made by ft_sourceplot sparing the frontal lobes In-Reply-To: Message-ID: <94880540.6290098.1397034772571.JavaMail.root@sculptor.zimbra.ru.nl> Hi Marlene, Yes, that would be a good idea indeed, see attached. However, no guarantee that it would work as functions typically depend on other functionalities. But have a try, and see if it fixes your issue. If the issue is still there, it might be unrelated to that particular fix, and it may be worth reporting its as a potential bug, with sufficient information for replicating your steps . See some useful documentation below. where to report: http://bugzilla.fcdonders.nl/ how to report: http://fieldtrip.fcdonders.nl/bugzilla best, Arjen ----- Oorspronkelijk bericht ----- > Van: "Marlene Bönstrup" > Aan: fieldtrip at science.ru.nl > Verzonden: Woensdag 9 april 2014 10:35:16 > Onderwerp: [FieldTrip] surfaceplot made by ft_sourceplot sparing the > frontal lobes > Dear Arjen, > I followed your advice to use the most recent version of fieldtrip > again for checking the update on ft_sourceplot . But the one of Monday > and Tuesday (7th and 8th) don't seem to work. I can't unzip them, the > file is apparently invalid. Would it be possible to send me the > updated ft_sourceplot function until the problem with the > serverversion is fixed? > Best, Marlene > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Email: a.stolk at donders.ru.nl Phone: +31(0)243 68294 Web: www.arjenstolk.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ft_sourceplot.m Type: text/x-matlab Size: 62372 bytes Desc: not available URL: From r.oostenveld at donders.ru.nl Wed Apr 9 14:32:42 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 9 Apr 2014 14:32:42 +0200 Subject: [FieldTrip] Zip file of yesterday's version seems to be corrupted (2014-04-07) In-Reply-To: <201404081511.46850.Holger.Krause@med.uni-duesseldorf.de> References: <201404081511.46850.Holger.Krause@med.uni-duesseldorf.de> Message-ID: Hi Holger and Marlene The zip file was indeed corrupt, due to the file system getting too full. I have removed the zipfile and checked all others that are now there, they all seem fine to me. I hope you can live without the 20140407 and that the later versions work. For all people that do very regular updates of fieldtrip, please do consider svn or git as alternatives to ftp. Those are shortly described (with additional pointes to other documentation) on http://fieldtrip.fcdonders.nl/faq/i_am_having_problems_downloading_from_the_ftp_server. best regards, Robert On 08 Apr 2014, at 15:11, Holger Krause wrote: > Hi, > > Yesterday night my script for downloading the latest fieldtrip version failed. > Today I manually downloaded > , of which the > md5sum is 7ebc176eedc038581d17ecbb46bd0832. > > zipinfo complains about invalid archive: > > $ zipinfo fieldtrip-20140407.zip > Archive: fieldtrip-20140407.zip > Zip file size: 296098459 bytes, number of entries: 8079 > error [fieldtrip-20140407.zip]: start of central directory not found; > zipfile corrupt. > > Other users seem to be affected as well (see Marlene Bönstrup's mail from > today.) > > BR, > > Holger > > -- > Dr. rer. nat. Holger Krause MEG-Labor, Raum 13.54.-1.84 > Telefon: +49 211 81-19031 Institut für klinische Neurowissenschaften > http://www.uniklinik-duesseldorf.de/klinneurowiss Uniklinik Düsseldorf > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From r.vandermeij at donders.ru.nl Thu Apr 10 12:01:29 2014 From: r.vandermeij at donders.ru.nl (Roemer van der Meij) Date: Thu, 10 Apr 2014 12:01:29 +0200 Subject: [FieldTrip] using cfg.runica.pca to reduce number of ICs In-Reply-To: <591175772.1312154.1396961182187.JavaMail.root@bcbl.eu> References: <591175772.1312154.1396961182187.JavaMail.root@bcbl.eu> Message-ID: Hi Fred, cfg.runica.pca sets cfg.numcomponent for runica (corrected in revision on ft tonight). If you use ICA to remove artifacts for subsequent analyses, please keep in mind that any structure not covered by the extracted components is lost. As such, I would advice you to extract the maximum number of components, or if to computationally expensive, the number of components that explain, say, 99% of the variance of the covariance matrix. You can do this for example by: % determine cfg.numcomponent by doing an eig on the covariance matrix covar = zeros(numel(data.label)); for itrial = 1:numel(data.trial) currtrial = data.trial{itrial}; covar = covar + currtrial*currtrial.'; end [V, D] = eig(covar); D = sort(diag(D),'descend'); D = D ./ sum(D); Dcum = cumsum(D); cfg.numcomponent = find(Dcum>.99,1,'first'); Best, Roemer On Tue, Apr 8, 2014 at 2:46 PM, Frédéric Roux wrote: > Dear all, > > I have a general question relating to the usage of cfg.runica.pca > during the call to ft_componentanalysis. > > Is it correct to assume that cfg.runica.pca = length(meg_data.label) will > force the algorithm to return n = length(meg_data.label) ICs, and that as a > result artifacts can be "spread" across several ICs? > > If that's true, then I imagine that cfg.runica.pac = n/4 will return less > components > and reduce the "spread" of artifacts over several components. > > My question is how to choose the number of principal components to which > the data > is reduced before ICA? > > Best, > Fred > --------------------------------------------------------------------------- > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Roemer van der Meij M.Sc. PhD Candidate Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3655932 E-mail: r.vandermeij at donders.ru.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From gopalar.ccf at gmail.com Thu Apr 10 22:15:44 2014 From: gopalar.ccf at gmail.com (Raghavan Gopalakrishnan) Date: Thu, 10 Apr 2014 16:15:44 -0400 Subject: [FieldTrip] artifact routines - cfg.trl Message-ID: Dear all, When detecting artifacts in EEG data, all the folllowing routines requires cfg.trl to be specified ft_artifact_eog, ft_artifact_muscle and ft_artifact_threshold. However, if I have the data already parsed into trials, i.e. run through ft_preprocessing, can I run these above mentioned routines? I see ft_artifact_zvalue does not require the cfg.trl field, but all others (mentioned above) do? Can this be addressed. Please advise. Thanks, Raghavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Fri Apr 11 00:28:28 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Thu, 10 Apr 2014 22:28:28 +0000 Subject: [FieldTrip] artifact routines - cfg.trl In-Reply-To: References: Message-ID: <6C755E38-CB80-403F-A2EC-8DE32DF1AE6D@flinders.edu.au> I don't know I this will help but I found that the making cfg.trl = [data.sample info, 0] to work fine. How have you found the artefact correction algorithms? I've noticed that some take out unnecessary segments of EEG. Kin regards, Tyler > On 11 Apr 2014, at 5:47 am, "Raghavan Gopalakrishnan" wrote: > > Dear all, > > When detecting artifacts in EEG data, all the folllowing routines requires cfg.trl to be specified > ft_artifact_eog, ft_artifact_muscle and ft_artifact_threshold. > However, if I have the data already parsed into trials, i.e. run through ft_preprocessing, can I run these above mentioned routines? > I see ft_artifact_zvalue does not require the cfg.trl field, but all others (mentioned above) do? Can this be addressed. > Please advise. > > Thanks, > Raghavan > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From tyler.grummett at flinders.edu.au Fri Apr 11 04:38:01 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Fri, 11 Apr 2014 02:38:01 +0000 Subject: [FieldTrip] TRENTOOL bad channel combinations Message-ID: ?Hello fieldtrip, Has anyone worked out how to handle bad channel combinations in TRENTOOL using TEprepare? In my experience it just crashes. I am hoping for a way to calculate the bad channel combinations before running TEprepare. If anyone can help, that will be greatly appreciated!! Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patricia.Wollstadt at gmx.de Fri Apr 11 11:12:23 2014 From: Patricia.Wollstadt at gmx.de (Patricia Wollstadt) Date: Fri, 11 Apr 2014 11:12:23 +0200 Subject: [FieldTrip] TRENTOOL bad channel combinations In-Reply-To: References: Message-ID: <5347B1F7.1080303@gmx.de> Hello Tyler, TRENTOOL does not support the exclusion of channels like FieldTrip does (e.g. {'all', '-MLx', '-EOG'}), you have to explicitly specify channels OR combinations of channels for analysis in the cfg structure passed to TEprepare: % cfg.sgncmb = list of channelpairs cell array (Nx(source, target)) % or % cfg.channel = list of channels cell array - testing will be done all-by-all If you provide a list of channel combinations in cfg.sgncmb, TRENTOOL will analyze these combinations only; if you provide a list of channels in cfg.channel, TEprepare will build all possible channel combinations from the list and TRENTOOL will analyze these combinations. (Also, channel names have to match the channel labels in data.label.) So, a way to exclude bad channel combinations would be to provide a list of all channels that should be included in the analysis in cfg.channel and let TEprepare build the channel combinations from that. I hope this answers your question. Please let me know if you encounter any more problems. Best, Patricia On 04/11/2014 04:38 AM, Tyler Grummett wrote: > > Hello fieldtrip, > > > Has anyone worked out how to handle bad channel combinations in > TRENTOOL using TEprepare? > > > In my experience it just crashes. I am hoping for a way to calculate > the bad channel combinations before running TEprepare. > > > If anyone can help, that will be greatly appreciated!! > > > Tyler > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip ------------------------------------------------------------ Patricia Wollstadt, PhD Student MEG Unit, Brain Imaging Center Goethe University, Frankfurt, Germany Heinrich Hoffmann Strasse 10, Haus 93 B D - 60528 Frankfurt am Main -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Fri Apr 11 11:36:29 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Fri, 11 Apr 2014 09:36:29 +0000 Subject: [FieldTrip] append trials after artefact correction Message-ID: <1e1f1c2ba0864d8c86dd3dd6a22a106c@SIXPR03MB368.apcprd03.prod.outlook.com> ?Hello everyone, Is there any way to append trials after running artefact correction algorithms that break the data up into trials. It has issues in later calculations, such as transfer entropy in TRENTOOL Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Fri Apr 11 12:44:45 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Fri, 11 Apr 2014 10:44:45 +0000 Subject: [FieldTrip] TRENTOOL bad channel combinations In-Reply-To: <5347B1F7.1080303@gmx.de> References: , <5347B1F7.1080303@gmx.de> Message-ID: ?Hello Patricia, I have previously selected the channels that are EEG, I am not entering in 'EEG' or anything. cfgTEP = []; cfgTEP.Path2TSTOOL = fullfile( matlabrootpath, 'Matlab', 'OpenTSTOOL'); % dont add this to matlab path cfgTEP.toi = [ min( [vchan.time{ :}]), max( [vchan.time{ :}])]; cfgTEP.channel = vchan.label( comps);? After playing around with it for a bit I dont think it is the channel combinations, but the data. If I can ask a separate question, what is an optimal length for the trials? My trials are about 500 ms long and it gives me the following error: Error using TEprepare (line 710) TRENTOOL ERROR: Not enough points in timeseries for current analysis settings: cfg.repPred too big, or max(cfg.ragdim)*max(cfg.ragtaurange) too big, or maximum u to big It is recommended that the cfgTEP.repPred is size(data.trial{1,1},2)*(3/4) However it only works for me if it is size(data.trial{1,1},2)*(3/9)?. Then it runs fine, but Im worried about changing this. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Patricia Wollstadt Sent: Friday, 11 April 2014 6:42 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] TRENTOOL bad channel combinations Hello Tyler, TRENTOOL does not support the exclusion of channels like FieldTrip does (e.g. {'all', '-MLx', '-EOG'}), you have to explicitly specify channels OR combinations of channels for analysis in the cfg structure passed to TEprepare: % cfg.sgncmb = list of channelpairs cell array (Nx(source, target)) % or % cfg.channel = list of channels cell array - testing will be done all-by-all If you provide a list of channel combinations in cfg.sgncmb, TRENTOOL will analyze these combinations only; if you provide a list of channels in cfg.channel, TEprepare will build all possible channel combinations from the list and TRENTOOL will analyze these combinations. (Also, channel names have to match the channel labels in data.label.) So, a way to exclude bad channel combinations would be to provide a list of all channels that should be included in the analysis in cfg.channel and let TEprepare build the channel combinations from that. I hope this answers your question. Please let me know if you encounter any more problems. Best, Patricia On 04/11/2014 04:38 AM, Tyler Grummett wrote: ?Hello fieldtrip, Has anyone worked out how to handle bad channel combinations in TRENTOOL using TEprepare? In my experience it just crashes. I am hoping for a way to calculate the bad channel combinations before running TEprepare. If anyone can help, that will be greatly appreciated!! Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip ------------------------------------------------------------ Patricia Wollstadt, PhD Student MEG Unit, Brain Imaging Center Goethe University, Frankfurt, Germany Heinrich Hoffmann Strasse 10, Haus 93 B D - 60528 Frankfurt am Main -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at fcdonders.ru.nl Fri Apr 11 12:48:11 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Fri, 11 Apr 2014 12:48:11 +0200 (CEST) Subject: [FieldTrip] Question re: TMS-EEG FT Tutorial In-Reply-To: References: Message-ID: <003701cf5573$886ba630$9942f290$@herring@fcdonders.ru.nl> Dear Bingshuo, I am forwarding your e-mail to the Fieldtrip mailinglist so that others can benefit and/or contribute from our discussion. The reason why I like to postpone the interpolation to after the ICA is that I noticed that when interpolating before ICA the interpolated data would load onto one component. Removing this component did not make sense as it would leave a flat line in the TEP, keeping it in did not make sense either because the interpolation was done with, for example, the decay artifact still in the data. After removing the decay artifact with ICA you would be left with a sharp peak in the interpolated segment. I see that it is difficult to reject trials and channels before interpolation but keep in mind that before having done ICA large amounts of variance of the data can be explained by the TMS related artifacts, these will most likely cloud the detection of other types of artifacts with functions such as ft_rejectvisual. In my experience bad channels show up as separate independent components anyway and can be removed after having run the ICA, but that may depend on a number of factors I'm not aware of. If you would like to reject bad channels prior to running ICA you could also try to run ft_rejectvisual and specify cfg.latency to contain only your pre-TMS period or a period post-TMS that does not contain any large artifacts. That way you should at least be able to run metrics on your data to remove bad channels. In any case you can always run ft_databrowser on your data to visually inspect your channel time courses for bad channels prior to running the ICA. In any case you are of course free to try running the ICA after interpolation yourself and share your experiences, perhaps this works fine for you J Best, Jim From: Bingshuo Li [mailto:bingshuo.li at cin.uni-tuebingen.de] Sent: donderdag 10 april 2014 16:36 To: j.herring at fcdonders.ru.nl Subject: Question re: TMS-EEG FT Tutorial Dear Jim, I inquired you about a TMS-EEG question a while ago and you referred me to the TMS-EEG tutorial on Fieldtrip's website. As I was following the steps of the tutorial, there is a new question that come up to me -- Is it really necessary to postpone the interpolation of the TMS artifact until the ICA is done? Would there be any bad consequences if I interpolate first and then run the ICA over the entire interpolated trial(s)? The reason I am asking this question is that I would like to visually inspect my data first and remove bad channels or trials (if any) prior to ICA. If the artifact is not interpolated, it is really difficult to run visual inspection or metrics on the data.. Following the logic of the tutorial, I can only visual inspection after the ICA, which I think might not be a good idea as I was told that a bad channel can easily bias the ICA result.. Do you have any insights in this? Thank you very much for your time in advance! Sincerely, ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at cin.uni-tuebingen.de +49-7071-29-89029 On Mon, Feb 10, 2014 at 3:24 PM, Herring, J.D. (Jim) wrote: Dear Bingshuo, Please have a look at the following tutorial: http://fieldtrip.fcdonders.nl/tutorial/tms-eeg It deals with a number of TMS-EEG related artifacts including the 'evil' decay artifact. Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Bingshuo Li Sent: maandag 10 februari 2014 15:06 To: FieldTrip discussion list Subject: [FieldTrip] TMS-EEG Decay Artifact Dear FT users and developers, Does anyone have any experience in dealing with the so-called decay artifacts found in TMS-EEG? It is a relatively long lasting (up to 100ms) artifact that follows a waveform similar to exponential decay and it occurs sporadically in certain recording channels. Any tips/hints/recommendations are greatly appreciated! Thank you! Regards, ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at student.uni-tuebingen.de +49-152-06054831 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.hasanzadeh22 at yahoo.com Fri Apr 11 15:09:04 2014 From: f.hasanzadeh22 at yahoo.com (=?utf-8?B?4oCqRi5IYXNhbnphZGXigKwg4oCq?=) Date: Fri, 11 Apr 2014 14:09:04 +0100 (BST) Subject: [FieldTrip] (no subject) Message-ID: <1397221744.51555.YahooMailNeo@web171305.mail.ir2.yahoo.com> f.hasanzadeh22 at yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.hasanzadeh22 at yahoo.com Fri Apr 11 15:24:54 2014 From: f.hasanzadeh22 at yahoo.com (=?utf-8?B?4oCqRi5IYXNhbnphZGXigKwg4oCq?=) Date: Fri, 11 Apr 2014 14:24:54 +0100 (BST) Subject: [FieldTrip] a question Message-ID: <1397222694.1541.YahooMailNeo@web171304.mail.ir2.yahoo.com> Dear community, My name is Fateme Hasanzade and I am working on EEG signals. Currently I am analysing data of a project, where we recorded using EEG.I have a data such that every channel has 1 value that is result of some calculation(I mean I have 14 channel thus a data vector of length14).I want to plot map of head how  every channel has a color corresponding its  value... I tried using  ft_topoplotER to assess my data and I made the true layout but when I want to use ft_topoplotER receive the following error message:  Subscript indices must either be real positive integers or logicals. Error in topoplot_common (line 79) data = varargin{indx}; Error in ft_topoplotER (line 169) cfg = topoplot_common(cfg, varargin{:}); Error in top (line 19) figure; ft_topoplotER(cfg,data); colorbar;  my quetion is how should I give this data  to function to  have true topographic plot of my data? Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From Patricia.Wollstadt at gmx.de Fri Apr 11 17:36:21 2014 From: Patricia.Wollstadt at gmx.de (Patricia Wollstadt) Date: Fri, 11 Apr 2014 17:36:21 +0200 Subject: [FieldTrip] TRENTOOL bad channel combinations In-Reply-To: References: , <5347B1F7.1080303@gmx.de> Message-ID: <53480BF5.1020800@gmx.de> Hello Tyler, okay, I'd say the script should run like this (regarding channel selection). Maybe it's really the data then. If you keep getting errors, you can send me those as well. Regarding the number of data points: The error you are getting depends on a number of parameters TEprepare uses to determine the optimal embedding dimension and embedding delay. TEprepare checks whether you have enough samples in one trial after taking into account the ACT, cfg.actthrvalue, cfg.ragdim, cfg.ragtau and the assumed interaction delay (these parameters determine the maximum possible length, i.e. the worst case, of your embedding). Could you tell me the sampling rate of your data? If your data was sampled at 1000Hz, 3/9th of 500 ms should give you about 167 sample points for cfg.repPred, which would be okay. Otherwise, you may alter the parameters mentioned above, e.g. you can check whether you could lower the actthrvalue. The actthrvalue is used to exclude all trials with an ACT higher than the threshold. The value you put in there should be based on the filtering of the data prior to TE analysis (e.g. if you highpass filter your data at 10 Hz and have a sampling rate of 1000Hz, you shouldn't find any autocorrelation above 100 samples. In that case, you may use 100 as a threshold). What values do you enter for the other parameters (assumed interaction delay u, specified in cfg.predicttimemin_u/cfg.predicttimemax_u, embedding parameters to be scanned in cfg.ragdim and cfg.ragtau)? Maybe you can adjust those as well, to be able to enter a higher value for .repPred. Best, Patricia On 04/11/2014 12:44 PM, Tyler Grummett wrote: > > Hello Patricia, > > > I have previously selected the channels that are EEG, I am not > entering in 'EEG' or anything. > > > cfgTEP = []; > cfgTEP.Path2TSTOOL = fullfile( matlabrootpath, 'Matlab', > 'OpenTSTOOL'); % dont add this to matlab path > cfgTEP.toi = [ min( [vchan.time{ :}]), max( [vchan.time{ > :}])]; > cfgTEP.channel = vchan.label( comps); > > > After playing around with it for a bit I dont think it is the channel > combinations, but the data. > > > If I can ask a separate question, what is an optimal length for the > trials? My trials are about 500 ms long and it gives me the following > error: > > > Error using TEprepare (line 710) > TRENTOOL ERROR: Not enough points in timeseries for current analysis > settings: cfg.repPred too big, or > max(cfg.ragdim)*max(cfg.ragtaurange) too big, or maximum u to big > > It is recommended that the cfgTEP.repPred is size(data.trial{1,1},2)*(3/4) > > However it only works for me if it is size(data.trial{1,1},2)*(3/9) . > > Then it runs fine, but Im worried about changing this. > > Tyler > > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > ------------------------------------------------------------------------ > *From:* fieldtrip-bounces at science.ru.nl > on behalf of Patricia Wollstadt > > *Sent:* Friday, 11 April 2014 6:42 PM > *To:* FieldTrip discussion list > *Subject:* Re: [FieldTrip] TRENTOOL bad channel combinations > > Hello Tyler, > > TRENTOOL does not support the exclusion of channels like FieldTrip > does (e.g. {'all', '-MLx', '-EOG'}), you have to explicitly specify > channels OR combinations of channels for analysis in the cfg structure > passed to TEprepare: > > % cfg.sgncmb = list of channelpairs cell array (Nx(source, target)) > % or > % cfg.channel = list of channels cell array - testing will be > done all-by-all > > If you provide a list of channel combinations in cfg.sgncmb, TRENTOOL > will analyze these combinations only; if you provide a list of > channels in cfg.channel, TEprepare will build all possible channel > combinations from the list and TRENTOOL will analyze these > combinations. (Also, channel names have to match the channel labels in > data.label.) > > So, a way to exclude bad channel combinations would be to provide a > list of all channels that should be included in the analysis in > cfg.channel and let TEprepare build the channel combinations from that. > > I hope this answers your question. Please let me know if you encounter > any more problems. > > Best, > Patricia > > > > On 04/11/2014 04:38 AM, Tyler Grummett wrote: >> >> Hello fieldtrip, >> >> >> Has anyone worked out how to handle bad channel combinations in >> TRENTOOL using TEprepare? >> >> >> In my experience it just crashes. I am hoping for a way to calculate >> the bad channel combinations before running TEprepare. >> >> >> If anyone can help, that will be greatly appreciated!! >> >> >> Tyler >> >> >> ************************* >> >> /Tyler Grummett ( BBSc, BSc(Hons I))/ >> /PhD Candidate/ >> /Brain Signals Laboratory/ >> /Flinders University/ >> /Rm 5A301/ >> /Ext 66124/ >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > ------------------------------------------------------------ > > Patricia Wollstadt, PhD Student > > MEG Unit, Brain Imaging Center > > Goethe University, Frankfurt, Germany > > Heinrich Hoffmann Strasse 10, Haus 93 B > > D - 60528 Frankfurt am Main > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- ------------------------------------------------------------ Patricia Wollstadt, PhD Student MEG Unit, Brain Imaging Center Goethe University, Frankfurt, Germany Heinrich Hoffmann Strasse 10, Haus 93 B D - 60528 Frankfurt am Main -------------- next part -------------- An HTML attachment was scrubbed... URL: From politzerahless at gmail.com Sat Apr 12 12:24:32 2014 From: politzerahless at gmail.com (Stephen Politzer-Ahles) Date: Sat, 12 Apr 2014 14:24:32 +0400 Subject: [FieldTrip] a question Message-ID: Hello Fateme, I believe ft_topoplotER needs its input to be a Fieldtrip data structure that is the output of ft_timelockanalysis (i.e., the structure includes an 'avg' field that is a channels x timepoints matrix, and in the fall to ft_topoplotER you specify cfg.param='avg'). It sounds like your pinput is not a structure like this, but is a 1-dimensional vector. You can plot a vector like this pretty easily using the topoplot() function of the EEGLAB toolbox. (There may also be ways to do it in Fieldtrip but I'm not aware of them; I've only ever used ft_topoplotER with a timelock structure. Someone else on the list might know some tricks, though). Best, Steve Stephen Politzer-Ahles New York University, Abu Dhabi Neuroscience of Language Lab http://www.nyu.edu/projects/politzer-ahles/ > > ------------------------------ > > Message: 4 > Date: Fri, 11 Apr 2014 14:24:54 +0100 (BST) > From: ?F.Hasanzade? ? > To: "fieldtrip at science.ru.nl" > Subject: [FieldTrip] a question > Message-ID: > <1397222694.1541.YahooMailNeo at web171304.mail.ir2.yahoo.com> > Content-Type: text/plain; charset="utf-8" > > Dear community, > My name is Fateme Hasanzade and I am working on EEG signals. > Currently I am analysing data of a project, where we recorded using EEG.I > have a data such that every channel has 1 value that is result of some > calculation(I mean I have 14 channel thus a data vector of length14).I want > to plot map of head how? every channel has a color corresponding its? > value... > > > I tried using? ft_topoplotER to assess my data and I made the true layout > but when I want to use ft_topoplotER receive the following error message:? > > Subscript indices must either be real positive integers or logicals. > > Error in topoplot_common (line 79) > data = varargin{indx}; > > Error in ft_topoplotER (line 169) > cfg = topoplot_common(cfg, varargin{:}); > > Error in top (line 19) > figure; ft_topoplotER(cfg,data); colorbar;? > > my quetion is how should I give this data? to function to? have true > topographic plot of my data? > > > Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Sat Apr 12 13:18:00 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Sat, 12 Apr 2014 13:18:00 +0200 Subject: [FieldTrip] a question In-Reply-To: References: Message-ID: <534920E8.8060003@donders.ru.nl> Hi Fateme, in addition to what Stephen said, it might help if you provide more insight into what you are doing by including the function call, this includes: * The cfg you used * The fields of your data structure * The line you called that gave an error / that you would like to ask a question on * The exact error message you got see also http://fieldtrip.fcdonders.nl/faq/how_to_ask_good_questions_to_the_community also, check out our wiki and make use of the search functionality. There might be some FAQs and example scripts that are useful for you, e.g. http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat?s[]=import Hope any of this helps! Best, Jörn On 4/12/2014 12:24 PM, Stephen Politzer-Ahles wrote: > > Hello Fateme, > > I believe ft_topoplotER needs its input to be a Fieldtrip data > structure that is the output of ft_timelockanalysis (i.e., the > structure includes an 'avg' field that is a channels x timepoints > matrix, and in the fall to ft_topoplotER you specify cfg.param='avg'). > It sounds like your pinput is not a structure like this, but is a > 1-dimensional vector. > > You can plot a vector like this pretty easily using the topoplot() > function of the EEGLAB toolbox. (There may also be ways to do it in > Fieldtrip but I'm not aware of them; I've only ever used ft_topoplotER > with a timelock structure. Someone else on the list might know some > tricks, though). > > Best, > Steve > > > Stephen Politzer-Ahles > New York University, Abu Dhabi > Neuroscience of Language Lab > http://www.nyu.edu/projects/politzer-ahles/ > > > ------------------------------ > > Message: 4 > Date: Fri, 11 Apr 2014 14:24:54 +0100 (BST) > From: ?F.Hasanzade? ? > > To: "fieldtrip at science.ru.nl " > > > Subject: [FieldTrip] a question > Message-ID: > <1397222694.1541.YahooMailNeo at web171304.mail.ir2.yahoo.com > > > Content-Type: text/plain; charset="utf-8" > > Dear community, > My name is Fateme Hasanzade and I am working on EEG signals. > Currently I am analysing data of a project, where we recorded > using EEG.I have a data such that every channel has 1 value that > is result of some calculation(I mean I have 14 channel thus a data > vector of length14).I want to plot map of head how? every channel > has a color corresponding its? value... > > > I tried using? ft_topoplotER to assess my data and I made the true > layout but when I want to use ft_topoplotER receive the following > error message:? > > Subscript indices must either be real positive integers or logicals. > > Error in topoplot_common (line 79) > data = varargin{indx}; > > Error in ft_topoplotER (line 169) > cfg = topoplot_common(cfg, varargin{:}); > > Error in top (line 19) > figure; ft_topoplotER(cfg,data); colorbar;? > > my quetion is how should I give this data? to function to? have > true topographic plot of my data? > > > Thank you > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jan.schoffelen at donders.ru.nl Sat Apr 12 21:03:52 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Sat, 12 Apr 2014 21:03:52 +0200 Subject: [FieldTrip] ft_sourceplot: issue with cfg.method = 'surface' Message-ID: <752EAE5A-22C3-4050-AEEA-E2FF07E81042@donders.ru.nl> Dear fieldtrippers, Despite our best efforts, there has been an inconvenient bug in ft_sourceplot, which has been present in r9031-r9400 (Dec 13, 2013-April 12,2014). In particular, the images constructed when using cfg.method = 'surface' were incorrect. The issue pertains to the on-the-fly interpolation onto a cortical sheet of volumetrically (i.e. on a 3D grid) source-reconstructed data. I updated the cortical sheets last December, and replaced the handcrafted exemplars by the ones from the SPM surfrend toolbox. The motivation for all this would be to have a better reference to the actual data used. The bottom line of all this is that I made a mistake, and directly used the surfaces loaded from the Freesurfer file format, without taking into account the fact that in the Freesurfer convention the coordinate system in these files is slightly different than standard space. As a consequence these surfaces were misregistered to the 3D anatomical image in standard space, and thus to incorrect interpolations of the functional data onto these surfaces. This issue has been identified thanks to Marlene Bönstrup and has been fixed today. Any sourceplots with cfg.method = 'surface' that have been made with FieldTrip versions originating from between the dates mentioned above will incorrectly represent the source reconstructed data, and may need to be re-done. More info can be found on http://fieldtrip.fcdonders.nl/template/anatomy. I am very sorry for any inconvenience this may have caused. Best wishes, Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Mon Apr 14 03:53:10 2014 From: v.piai.research at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Piai?=) Date: Sun, 13 Apr 2014 18:53:10 -0700 Subject: [FieldTrip] freqstatistics with sbj_chan_freq Message-ID: <534B3F86.9070904@gmail.com> Hi all, I'm kinda stuck not being able to figure out what's going wrong with my freqstats, so I thought I could share it here and see if anyone can see where I'm going wrong. When I run freqstatistics on TFRs, I get a negative cluster (p = .001) between 8 and 25 Hz with the topography very similar to the one in the figure. But I just want non-time-resolved spectra. So I have power spectra calculated with mtmfft (dpss tapers) between 1 and 50 Hz (5 Hz smoothing) and this is the one for which I've been trying to run freqstatistics, unsuccessfully. I'm using a pretty standard cfg for freqstats (basically, the same I use for the TFRs, which give me the negative cluster with p =.001) and the data in the comparison are structured as sbj_chan_freq. With this time-unresolved data, only posclusters are detected, with ps > .4! If I plot the stat output, it has the exact same negative cluster as I get for the TFRs (see Figure), and as far as I can see, no real positive cluster, but the function doesn't even detect any negative clusters. I must be doing something wrong because the time-resolved and -unresolved effects are pretty much the same in the descriptives. I remember running stats on time-unresolved data before and getting a reasonable output, so I guess my ft_freqstatistics isn't working well right now. I just can't figure out why. Does anyone have any tips for how I could go about to find out why the negative clusters are being disregarded? Thanks a lot, Vitória -------------- next part -------------- A non-text attachment was scrubbed... Name: freqstats.gif Type: image/gif Size: 28839 bytes Desc: not available URL: From tyler.grummett at flinders.edu.au Mon Apr 14 04:54:16 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 14 Apr 2014 02:54:16 +0000 Subject: [FieldTrip] automatic artifact correction after virtual channels/beamformer Message-ID: ?Hello all, I was just wondering whether it is necessary to use the artifact corrected data when creating virtual channels from beamformer sources or whether you are able to use original, non-artifact corrected data. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Mon Apr 14 06:37:45 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 14 Apr 2014 04:37:45 +0000 Subject: [FieldTrip] TRENTOOL bad channel combinations In-Reply-To: <53480BF5.1020800@gmx.de> References: , <5347B1F7.1080303@gmx.de> , <53480BF5.1020800@gmx.de> Message-ID: Hello Patricia, To answer your questions, yes my sampling rate is 1000Hz. Some additional details about my data: I am analysing continuous data from 10 subjects (as a test). One of the tasks they did is approximately 3 minutes. I have been marking out the data ( which breaks the data up into trials) and then taking a one second epoch from each of the trials. What is the smallest length of data (in seconds) that transfer entropy can be run on? ​Should I leave it as one long length of data? The inherent problem with that is the various trial lengths, I am fairly sure that TEprepare crashes if the trials are of a various length. Interestingly, the function doesnt crash on data that I have artefact corrected (1-second trials) and on sources that explain more than 95% of the variance (after applying beamformer and PCA). For example, if I had 1400 brain sources (after beamformer and virtual channel calculation), and only 12 of the brain sources explain up to 95% of the variance then I pick those 12 and run TEprepare on it and it runs without issue. So I havent needed to change many of the configuration settings around after that. Its only the length of trial and the number of trials that concern me now. One last note, is that there has been discussions on the eeglab discussion list about applying a 1-Hz highpass filter to your data. They think that it may interfere with the 'future' of the signal, ultimately disrupting the transfer entropy calculation (or any other connectivity measure). Tyler. ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Patricia Wollstadt Sent: Saturday, 12 April 2014 1:06 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] TRENTOOL bad channel combinations Hello Tyler, okay, I'd say the script should run like this (regarding channel selection). Maybe it's really the data then. If you keep getting errors, you can send me those as well. Regarding the number of data points: The error you are getting depends on a number of parameters TEprepare uses to determine the optimal embedding dimension and embedding delay. TEprepare checks whether you have enough samples in one trial after taking into account the ACT, cfg.actthrvalue, cfg.ragdim, cfg.ragtau and the assumed interaction delay (these parameters determine the maximum possible length, i.e. the worst case, of your embedding). Could you tell me the sampling rate of your data? If your data was sampled at 1000Hz, 3/9th of 500 ms should give you about 167 sample points for cfg.repPred, which would be okay. Otherwise, you may alter the parameters mentioned above, e.g. you can check whether you could lower the actthrvalue. The actthrvalue is used to exclude all trials with an ACT higher than the threshold. The value you put in there should be based on the filtering of the data prior to TE analysis (e.g. if you highpass filter your data at 10 Hz and have a sampling rate of 1000Hz, you shouldn't find any autocorrelation above 100 samples. In that case, you may use 100 as a threshold). What values do you enter for the other parameters (assumed interaction delay u, specified in cfg.predicttimemin_u/cfg.predicttimemax_u, embedding parameters to be scanned in cfg.ragdim and cfg.ragtau)? Maybe you can adjust those as well, to be able to enter a higher value for .repPred. Best, Patricia On 04/11/2014 12:44 PM, Tyler Grummett wrote: ​Hello Patricia, I have previously selected the channels that are EEG, I am not entering in 'EEG' or anything. cfgTEP = []; cfgTEP.Path2TSTOOL = fullfile( matlabrootpath, 'Matlab', 'OpenTSTOOL'); % dont add this to matlab path cfgTEP.toi = [ min( [vchan.time{ :}]), max( [vchan.time{ :}])]; cfgTEP.channel = vchan.label( comps);​ After playing around with it for a bit I dont think it is the channel combinations, but the data. If I can ask a separate question, what is an optimal length for the trials? My trials are about 500 ms long and it gives me the following error: Error using TEprepare (line 710) TRENTOOL ERROR: Not enough points in timeseries for current analysis settings: cfg.repPred too big, or max(cfg.ragdim)*max(cfg.ragtaurange) too big, or maximum u to big It is recommended that the cfgTEP.repPred is size(data.trial{1,1},2)*(3/4) However it only works for me if it is size(data.trial{1,1},2)*(3/9)​ . Then it runs fine, but Im worried about changing this. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Patricia Wollstadt Sent: Friday, 11 April 2014 6:42 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] TRENTOOL bad channel combinations Hello Tyler, TRENTOOL does not support the exclusion of channels like FieldTrip does (e.g. {'all', '-MLx', '-EOG'}), you have to explicitly specify channels OR combinations of channels for analysis in the cfg structure passed to TEprepare: % cfg.sgncmb = list of channelpairs cell array (Nx(source, target)) % or % cfg.channel = list of channels cell array - testing will be done all-by-all If you provide a list of channel combinations in cfg.sgncmb, TRENTOOL will analyze these combinations only; if you provide a list of channels in cfg.channel, TEprepare will build all possible channel combinations from the list and TRENTOOL will analyze these combinations. (Also, channel names have to match the channel labels in data.label.) So, a way to exclude bad channel combinations would be to provide a list of all channels that should be included in the analysis in cfg.channel and let TEprepare build the channel combinations from that. I hope this answers your question. Please let me know if you encounter any more problems. Best, Patricia On 04/11/2014 04:38 AM, Tyler Grummett wrote: ​Hello fieldtrip, Has anyone worked out how to handle bad channel combinations in TRENTOOL using TEprepare? In my experience it just crashes. I am hoping for a way to calculate the bad channel combinations before running TEprepare. If anyone can help, that will be greatly appreciated!! Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip ------------------------------------------------------------ Patricia Wollstadt, PhD Student MEG Unit, Brain Imaging Center Goethe University, Frankfurt, Germany Heinrich Hoffmann Strasse 10, Haus 93 B D - 60528 Frankfurt am Main _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- ------------------------------------------------------------ Patricia Wollstadt, PhD Student MEG Unit, Brain Imaging Center Goethe University, Frankfurt, Germany Heinrich Hoffmann Strasse 10, Haus 93 B D - 60528 Frankfurt am Main -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Mon Apr 14 08:08:34 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Mon, 14 Apr 2014 08:08:34 +0200 Subject: [FieldTrip] freqstatistics with sbj_chan_freq (Vit?ria Piai) Message-ID: Hi Viotira, If you don't care about time information , you can average it by specifying cfg.avgovertime = 'yes' on the TFR , then the cluster will be formed in channel-frequency format. If you use mtmfft , you should pre-select effect interval . Otherwise, it could be not consistent . Best, Haiteng > Message: 1 > Date: Sun, 13 Apr 2014 18:53:10 -0700 > From: Vit?ria Piai > To: FieldTrip discussion list > Subject: [FieldTrip] freqstatistics with sbj_chan_freq > Message-ID: <534B3F86.9070904 at gmail.com> > Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" > > Hi all, > > I'm kinda stuck not being able to figure out what's going wrong with my > freqstats, so I thought I could share it here and see if anyone can see > where I'm going wrong. > When I run freqstatistics on TFRs, I get a negative cluster (p = .001) > between 8 and 25 Hz with the topography very similar to the one in the > figure. But I just want non-time-resolved spectra. > So I have power spectra calculated with mtmfft (dpss tapers) between 1 > and 50 Hz (5 Hz smoothing) and this is the one for which I've been > trying to run freqstatistics, unsuccessfully. > I'm using a pretty standard cfg for freqstats (basically, the same I use > for the TFRs, which give me the negative cluster with p =.001) and the > data in the comparison are structured as sbj_chan_freq. With this > time-unresolved data, only posclusters are detected, with ps > .4! If I > plot the stat output, it has the exact same negative cluster as I get > for the TFRs (see Figure), and as far as I can see, no real positive > cluster, but the function doesn't even detect any negative clusters. > I must be doing something wrong because the time-resolved and > -unresolved effects are pretty much the same in the descriptives. I > remember running stats on time-unresolved data before and getting a > reasonable output, so I guess my ft_freqstatistics isn't working well > right now. I just can't figure out why. > Does anyone have any tips for how I could go about to find out why the > negative clusters are being disregarded? > > Thanks a lot, Vit?ria > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Mon Apr 14 08:23:30 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Mon, 14 Apr 2014 08:23:30 +0200 Subject: [FieldTrip] automatic artifact correction after virtual channels/beamformer Message-ID: Hi Tyler, It is always nice to computate virtual MEG channels based on artifact-corrected CLEAN data . Note that we use clean data to get the inverse spatial filter by DICS. Regrading to how to create virtual channel , please have a look at tutorial: http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors Best, Haiteng > Message: 2 > Date: Mon, 14 Apr 2014 02:54:16 +0000 > From: Tyler Grummett > To: FieldTrip discussion list > Subject: [FieldTrip] automatic artifact correction after virtual > channels/beamformer > Message-ID: > < > d9f26aff9ba640b29bfa36febf84e9cc at SIXPR03MB368.apcprd03.prod.outlook.com> > > Content-Type: text/plain; charset="us-ascii" > > ?Hello all, > > > I was just wondering whether it is necessary to use the artifact corrected > data when creating virtual channels from beamformer sources > > or whether you are able to use original, non-artifact corrected data. > > > Tyler > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140414/dca251ee/attachment-0001.html > > > > ------------------------------ > > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Mon Apr 14 09:26:44 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 14 Apr 2014 07:26:44 +0000 Subject: [FieldTrip] automatic artifact correction after virtual channels/beamformer In-Reply-To: References: Message-ID: <149bb27d65e749c5b37bb3bfab16e87b@SIXPR03MB368.apcprd03.prod.outlook.com> Hello Haiteng, Thankyou for the response. Yes I have gone through the tutorial. I use clean data to make the inverse spatial filter. But do then apply it to marked out data or can apply it to non-marked out data. Also, is there a way to append trials after you run an automatic artefact rejection algorithm over it? At the moment, I am trying to use a function that requires equal trial lengths. I can use ft_redefinetrial to grab a 2 second epoch from each 'trial'. However that feel a little crude as I am throwing out a lot of data. Your help will be greatly appreciated. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Haiteng Jiang Sent: Monday, 14 April 2014 3:53 PM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] automatic artifact correction after virtual channels/beamformer Hi Tyler, It is always nice to computate virtual MEG channels based on artifact-corrected CLEAN data . Note that we use clean data to get the inverse spatial filter by DICS. Regrading to how to create virtual channel , please have a look at tutorial: http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors Best, Haiteng Message: 2 Date: Mon, 14 Apr 2014 02:54:16 +0000 From: Tyler Grummett > To: FieldTrip discussion list > Subject: [FieldTrip] automatic artifact correction after virtual channels/beamformer Message-ID: > Content-Type: text/plain; charset="us-ascii" ?Hello all, I was just wondering whether it is necessary to use the artifact corrected data when creating virtual channels from beamformer sources or whether you are able to use original, non-artifact corrected data. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Mon Apr 14 13:34:11 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Mon, 14 Apr 2014 13:34:11 +0200 Subject: [FieldTrip] automatic artifact correction after virtual channels/beamformer Message-ID: > > Hi Tyler , > I think it makes sense to apply the inverse spatial filter on the the marked out data since you build it on this interval. In other words, non-marked out intervals data has different inverse filter. I don't understand appending trials after automatic artefact detection. Do you mean keep trials after automatic artefact detection ? Best, Haiteng > > Message: 3 > Date: Mon, 14 Apr 2014 07:26:44 +0000 > From: Tyler Grummett > To: FieldTrip discussion list > Subject: Re: [FieldTrip] automatic artifact correction after virtual > channels/beamformer > Message-ID: > < > 149bb27d65e749c5b37bb3bfab16e87b at SIXPR03MB368.apcprd03.prod.outlook.com> > > Content-Type: text/plain; charset="us-ascii" > > Hello Haiteng, > > > Thankyou for the response. Yes I have gone through the tutorial. I use > clean data to make the inverse spatial filter. But do then apply it to > > marked out data or can apply it to non-marked out data. Also, is there a > way to append trials after you run an automatic artefact > > rejection algorithm over it? At the moment, I am trying to use a function > that requires equal trial lengths. I can use ft_redefinetrial > > to grab a 2 second epoch from each 'trial'. However that feel a little > crude as I am throwing out a lot of data. > > > Your help will be greatly appreciated. > > > Tyler > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > ________________________________ > From: fieldtrip-bounces at science.ru.nl > on behalf of Haiteng Jiang > Sent: Monday, 14 April 2014 3:53 PM > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] automatic artifact correction after virtual > channels/beamformer > > Hi Tyler, > It is always nice to computate virtual MEG channels based on > artifact-corrected CLEAN data . Note that we use clean data to get the > inverse spatial filter by DICS. Regrading to how to create virtual > channel , please have a look at tutorial: > http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors > > Best, > Haiteng > > > > Message: 2 > Date: Mon, 14 Apr 2014 02:54:16 +0000 > From: Tyler Grummett tyler.grummett at flinders.edu.au>> > To: FieldTrip discussion list fieldtrip at science.ru.nl>> > Subject: [FieldTrip] automatic artifact correction after virtual > channels/beamformer > Message-ID: > < > d9f26aff9ba640b29bfa36febf84e9cc at SIXPR03MB368.apcprd03.prod.outlook.com > d9f26aff9ba640b29bfa36febf84e9cc at SIXPR03MB368.apcprd03.prod.outlook.com>> > > Content-Type: text/plain; charset="us-ascii" > > ?Hello all, > > > I was just wondering whether it is necessary to use the artifact corrected > data when creating virtual channels from beamformer sources > > or whether you are able to use original, non-artifact corrected data. > > > Tyler > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140414/dca251ee/attachment-0001.html > > > > ------------------------------ > > > > > -- > Haiteng Jiang > PhD candidate > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Visiting address > Room 2.32 > Donders Centre for Cognitive Neuroimaging > Kapittelweg 29 > 6525 EN Nijmegen > the Netherlands > > Tel.: +31 (0)243668291 > Web: https://sites.google.com/site/haitengjiang/ > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140414/c2da1c20/attachment-0001.html > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 25 > ***************************************** > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.piai.research at gmail.com Mon Apr 14 17:45:05 2014 From: v.piai.research at gmail.com (=?ISO-8859-1?Q?Vit=F3ria_Piai?=) Date: Mon, 14 Apr 2014 08:45:05 -0700 Subject: [FieldTrip] freqstatistics with sbj_chan_freq (Vit?ria Piai) In-Reply-To: References: Message-ID: <534C0281.6010807@gmail.com> Thanks a lot, Haiteng, but that was not really the issue. I have a specific interval I'm interested in and by using dpss over that interval, my frequency resolution is better than if I use TFRs and then average. The problem really was in my cfg for the stats and I've just found out what it was. Don't know why (stupid me!!), but I set cfg.tail = 1 and that of course will only give me the right tail (posclusters!!) Thanks anyways, Vitória On 4/13/2014 11:08 PM, Haiteng Jiang wrote: > Hi Viotira, > If you don't care about time information , you can average it by > specifying cfg.avgovertime = 'yes' on the TFR , then the cluster will > be formed in channel-frequency format. If you use mtmfft , you > should pre-select effect interval . Otherwise, it could be not > consistent . > Best, > Haiteng > > > > > Message: 1 > Date: Sun, 13 Apr 2014 18:53:10 -0700 > From: Vit?ria Piai > > To: FieldTrip discussion list > > Subject: [FieldTrip] freqstatistics with sbj_chan_freq > Message-ID: <534B3F86.9070904 at gmail.com > > > Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" > > Hi all, > > I'm kinda stuck not being able to figure out what's going wrong > with my > freqstats, so I thought I could share it here and see if anyone > can see > where I'm going wrong. > When I run freqstatistics on TFRs, I get a negative cluster (p = .001) > between 8 and 25 Hz with the topography very similar to the one in the > figure. But I just want non-time-resolved spectra. > So I have power spectra calculated with mtmfft (dpss tapers) between 1 > and 50 Hz (5 Hz smoothing) and this is the one for which I've been > trying to run freqstatistics, unsuccessfully. > I'm using a pretty standard cfg for freqstats (basically, the same > I use > for the TFRs, which give me the negative cluster with p =.001) and the > data in the comparison are structured as sbj_chan_freq. With this > time-unresolved data, only posclusters are detected, with ps > .4! > If I > plot the stat output, it has the exact same negative cluster as I get > for the TFRs (see Figure), and as far as I can see, no real positive > cluster, but the function doesn't even detect any negative clusters. > I must be doing something wrong because the time-resolved and > -unresolved effects are pretty much the same in the descriptives. I > remember running stats on time-unresolved data before and getting a > reasonable output, so I guess my ft_freqstatistics isn't working well > right now. I just can't figure out why. > Does anyone have any tips for how I could go about to find out why the > negative clusters are being disregarded? > > Thanks a lot, Vit?ria > > -- > Haiteng Jiang > PhD candidate > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Visiting address > Room 2.32 > Donders Centre for Cognitive Neuroimaging > Kapittelweg 29 > 6525 EN Nijmegen > the Netherlands > > Tel.: +31 (0)243668291 > Web: https://sites.google.com/site/haitengjiang/ > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Tue Apr 15 08:13:18 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 15 Apr 2014 06:13:18 +0000 Subject: [FieldTrip] plotting virtual channels on TRENTOOL's TEplot2D Message-ID: ?Hello TRENTOOL and fieldtrip users, Has anyone been able to plot virtual channels using TRENTOOL's TEplot2D function? It requires a layout file that is prepared in ft_prepare_layout, but I cant seem to work it out with virtual channels. Tyler. ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Tue Apr 15 08:22:59 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 15 Apr 2014 06:22:59 +0000 Subject: [FieldTrip] TRENTOOL no edges Message-ID: Hello fieldtrip and TRENTOOL users, I have just finished running some TE analyses on a subject and when I have run TEgraphanalysis, it has told me that I have 16 vertexes (channels) and no edges. I had a look at the permutation values and they are pretty much all: 1.0000 0 0 NaN 1.0000 ?I must be going wrong somewhere because I find it hard to think that the channels I have chosen have no functional relationship. Can anyone help? Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Tue Apr 15 09:03:00 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Tue, 15 Apr 2014 07:03:00 +0000 Subject: [FieldTrip] automatic artifact correction after virtual channels/beamformer In-Reply-To: References: Message-ID: Hi Haiteng, Basically the automatic artefact detection algorithms removes some EEG (if artefactual) and splits the data into two trials. These trials are not the same size. TRENTOOL can only work on trials that are the same length. So I determined what the biggest trial length was and redefined the trials. ie cfg = [] cfg.length = x length ​ft_redefinetrial( cfg, data) However this is causing computational errors later on. So I was wondering whether you could append the trials together and place a discontinuation marker between them. The other thing I tried was to pass in the argument 'nan' into the reject artefact function, but then this causes an issue with the virtual channel procedure. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl on behalf of Haiteng Jiang Sent: Monday, 14 April 2014 9:04 PM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] automatic artifact correction after virtual channels/beamformer Hi Tyler , I think it makes sense to apply the inverse spatial filter on the the marked out data since you build it on this interval. In other words, non-marked out intervals data has different inverse filter. I don't understand appending trials after automatic artefact detection. Do you mean keep trials after automatic artefact detection ? Best, Haiteng Message: 3 Date: Mon, 14 Apr 2014 07:26:44 +0000 From: Tyler Grummett > To: FieldTrip discussion list > Subject: Re: [FieldTrip] automatic artifact correction after virtual channels/beamformer Message-ID: <149bb27d65e749c5b37bb3bfab16e87b at SIXPR03MB368.apcprd03.prod.outlook.com> Content-Type: text/plain; charset="us-ascii" Hello Haiteng, Thankyou for the response. Yes I have gone through the tutorial. I use clean data to make the inverse spatial filter. But do then apply it to marked out data or can apply it to non-marked out data. Also, is there a way to append trials after you run an automatic artefact rejection algorithm over it? At the moment, I am trying to use a function that requires equal trial lengths. I can use ft_redefinetrial to grab a 2 second epoch from each 'trial'. However that feel a little crude as I am throwing out a lot of data. Your help will be greatly appreciated. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 ________________________________ From: fieldtrip-bounces at science.ru.nl > on behalf of Haiteng Jiang > Sent: Monday, 14 April 2014 3:53 PM To: fieldtrip at science.ru.nl Subject: Re: [FieldTrip] automatic artifact correction after virtual channels/beamformer Hi Tyler, It is always nice to computate virtual MEG channels based on artifact-corrected CLEAN data . Note that we use clean data to get the inverse spatial filter by DICS. Regrading to how to create virtual channel , please have a look at tutorial: http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors Best, Haiteng Message: 2 Date: Mon, 14 Apr 2014 02:54:16 +0000 From: Tyler Grummett >> To: FieldTrip discussion list >> Subject: [FieldTrip] automatic artifact correction after virtual channels/beamformer Message-ID: >> Content-Type: text/plain; charset="us-ascii" ?Hello all, I was just wondering whether it is necessary to use the artifact corrected data when creating virtual channels from beamformer sources or whether you are able to use original, non-artifact corrected data. Tyler ************************* Tyler Grummett ( BBSc, BSc(Hons I)) PhD Candidate Brain Signals Laboratory Flinders University Rm 5A301 Ext 66124 -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip End of fieldtrip Digest, Vol 41, Issue 25 ***************************************** -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Apr 15 11:47:13 2014 From: jm.horschig at donders.ru.nl (=?UTF-8?B?IkrDtnJuIE0uIEhvcnNjaGlnIg==?=) Date: Tue, 15 Apr 2014 11:47:13 +0200 Subject: [FieldTrip] automatic artifact correction after virtual channels/beamformer In-Reply-To: References: Message-ID: <534D0021.401@donders.ru.nl> Hi Tyler, the only way to keep the trial as a whole and still 'mark' artifactual periods is by calling ft_rejectartifact on your preprocessed data (i.e. original data incl. artifacts) using cfg.artctdef.reject = 'nan'. This will sets periods in which an artifact was detected to nan. However, there might be several downsides with this, as not all fieldtrip functions work with nans in your data. I have absolutely no clue how trentool is handling this. The only other alternative you have is to remove the whole trial, so that all your trials are of equal lengths. Maybe you can achieve a similar thing (nan-ing of artifacts) by ft_redefinetrial and specify the original .trl-matrix (given that you have not resampled). Not exactly sure, but you can give it a try if you do not have the original preprocessed data at hand anymore. Best, Jörn On 4/15/2014 9:03 AM, Tyler Grummett wrote: > > Hi Haiteng, > > > Basically the automatic artefact detection algorithms removes some EEG > (if artefactual) and splits the data into two trials. These trials are > not the same size. > > > TRENTOOL can only work on trials that are the same length. So I > determined what the biggest trial length was and redefined the trials. > > > ie cfg = [] > > cfg.length = x length > > ​ft_redefinetrial( cfg, data) > > > However this is causing computational errors later on. So I was > wondering whether you could append the trials together and place a > discontinuation marker between them. > > > The other thing I tried was to pass in the argument 'nan' into the > reject artefact function, but then this causes an issue with the > virtual channel procedure. > > > Tyler > > > ************************* > > /Tyler Grummett ( BBSc, BSc(Hons I))/ > /PhD Candidate/ > /Brain Signals Laboratory/ > /Flinders University/ > /Rm 5A301/ > /Ext 66124/ > ------------------------------------------------------------------------ > *From:* fieldtrip-bounces at science.ru.nl > on behalf of Haiteng Jiang > > *Sent:* Monday, 14 April 2014 9:04 PM > *To:* fieldtrip at science.ru.nl > *Subject:* Re: [FieldTrip] automatic artifact correction after virtual > channels/beamformer > > Hi Tyler , > > I think it makes sense to apply the inverse spatial filter on the the > marked out data since you build it on this interval. In other words, > non-marked out intervals data has different inverse filter. I don't > understand appending trials after automatic artefact detection. Do you > mean keep trials after automatic artefact detection ? > > Best, > Haiteng > > > Message: 3 > Date: Mon, 14 Apr 2014 07:26:44 +0000 > From: Tyler Grummett > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] automatic artifact correction after virtual > channels/beamformer > Message-ID: > <149bb27d65e749c5b37bb3bfab16e87b at SIXPR03MB368.apcprd03.prod.outlook.com > > > > Content-Type: text/plain; charset="us-ascii" > > Hello Haiteng, > > > Thankyou for the response. Yes I have gone through the tutorial. I > use clean data to make the inverse spatial filter. But do then > apply it to > > marked out data or can apply it to non-marked out data. Also, is > there a way to append trials after you run an automatic artefact > > rejection algorithm over it? At the moment, I am trying to use a > function that requires equal trial lengths. I can use ft_redefinetrial > > to grab a 2 second epoch from each 'trial'. However that feel a > little crude as I am throwing out a lot of data. > > > Your help will be greatly appreciated. > > > Tyler > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > ________________________________ > From: fieldtrip-bounces at science.ru.nl > > > on behalf of Haiteng > Jiang > > Sent: Monday, 14 April 2014 3:53 PM > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] automatic artifact correction after > virtual channels/beamformer > > Hi Tyler, > It is always nice to computate virtual MEG channels based on > artifact-corrected CLEAN data . Note that we use clean data to get > the inverse spatial filter by DICS. Regrading to how to create > virtual channel , please have a look at tutorial: > http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors > > Best, > Haiteng > > > > Message: 2 > Date: Mon, 14 Apr 2014 02:54:16 +0000 > From: Tyler Grummett >> > To: FieldTrip discussion list >> > Subject: [FieldTrip] automatic artifact correction after virtual > channels/beamformer > Message-ID: > >> > > Content-Type: text/plain; charset="us-ascii" > > ?Hello all, > > > I was just wondering whether it is necessary to use the artifact > corrected data when creating virtual channels from beamformer sources > > or whether you are able to use original, non-artifact corrected data. > > > Tyler > > > ************************* > > Tyler Grummett ( BBSc, BSc(Hons I)) > PhD Candidate > Brain Signals Laboratory > Flinders University > Rm 5A301 > Ext 66124 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > > > > -- > Haiteng Jiang > PhD candidate > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Visiting address > Room 2.32 > Donders Centre for Cognitive Neuroimaging > Kapittelweg 29 > 6525 EN Nijmegen > the Netherlands > > Tel.: +31 (0)243668291 > Web: https://sites.google.com/site/haitengjiang/ > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 25 > ***************************************** > > > > > -- > Haiteng Jiang > PhD candidate > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Visiting address > Room 2.32 > Donders Centre for Cognitive Neuroimaging > Kapittelweg 29 > 6525 EN Nijmegen > the Netherlands > > Tel.: +31 (0)243668291 > Web: https://sites.google.com/site/haitengjiang/ > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From bingshuo.li at student.uni-tuebingen.de Tue Apr 15 13:22:09 2014 From: bingshuo.li at student.uni-tuebingen.de (Bingshuo Li) Date: Tue, 15 Apr 2014 13:22:09 +0200 Subject: [FieldTrip] Question re: TMS-EEG FT Tutorial In-Reply-To: <5347ccb3.05c60e0a.716a.fffffe45SMTPIN_ADDED_BROKEN@mx.google.com> References: <5347ccb3.05c60e0a.716a.fffffe45SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: Hi Jim, Thank you very much again for your thoughtful response! I truly appreciate it! I see your point now why you interpolate after ICA. It makes sense and I think your argument is very valid. Indeed, bad channels always come up fairly independently anyways. I can for sure do my channel inspection after the ICA. Another question along the same line: Would you suggest to categorize all the IC with more than, say 30 uV, on the time-locked averaged IC, as muscle artifacts as suggested by Korhonen et al. (2011)? I often feel very puzzled when it comes to picking up ICs for removal. I feel that if I remove those high amplitude ICs, my averaged TEPs look worse. However, by keeping those high amplitude ICs, I am letting in signals with no biological plausibility. Any thoughts on that? Thanks very much! Regards, Bingshuo ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at student.uni-tuebingen.de +49-7071-29-89029 On Fri, Apr 11, 2014 at 12:48 PM, Herring, J.D. (Jim) < j.herring at fcdonders.ru.nl> wrote: > Dear Bingshuo, > > > > I am forwarding your e-mail to the Fieldtrip mailinglist so that others > can benefit and/or contribute from our discussion. > > > > The reason why I like to postpone the interpolation to after the ICA is > that I noticed that when interpolating before ICA the interpolated data > would load onto one component. Removing this component did not make sense > as it would leave a flat line in the TEP, keeping it in did not make sense > either because the interpolation was done with, for example, the decay > artifact still in the data. After removing the decay artifact with ICA you > would be left with a sharp peak in the interpolated segment. > > > > I see that it is difficult to reject trials and channels before > interpolation but keep in mind that before having done ICA large amounts of > variance of the data can be explained by the TMS related artifacts, these > will most likely cloud the detection of other types of artifacts with > functions such as ft_rejectvisual. > > > > In my experience bad channels show up as separate independent components > anyway and can be removed after having run the ICA, but that may depend on > a number of factors I’m not aware of. > > > > If you would like to reject bad channels prior to running ICA you could > also try to run ft_rejectvisual and specify cfg.latency to contain only > your pre-TMS period or a period post-TMS that does not contain any large > artifacts. That way you should at least be able to run metrics on your data > to remove bad channels. In any case you can always run ft_databrowser on > your data to visually inspect your channel time courses for bad channels > prior to running the ICA. > > > > In any case you are of course free to try running the ICA after > interpolation yourself and share your experiences, perhaps this works fine > for you J > > > > Best, > > > > Jim > > > > *From:* Bingshuo Li [mailto:bingshuo.li at cin.uni-tuebingen.de] > *Sent:* donderdag 10 april 2014 16:36 > *To:* j.herring at fcdonders.ru.nl > *Subject:* Question re: TMS-EEG FT Tutorial > > > > Dear Jim, > > I inquired you about a TMS-EEG question a while ago and you referred me to > the TMS-EEG tutorial on Fieldtrip's website. As I was following the steps > of the tutorial, there is a new question that come up to me -- Is it really > necessary to postpone the interpolation of the TMS artifact until the ICA > is done? Would there be any bad consequences if I interpolate first and > then run the ICA over the entire interpolated trial(s)? The reason I am > asking this question is that I would like to visually inspect my data first > and remove bad channels or trials (if any) prior to ICA. If the artifact is > not interpolated, it is really difficult to run visual inspection or > metrics on the data.. Following the logic of the tutorial, I can only > visual inspection after the ICA, which I think might not be a good idea as > I was told that a bad channel can easily bias the ICA result.. > > Do you have any insights in this? Thank you very much for your time in > advance! > > Sincerely, > > > ----- > Bingshuo Li (MSc. candidate) > Systems Neurophysiology Group > Centre for Integrative Neuroscience > University of Tuebingen > Otfried-Mueller-Str. 25 > D-72076 Tuebingen, Germany > > bingshuo.li at cin.uni-tuebingen.de > > +49-7071-29-89029 > > > > On Mon, Feb 10, 2014 at 3:24 PM, Herring, J.D. (Jim) < > j.herring at fcdonders.ru.nl> wrote: > > Dear Bingshuo, > > > > Please have a look at the following tutorial: > http://fieldtrip.fcdonders.nl/tutorial/tms-eeg > > > > It deals with a number of TMS-EEG related artifacts including the ‘evil’ > decay artifact. > > > > Best, > > > > Jim > > > > *From:* fieldtrip-bounces at science.ru.nl [mailto: > fieldtrip-bounces at science.ru.nl] *On Behalf Of *Bingshuo Li > *Sent:* maandag 10 februari 2014 15:06 > *To:* FieldTrip discussion list > *Subject:* [FieldTrip] TMS-EEG Decay Artifact > > > > Dear FT users and developers, > > Does anyone have any experience in dealing with the so-called decay > artifacts found in TMS-EEG? It is a relatively long lasting (up to 100ms) > artifact that follows a waveform similar to exponential decay and it occurs > sporadically in certain recording channels. > > Any tips/hints/recommendations are greatly appreciated! Thank you! > > Regards, > > > > ----- > Bingshuo Li (MSc. candidate) > Systems Neurophysiology Group > Centre for Integrative Neuroscience > University of Tuebingen > Otfried-Mueller-Str. 25 > D-72076 Tuebingen, Germany > bingshuo.li at student.uni-tuebingen.de > +49-152-06054831 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Tue Apr 15 16:03:00 2014 From: roeysc at gmail.com (Roey Schurr) Date: Tue, 15 Apr 2014 17:03:00 +0300 Subject: [FieldTrip] Resting State Data Source Reconstruction - covriance matrix in beamformer, and "avg" field in eLORETA Message-ID: Dear Fieldtrippers, First of all, a big thank you to all members of the community – it is a wonderful place to learn in and share ideas, thoughts and solutions to common problems we all face. I am writing you since I fear I might be missing something trivial: I am trying to compute an inverse solution to to resting-state EEG data. Two question arise, depending on the method I am trying to use: 1) Using a beamformer technique such as LCMV, a covariance matrix is needed. However, since the data is not time-locked (like ERP), the covariance matrix cannot be easily computed over the averaged trials. Can it be estimated using different resting-state trials? 2) Using eLORETA as the source reconstruction method (since my goal is a time-domain source reconstruction), it seems the the "avg" field is neeed in the data. Once again, no such average is available, since these are not ERP trials. Would you advise me to revise the code and try to fit it to non-ERP data, or is there some easier way I'm missing? Thank you all, Best, roey -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at fcdonders.ru.nl Wed Apr 16 09:44:46 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Wed, 16 Apr 2014 09:44:46 +0200 (CEST) Subject: [FieldTrip] Question re: TMS-EEG FT Tutorial In-Reply-To: References: <5347ccb3.05c60e0a.716a.fffffe45SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: <01e901cf5947$bcc80950$36581bf0$@herring@fcdonders.ru.nl> Hi Bingshuo, Be careful with categorizing IC’s based on their amplitudes alone. The kind people on the mailinglist may correct me if I am wrong but the exact amplitude of sources cannot be extracted using ICA. A very nice introduction to ICA by Arnaud Delorme can be found here: http://sccn.ucsd.edu/~arno/indexica.html. It contains a nice example where you can mix two sources and decompose them using fastICA (make sure to add the fastica toolbox to your matlab path, e.g. fieldtrip/external/fastica): % Create source time course A = sin(linspace(0,50, 1000)); % A B = sin(linspace(0,37, 1000)+5); % B figure; subplot(2,1,1); plot(A); % plot A subplot(2,1,2); plot(B, 'r'); % plot B % Mix sources M1 = A - 2*B; % mixing 1 M2 = 1.73*A+3.41*B; % mixing 2 figure; subplot(2,1,1); plot(M1); % plot mixing 1 subplot(2,1,2); plot(M2, 'r'); % plot mixing 2 % Decompose using ICA figure; c = fastica([M1;M2]); % compute and plot unminxing using fastICA subplot(1,2,1); plot(c(1,:)); subplot(1,2,2); plot(c(2,:)); Using the above line of code you can change the amplitude of the source time courses (e.g. by multiplying A and/or B by a constant) and you can see that the amplitude of the independent components remains unchanged. I am not 100% certain but what I think Korhonen et al. are doing is transforming the individual IC components back to sensor level and then looking at the EEG amplitudes, which would be valid. In fieldtrip you could realize this be using ft_rejectcomponent with ‘cfg.component’ set to all components except the one you would like to keep. I personally prefer to see whether the topography matches the location of areas that are stimulated by the coil and to check whether the averaged IC time courses contains the large exponential decay I would like to remove. Could it be that after removing these high amplitude ICs your TEPs only look more noisy because the vertical scaling changes while plotting? In other words, the noise was already there before but you are just zooming in more because the plotting function does not have to fit the high amplitude components in the figure? Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Bingshuo Li Sent: dinsdag 15 april 2014 13:22 To: FieldTrip discussion list Subject: Re: [FieldTrip] Question re: TMS-EEG FT Tutorial Hi Jim, Thank you very much again for your thoughtful response! I truly appreciate it! I see your point now why you interpolate after ICA. It makes sense and I think your argument is very valid. Indeed, bad channels always come up fairly independently anyways. I can for sure do my channel inspection after the ICA. Another question along the same line: Would you suggest to categorize all the IC with more than, say 30 uV, on the time-locked averaged IC, as muscle artifacts as suggested by Korhonen et al. (2011)? I often feel very puzzled when it comes to picking up ICs for removal. I feel that if I remove those high amplitude ICs, my averaged TEPs look worse. However, by keeping those high amplitude ICs, I am letting in signals with no biological plausibility. Any thoughts on that? Thanks very much! Regards, Bingshuo ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at student.uni-tuebingen.de +49-7071-29-89029 On Fri, Apr 11, 2014 at 12:48 PM, Herring, J.D. (Jim) wrote: Dear Bingshuo, I am forwarding your e-mail to the Fieldtrip mailinglist so that others can benefit and/or contribute from our discussion. The reason why I like to postpone the interpolation to after the ICA is that I noticed that when interpolating before ICA the interpolated data would load onto one component. Removing this component did not make sense as it would leave a flat line in the TEP, keeping it in did not make sense either because the interpolation was done with, for example, the decay artifact still in the data. After removing the decay artifact with ICA you would be left with a sharp peak in the interpolated segment. I see that it is difficult to reject trials and channels before interpolation but keep in mind that before having done ICA large amounts of variance of the data can be explained by the TMS related artifacts, these will most likely cloud the detection of other types of artifacts with functions such as ft_rejectvisual. In my experience bad channels show up as separate independent components anyway and can be removed after having run the ICA, but that may depend on a number of factors I’m not aware of. If you would like to reject bad channels prior to running ICA you could also try to run ft_rejectvisual and specify cfg.latency to contain only your pre-TMS period or a period post-TMS that does not contain any large artifacts. That way you should at least be able to run metrics on your data to remove bad channels. In any case you can always run ft_databrowser on your data to visually inspect your channel time courses for bad channels prior to running the ICA. In any case you are of course free to try running the ICA after interpolation yourself and share your experiences, perhaps this works fine for you J Best, Jim From: Bingshuo Li [mailto:bingshuo.li at cin.uni-tuebingen.de] Sent: donderdag 10 april 2014 16:36 To: j.herring at fcdonders.ru.nl Subject: Question re: TMS-EEG FT Tutorial Dear Jim, I inquired you about a TMS-EEG question a while ago and you referred me to the TMS-EEG tutorial on Fieldtrip's website. As I was following the steps of the tutorial, there is a new question that come up to me -- Is it really necessary to postpone the interpolation of the TMS artifact until the ICA is done? Would there be any bad consequences if I interpolate first and then run the ICA over the entire interpolated trial(s)? The reason I am asking this question is that I would like to visually inspect my data first and remove bad channels or trials (if any) prior to ICA. If the artifact is not interpolated, it is really difficult to run visual inspection or metrics on the data.. Following the logic of the tutorial, I can only visual inspection after the ICA, which I think might not be a good idea as I was told that a bad channel can easily bias the ICA result.. Do you have any insights in this? Thank you very much for your time in advance! Sincerely, ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at cin.uni-tuebingen.de +49-7071-29-89029 On Mon, Feb 10, 2014 at 3:24 PM, Herring, J.D. (Jim) wrote: Dear Bingshuo, Please have a look at the following tutorial: http://fieldtrip.fcdonders.nl/tutorial/tms-eeg It deals with a number of TMS-EEG related artifacts including the ‘evil’ decay artifact. Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Bingshuo Li Sent: maandag 10 februari 2014 15:06 To: FieldTrip discussion list Subject: [FieldTrip] TMS-EEG Decay Artifact Dear FT users and developers, Does anyone have any experience in dealing with the so-called decay artifacts found in TMS-EEG? It is a relatively long lasting (up to 100ms) artifact that follows a waveform similar to exponential decay and it occurs sporadically in certain recording channels. Any tips/hints/recommendations are greatly appreciated! Thank you! Regards, ----- Bingshuo Li (MSc. candidate) Systems Neurophysiology Group Centre for Integrative Neuroscience University of Tuebingen Otfried-Mueller-Str. 25 D-72076 Tuebingen, Germany bingshuo.li at student.uni-tuebingen.de +49-152-06054831 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.reinhart at vanderbilt.edu Wed Apr 16 14:42:14 2014 From: robert.reinhart at vanderbilt.edu (Rob Reinhart) Date: Wed, 16 Apr 2014 07:42:14 -0500 Subject: [FieldTrip] Beamforming Message-ID: Hello, I implemented your beamforming routine using the code that appears online ( http://fieldtrip.fcdonders.nl/tutorial/beamformer#preprocessing) and received this error, below. Can you advise? I appreciate your help. Best regards, Rob Reinhart ??? Error using ==> ft_read_headshape at 888 unknown fileformat "unknown" for head shape information Error in ==> ft_sourceplot at 890 surf = ft_read_headshape(cfg.surffile); Error in ==> FreqSourceAnalysis at 290 ft_sourceplot(cfg, sourceDiffIntNorm); -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Wed Apr 16 16:50:38 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Wed, 16 Apr 2014 16:50:38 +0200 Subject: [FieldTrip] Beamforming In-Reply-To: References: Message-ID: Hi Rob, What's cfg.surffile in your case? It should read 'surface_white_both'. I just updated the tutorial documentation yesterday, because the old specification: 'surface_l4_both' yielded the error you report. If you indeed use 'surface_white_both' it means we have to look into it further. Best, Jan-Mathijs On Apr 16, 2014, at 2:42 PM, Rob Reinhart wrote: > Hello, > > I implemented your beamforming routine using the code that appears online (http://fieldtrip.fcdonders.nl/tutorial/beamformer#preprocessing) and received this error, below. Can you advise? I appreciate your help. > > Best regards, > > Rob Reinhart > > > ??? Error using ==> ft_read_headshape at 888 > unknown fileformat "unknown" for head shape information > > Error in ==> ft_sourceplot at 890 > surf = ft_read_headshape(cfg.surffile); > > Error in ==> FreqSourceAnalysis at 290 > ft_sourceplot(cfg, sourceDiffIntNorm); > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.reinhart at vanderbilt.edu Wed Apr 16 18:20:27 2014 From: robert.reinhart at vanderbilt.edu (Rob Reinhart) Date: Wed, 16 Apr 2014 11:20:27 -0500 Subject: [FieldTrip] Beamforming In-Reply-To: References: Message-ID: Hi Jan-Mathijs, Thanks for your speedy reply. Unfortunately, in the code I'm implementing cfg.surffile = 'surface_white_both.mat' . What do you suggest? Thanks again. Best, Rob On Wed, Apr 16, 2014 at 9:50 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > > Hi Rob, > What's cfg.surffile in your case? It should read 'surface_white_both'. I just updated the tutorial documentation yesterday, because the old specification: 'surface_l4_both' yielded the error you report. If you indeed use 'surface_white_both' it means we have to look into it further. > Best, > Jan-Mathijs > > On Apr 16, 2014, at 2:42 PM, Rob Reinhart wrote: > > Hello, > > I implemented your beamforming routine using the code that appears online (http://fieldtrip.fcdonders.nl/tutorial/beamformer#preprocessing) and received this error, below. Can you advise? I appreciate your help. > > Best regards, > > Rob Reinhart > > > ??? Error using ==> ft_read_headshape at 888 > unknown fileformat "unknown" for head shape information > > Error in ==> ft_sourceplot at 890 > surf = ft_read_headshape(cfg.surffile); > > Error in ==> FreqSourceAnalysis at 290 > ft_sourceplot(cfg, sourceDiffIntNorm); > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From luke.bloy at gmail.com Wed Apr 16 21:29:24 2014 From: luke.bloy at gmail.com (Luke Bloy) Date: Wed, 16 Apr 2014 15:29:24 -0400 Subject: [FieldTrip] covariance computation from ft_timelockanalysis Message-ID: Hi All, I'm interested in using lcmv to do a common mode differential beamformer. My understanding, please correct me if I'm incorrect, is that the best way forward would be to 1) compute a covariance matrix from a time window combining both active and control windows. 2) use this combined covariance to make a common mode lcmv beamformer 3) apply this to both active and control windows separately 4) combine into some sort of psuedo T or NAI. does this sound correct? If so the main thing I'm unclear on is how to compute the covariance for 2 distinct time intervals? is this possible? Thanks, Luke -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.m.groppe at gmail.com Thu Apr 17 04:40:35 2014 From: david.m.groppe at gmail.com (David Groppe) Date: Wed, 16 Apr 2014 22:40:35 -0400 Subject: [FieldTrip] Research Assistant Position Available in Human Brain Mapping at New York's Feinstein Institute for Medical Research Message-ID: The Laboratory for Multimodal Human Brain Mapping at the Feinstein Institute for Medical Research is looking for a research assistant to help with their research into (1) improving the identification of functional and pathological brain regions in individuals suffering from epilepsy, (2) the neural mechanisms of cognition, and (3) characterizing macroscale human brain networks. The lab works exclusively with patients being evaluated for epilepsy surgery using methods such as electrocorticography, MRI, fMRI, and direct electrical brain stimulation. The responsibilities of the research assistant include assisting with the collection and analysis of the aforementioned data, managing data archives and lab equipment, working with a research coordinator on IRB matters, and helping to present lab findings at conferences and in journals. This unique position will expose the successful applicant to basic and clinical neuroscience as well as neurosurgery and neurology. It is a great opportunity for recent post-bacs interested in medical school or graduate school in neuroscience/biomedical engineering. Past research assistants in the lab have been co-authors on lab publications and have gone on to MD or PhD programs after spending 1-2 years in the lab. ------------- Qualifications ------------- Minimum: -B.A./B.S./B.E. in an appropriate discipline (e.g., neuroscience, psychology, biomedical engineering, computer science, physics) -1 year commitment Highly Desirable: -Experience with at least one programming language (preferably MATLAB) and statistical analyses -Prior experience working with neuroimaging, EEG/MEG, or brain stimulation data -Previous experience working with patients -Previous work in a research laboratory that shows evidence of independent scholarship, problem solving, and motivation -2 year commitment preferred For more information about the lab see: http://www.feinsteininstitute.org/faculty/ashesh-mehta-md-phd/ For more information about the position please send curriculum vitae and cover letter to Dr. David Groppe (david.m.groppe at gmail.com) -- David Groppe, Ph.D. Postdoctoral Researcher Laboratory for Multimodal Human Brain Mapping Feinstein Institute for Medical Research Manhasset, New York http://www.cogsci.ucsd.edu/~dgroppe/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Apr 17 10:24:54 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Thu, 17 Apr 2014 10:24:54 +0200 Subject: [FieldTrip] Beamforming In-Reply-To: References: Message-ID: Rob, I cannot reproduce your error. The (rather uninformative) error message you get refers to the fact that FT cannot find the default surffile, which should be in ~/fieldtrip/template/anatomy. This folder should be added automatically to your matlab path if you start fieldtrip in the recommended way, i.e. using the ft_defaults function. Please update your ft-version to a recent version, start matlab and fieldtrip in the recommended way and try again. Best wishes, Jan-Mathijs On Apr 16, 2014, at 6:20 PM, Rob Reinhart wrote: > Hi Jan-Mathijs, > Thanks for your speedy reply. Unfortunately, in the code I'm implementing cfg.surffile = 'surface_white_both.mat' . What do you suggest? Thanks again. > Best, > Rob > > On Wed, Apr 16, 2014 at 9:50 AM, jan-mathijs schoffelen wrote: > > > > Hi Rob, > > What's cfg.surffile in your case? It should read 'surface_white_both'. I just updated the tutorial documentation yesterday, because the old specification: 'surface_l4_both' yielded the error you report. If you indeed use 'surface_white_both' it means we have to look into it further. > > Best, > > Jan-Mathijs > > > > On Apr 16, 2014, at 2:42 PM, Rob Reinhart wrote: > > > > Hello, > > > > I implemented your beamforming routine using the code that appears online (http://fieldtrip.fcdonders.nl/tutorial/beamformer#preprocessing) and received this error, below. Can you advise? I appreciate your help. > > > > Best regards, > > > > Rob Reinhart > > > > > > ??? Error using ==> ft_read_headshape at 888 > > unknown fileformat "unknown" for head shape information > > > > Error in ==> ft_sourceplot at 890 > > surf = ft_read_headshape(cfg.surffile); > > > > Error in ==> FreqSourceAnalysis at 290 > > ft_sourceplot(cfg, sourceDiffIntNorm); > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > Jan-Mathijs Schoffelen, MD PhD > > > > Donders Institute for Brain, Cognition and Behaviour, > > Centre for Cognitive Neuroimaging, > > Radboud University Nijmegen, The Netherlands > > > > Max Planck Institute for Psycholinguistics, > > Nijmegen, The Netherlands > > > > J.Schoffelen at donders.ru.nl > > Telephone: +31-24-3614793 > > > > http://www.hettaligebrein.nl > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at donders.ru.nl Thu Apr 17 10:27:09 2014 From: jan.schoffelen at donders.ru.nl (jan-mathijs schoffelen) Date: Thu, 17 Apr 2014 10:27:09 +0200 Subject: [FieldTrip] covariance computation from ft_timelockanalysis In-Reply-To: References: Message-ID: Hi Luke, On Apr 16, 2014, at 9:29 PM, Luke Bloy wrote: > Hi All, > > I'm interested in using lcmv to do a common mode differential beamformer. My understanding, please correct me if I'm incorrect, is that the best way forward would be to > 1) compute a covariance matrix from a time window combining both active and control windows. > 2) use this combined covariance to make a common mode lcmv beamformer > 3) apply this to both active and control windows separately > 4) combine into some sort of psuedo T or NAI. > > does this sound correct? Yes it does. > If so the main thing I'm unclear on is how to compute the covariance for 2 distinct time intervals? is this possible? What you could do is call ft_timelockanalysis twice: each time with a different cfg.covariancewindow. Assuming you have an equal number of trials for both time windows, averaging the two covariance matrices will give you the combined covariance matrix. Best, Jan-Mathijs > > Thanks, > Luke > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip Jan-Mathijs Schoffelen, MD PhD Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands Max Planck Institute for Psycholinguistics, Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: +31-24-3614793 http://www.hettaligebrein.nl -------------- next part -------------- An HTML attachment was scrubbed... URL: From walshc11 at tcd.ie Thu Apr 17 11:35:05 2014 From: walshc11 at tcd.ie (Christian Walsh) Date: Thu, 17 Apr 2014 10:35:05 +0100 Subject: [FieldTrip] Problem with unwanted 'normalisation' of data using ft_realtime_signalviewer Message-ID: Dear community, My name is Christian Walsh and I am doing a Neural Engineering MSc. in TCD in Ireland. My thesis is on the effects of timed auditory stimulation on sleep quality. A sort of dumbed down and scaled down version of a recent enough study by Ngo et al. (2013) entitled: Auditory Closed-Loop Stimulation of the Sleep Slow Oscillations Enhances Memory. For this, I detect peaks and troughs in the ongoing EEG data in realtime. On detecting a trough, a sound is played back after an initial delay. This is done so that the sound playback coincides with the peak of the ongoing EEG data. Before I can actually perform this experiment I need to setup the apparatus. To do this I have simulated realtime streaming and analysis using the ft_realtime_signalproxy function in one MATLAB session and an edited_ft_realtime_powerestimate and psychtoolbox function in another session. This is all working fine. The problem is that the data that is streamed in is normalised, scaled or something. i.e. the y-values of the streamed data should range from around -150 uV to 150uV but the edited_ft_realtime_powerestimate function only displays y-values between around -2 and 2??? I'm new to programming so apologies if this is a stupid question. I have looked into editing some of the ft_read_data and ft_preproc_baselinecorrect functions but have not found a solution. Advice would be appreciated, Cheers, Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: From luke.bloy at gmail.com Thu Apr 17 20:16:30 2014 From: luke.bloy at gmail.com (Luke Bloy) Date: Thu, 17 Apr 2014 14:16:30 -0400 Subject: [FieldTrip] covariance computation from ft_timelockanalysis In-Reply-To: References: Message-ID: Dear Jan-Mathijs Thank you for the quick response. Computing the covariance seems to be working fine now. I'm curious what you would suggest for computing the differential power? at the moment I'm not keeping any trial measures (cfg.keeptrials='no') in either ft_timelockanalysis or ft_sourceanalysis. I'm then computing a psuedoT as act_sourceAnalysis.avg.pseudoT = (act_sourceAnalysis.avg.pow - cnt_sourceAnalysis.avg.pow)./(act_sourceAnalysis.avg.noise + cnt_sourceAnalysis.avg.noise); I wanted to compare this pseudoT to a standard T score. I can get trial by trial power estimates by using cfg.keeptrials='yes' in ft_timelockanalysis and cfg.keeptrials='yes' and ctf.rawtrial='yes' in ft_sourceanalysis. but ft_sourcestatistics doesn't seem to let me do a paired T the way I would hope. Is there an alternative route that you might take or is there another method that could be useful? Thanks, Luke On Thu, Apr 17, 2014 at 4:27 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Hi Luke, > > On Apr 16, 2014, at 9:29 PM, Luke Bloy wrote: > > Hi All, > > I'm interested in using lcmv to do a common mode differential beamformer. > My understanding, please correct me if I'm incorrect, is that the best way > forward would be to > 1) compute a covariance matrix from a time window combining both active > and control windows. > 2) use this combined covariance to make a common mode lcmv beamformer > 3) apply this to both active and control windows separately > 4) combine into some sort of psuedo T or NAI. > > does this sound correct? > > > Yes it does. > > If so the main thing I'm unclear on is how to compute the covariance for 2 > distinct time intervals? is this possible? > > > What you could do is call ft_timelockanalysis twice: each time with a > different cfg.covariancewindow. Assuming you have an equal number of trials > for both time windows, averaging the two covariance matrices will give you > the combined covariance matrix. > > Best, > Jan-Mathijs > > > > Thanks, > Luke > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > Jan-Mathijs Schoffelen, MD PhD > > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > > Max Planck Institute for Psycholinguistics, > Nijmegen, The Netherlands > > J.Schoffelen at donders.ru.nl > Telephone: +31-24-3614793 > > http://www.hettaligebrein.nl > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiteng.jiang at gmail.com Fri Apr 18 11:38:12 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Fri, 18 Apr 2014 11:38:12 +0200 Subject: [FieldTrip] Resting State Data Source Reconstruction - covriance matrix in beamformer, and "avg" field in eLORETA Message-ID: > > Dear Roey, > I don't have answer to your question but I have some thoughts. Firstly , you can cut your EEG resting state data into trials (2s per trial) . Since the dominant frequency of resting state is alpha , you can build frequency domain beamformer 'DICS' with (cfg.normalize='yes') to normalize the lead field , which will avoid bias toward the center of the head (http://fieldtrip.fcdonders.nl/tutorial/beamformer). After that , you can use virtual channel (all voxels) to extract the time series ( http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors). However, I am not sure whether it makes sense or not . Maybe the experts can comment on it. Best, Haiteng > > > Message: 2 > Date: Tue, 15 Apr 2014 17:03:00 +0300 > From: Roey Schurr > To: FieldTrip discussion list > Subject: [FieldTrip] Resting State Data Source Reconstruction - > covriance matrix in beamformer, and "avg" field in eLORETA > Message-ID: > zYfDVYjg at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Dear Fieldtrippers, > > > First of all, a big thank you to all members of the community ? it is a > wonderful place to learn in and share ideas, thoughts and solutions to > common problems we all face. > > > I am writing you since I fear I might be missing something trivial: I am > trying to compute an inverse solution to to resting-state EEG data. Two > question arise, depending on the method I am trying to use: > > > 1) Using a beamformer technique such as LCMV, a covariance matrix is > needed. However, since the data is not time-locked (like ERP), the > covariance matrix cannot be easily computed over the averaged trials. Can > it be estimated using different resting-state trials? > > 2) Using eLORETA as the source reconstruction method (since my goal is > a time-domain source reconstruction), it seems the the "avg" field is neeed > in the data. Once again, no such average is available, since these are not > ERP trials. > > Would you advise me to revise the code and try to fit it to non-ERP data, > or is there some easier way I'm missing? > > > Thank you all, > > Best, > > roey > > > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Apr 22 09:01:25 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 22 Apr 2014 09:01:25 +0200 Subject: [FieldTrip] Problem with unwanted 'normalisation' of data using ft_realtime_signalviewer In-Reply-To: References: Message-ID: <535613C5.4040209@donders.ru.nl> Hi Christian, I had a quick look at these function. I think these values are a result of the fact that a) power corresponds to the squared magnitude of a signal b) is line 157 of ft_realtime_powerestimate, the power is divided by the number of channels. Maybe put a breakpoint somewhere around line 130 and check step by step what happens to your data? Note also that this is just an example function, so it might not be practical for real experiment. Best, Jörn On 4/17/2014 11:35 AM, Christian Walsh wrote: > Dear community, > > My name is Christian Walsh and I am doing a Neural Engineering MSc. in > TCD in Ireland. My thesis is on the effects of timed auditory > stimulation on sleep quality. A sort of dumbed down and scaled down > version of a recent enough study by Ngo et al. (2013) entitled: > Auditory Closed-Loop Stimulation of the Sleep Slow Oscillations > Enhances Memory. > > For this, I detect peaks and troughs in the ongoing EEG data in > realtime. On detecting a trough, a sound is played back after an > initial delay. This is done so that the sound playback coincides with > the peak of the ongoing EEG data. Before I can actually perform this > experiment I need to setup the apparatus. > > To do this I have simulated realtime streaming and analysis using the > ft_realtime_signalproxy function in one MATLAB session and an > edited_ft_realtime_powerestimate and psychtoolbox function in another > session. This is all working fine. The problem is that the data that > is streamed in is normalised, scaled or something. i.e. the y-values > of the streamed data should range from around -150 uV to 150uV but the > edited_ft_realtime_powerestimate function only displays y-values > between around -2 and 2??? > > I'm new to programming so apologies if this is a stupid question. I > have looked into editing some of the ft_read_data and > ft_preproc_baselinecorrect functions but have not found a solution. > > Advice would be appreciated, > > Cheers, > > Christian > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From haiteng.jiang at gmail.com Wed Apr 23 07:13:13 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Wed, 23 Apr 2014 07:13:13 +0200 Subject: [FieldTrip] DecMeg2014 competition: decoding the human brain Message-ID: Biomag 2014 Decoding Challenge - Brain Decoding Across Subjects https://www.kaggle.com/c/decoding-the-human-brain Decoding mental states from functional neuroimaging data is a data analysis paradigm adopted both in neuroscience studies and in brain-computer interface applications. Decoding means determining, from the recorded brain activity, what stimulus was provided to a subject. In this competition, a large number of trials, from a face vs. scrambled face visual task, are available from multiple subjects. The brain activity was recorded by means of magnetoencephalography (MEG). MEG recordings from various subjects and the category of the associated visual stimuli are given to the participants of the competition in order to train their prediction algorithms. With their algorithms, the participants will have to predict the category of the stimulus of a different set of MEG recordings, from other subjects. Each submission to the competition will be scored according to the accuracy of prediction. Decoding across subjects is a difficult task because of the variability in head shape, cortical folding and functional organisation. For MEG data, the literature on decoding across subjects is still in early stages and competition aims at raising the awareness about this complex scientific problem. This competition is associated with the the 19th International Conference on Biomagnetism, Biomag 2014, Halifax (Canada), August 24-28, 2014. The competition begins: April 21st, 2014. The competition ends: July 27th, 2014. Prizes: 1st 3,000 USD, 2nd 1,500 USD, 3rd 500 USD. Organizers: Emanuele Olivetti, Seyed Mostafa Kia and Paolo Avesani (NeuroInformatics Lab, Bruno Kessler Foundation and University of Trento, IT), e-mail: decmeg2014 at list.fbk.eu. Scientific steering committee: Ole Jensen (Donders Institute, NL),> Nathan Weisz (University of Trento, IT), Richard Henson (MRC/CBU, UK) and Alexandre Gramfort (Telecom ParisTech, CNRS, CEA / Neurospin). We would also like to thank Daniel Wakeman (Martinos Center, MGH, USA). The awards for this competition are funded by Elekta Oy, MEG International Services Ltd (MISL), Fondazione Bruno Kessler and Besa Gmbh. Relevant links: - competition website: https://www.kaggle.com/c/decoding-the-human-brain - Biomag 2014: http://www.biomag2014.org - NeuroInformatics Lab: http://nilab.fbk.eu - Elekta Oy: http://www.elekta.com - MISL (CTF MEG): http://www.ctfmeg.com - Fondazione Bruno Kessler: http://www.fbk.eu - Besa GmbH: http://www.besa.de Please feel free to forward this message to your colleagues or contacts who might be interested in this competition. -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From rmontefusco at med.uchile.cl Wed Apr 23 16:46:54 2014 From: rmontefusco at med.uchile.cl (Rodrigo Montefusco) Date: Wed, 23 Apr 2014 10:46:54 -0400 Subject: [FieldTrip] Bug 2010 Message-ID: Hi Fieldtripers, I have an issue with Fieldtrip, calling ft_timelockanalysis in a Mac with matlab 32bit. I found this bug reported around a year ago and I don't know if someone has the compiled file they mention. http://bugzilla.fcdonders.nl/show_bug.cgi?id=2010 Thanks a lot! Best Rodrigo -- Y ================================ *Dr. Rodrigo A. Montefusco-Siegmund, Ph.D.* Postdoctoral Fellow, York University Centre for Vision Research Department of Psychology +1 647 975 3847+1 647 975 3847+1 647 975 3847+1 647 975 3847 yoguito at gmail.com Call Send SMS Add to Skype You'll need Skype CreditFree via Skype Call Send SMS Add to Skype You'll need Skype CreditFree via Skype -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Wed Apr 23 16:54:20 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Wed, 23 Apr 2014 16:54:20 +0200 Subject: [FieldTrip] Bug 2010 In-Reply-To: References: Message-ID: <5357D41C.5070407@donders.ru.nl> Hi Rodrigo, does it work for you when you compile the file locally? The source is in FieldTrip/external/fileexchange Just try to call >> mex CalcMD5.c If it works, Matlab creates a mexmaci file and from then one, you should never have such problems again. Btw, if it does work, it would be nice if you sent us the CalcMD5.mexmaci file, so that we can add it to FieldTrip :) If you have trouble doing so, or any other questions, feel free to ask. Best, Jörn On 4/23/2014 4:46 PM, Rodrigo Montefusco wrote: > Hi Fieldtripers, > > I have an issue with Fieldtrip, calling ft_timelockanalysis in a Mac > with matlab 32bit. I found this bug reported around a year ago and I > don't know if someone has the compiled file they mention. > http://bugzilla.fcdonders.nl/show_bug.cgi?id=2010 > > Thanks a lot! > > Best > > Rodrigo > > -- > > > Y > > > ================================ > *Dr. Rodrigo A. Montefusco-Siegmund, Ph.D.* > Postdoctoral Fellow, York University > Centre for Vision Research > Department of Psychology > +1 647 975 3847+1 647 975 3847+1 647 975 3847+1 647 975 3847 > yoguito at gmail.com > Call > Send SMS > Add to Skype > You'll need Skype CreditFree via Skype > Call > Send SMS > Add to Skype > You'll need Skype CreditFree via Skype > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From file.balint at ttk.mta.hu Thu Apr 24 16:23:52 2014 From: file.balint at ttk.mta.hu (Balint File) Date: Thu, 24 Apr 2014 16:23:52 +0200 Subject: [FieldTrip] cluster based permutation test - cfg.clusteralpha threshold Message-ID: <53591E78.5020208@ttk.mta.hu> Dear Fieldtrip experts, Recently I started to apply the spatial dimension (electrode neighborhood) of the cluster based permutation test. My question is: it's a valid way to choose a more permissive threshold (cfg.clusteralpha) at the level of the clusters identifying t-tests? According to the publication of Maris et al., 2007 ("this threshold does not affect the FA rate of the statistical test. However, this threshold does affect the sensitivity of the test. For example, weak but long-lasting effects are not detected when the threshold is large") it seems to me, that this threshold depends on the nature of the data.For lower cfg.clusteralpha threshold (<0.15) I get more extensive (and more explainable) results and the clusters still show high significance (<<0.025) at the permutation test. Thanks in advance for your help. Best regards, Bálint File -------------- next part -------------- An HTML attachment was scrubbed... URL: From guofashou at gmail.com Thu Apr 24 16:54:10 2014 From: guofashou at gmail.com (guofa shou) Date: Thu, 24 Apr 2014 09:54:10 -0500 Subject: [FieldTrip] between subject permutation test Message-ID: Hi, Fieldtripers, I have a question about the parameters setting about running cluster-based permutation test on group-level frequency data. Specifically, I have two groups, one is 12 subjects (i.e., 12 averaged powers), the other is 10 subjects (10 averaged powers), I want to do comparison on the sensor powers between these two groups. so how can I set cfg.statistic, cfg.design. Thanks! Guofa -- Guofa Shou PhD Research fellow, Computational Neuroimaging and Neuroengineering Laboratory, University of Oklahoma 3100 Monitor Ave. Suit 280 phone: 405-496-8661 -------------- next part -------------- An HTML attachment was scrubbed... URL: From aaron.schurger at gmail.com Thu Apr 24 18:24:44 2014 From: aaron.schurger at gmail.com (Aaron Schurger) Date: Thu, 24 Apr 2014 18:24:44 +0200 Subject: [FieldTrip] cluster based permutation test - cfg.clusteralpha threshold In-Reply-To: <53591E78.5020208@ttk.mta.hu> References: <53591E78.5020208@ttk.mta.hu> Message-ID: Dear Balint, It was difficult to parse your question: "it’s a valid way to choose a more permissive threshold (cfg.clusteralpha) at the level of the clusters identifying t-tests?" If you are asking whether or not it is valid to use a lower point-wise threshold, then it is technically valid, but if, for example, you try every possible point-wise threshold from 0.01 to 0.20 in steps of 0.01, and you manage to find one that gives you a significant result - well that should be avoided. Otherwise it is OK. You might also try this: http://www.biomedcentral.com/1471-2202/14/122 with code available here: https://bitbucket.org/emsf/emsf_matlab Instead of trying to find clusters of points that covary with an experimental effect, you try to find a temporo-spatial weighting that maximizes the experimental effect, and then look at the spatial patterns (clusters) that give you the effect. Best, Aaron On Thu, Apr 24, 2014 at 4:23 PM, Balint File wrote: > Dear Fieldtrip experts, > > Recently I started to apply the spatial dimension (electrode neighborhood) > of the cluster based permutation test. My question is: it’s a valid way to > choose a more permissive threshold (cfg.clusteralpha) at the level of the > clusters identifying t-tests? According to the publication of Maris et al., > 2007 („this threshold does not affect the FA rate of the statistical test. > However, this threshold does affect the sensitivity of the test. For > example, weak but long-lasting effects are not detected when the threshold > is large”) it seems to me, that this threshold depends on the nature of the > data. For lower cfg.clusteralpha threshold (<0.15) I get more extensive > (and more explainable) results and the clusters still show high > significance (<<0.025) at the permutation test. > > Thanks in advance for your help. > > Best regards, > > Bálint File > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Aaron Schurger, PhD Senior researcher Laboratory of Cognitive Neuroscience Brain-Mind Institute, Department of Life Sciences École Polytechnique Fédérale de Lausanne Station 19, AI 2101 1015 Lausanne, Switzerland +41 21 693 1771 aaron.schurger at epfl.ch http://lnco.epfl.ch/ From haiteng.jiang at gmail.com Fri Apr 25 13:35:40 2014 From: haiteng.jiang at gmail.com (Haiteng Jiang) Date: Fri, 25 Apr 2014 13:35:40 +0200 Subject: [FieldTrip] between subject permutation test (guofa shou) Message-ID: Hi Guofa, This is quite similar to between trial experiment ( http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq). In your case, you could specify something like this: cfg.statistic = 'indepsamplesT'; design = zeros(1,22); design(1,10) = 1; % group 1 design(1,11:22) = 2; % group 2 cfg.design = design; cfg.ivar = 1; Best, Haiteng > > Message: 2 > Date: Thu, 24 Apr 2014 09:54:10 -0500 > From: guofa shou > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] between subject permutation test > Message-ID: > < > CAC4CbVLP176SnaPyBDfwqOkdO-jqQnMNFHRTytaQjk5Hsiuaog at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi, Fieldtripers, > I have a question about the parameters setting about running > cluster-based permutation test on group-level frequency data. Specifically, > I have two groups, one is 12 subjects (i.e., 12 averaged powers), the other > is 10 subjects (10 averaged powers), I want to do comparison on the sensor > powers between these two groups. so how can I set cfg.statistic, > cfg.design. > Thanks! > Guofa > > -- > Guofa Shou PhD > Research fellow, > Computational Neuroimaging and Neuroengineering Laboratory, > University of Oklahoma > 3100 Monitor Ave. Suit 280 > phone: 405-496-8661 > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140424/5199110d/attachment-0001.html > > > > ------------------------------ > > Message: 3 > Date: Thu, 24 Apr 2014 18:24:44 +0200 > From: Aaron Schurger > To: FieldTrip discussion list > Subject: Re: [FieldTrip] cluster based permutation test - > cfg.clusteralpha threshold > Message-ID: > 8HFQpK3HHf6-Ba0g at mail.gmail.com> > Content-Type: text/plain; charset=UTF-8 > > Dear Balint, > It was difficult to parse your question: "it?s a valid way to choose a > more permissive threshold (cfg.clusteralpha) at the level of the > clusters identifying t-tests?" If you are asking whether or not it is > valid to use a lower point-wise threshold, then it is technically > valid, but if, for example, you try every possible point-wise > threshold from 0.01 to 0.20 in steps of 0.01, and you manage to find > one that gives you a significant result - well that should be avoided. > Otherwise it is OK. You might also try this: > http://www.biomedcentral.com/1471-2202/14/122 with code available > here: https://bitbucket.org/emsf/emsf_matlab > > Instead of trying to find clusters of points that covary with an > experimental effect, you try to find a temporo-spatial weighting that > maximizes the experimental effect, and then look at the spatial > patterns (clusters) that give you the effect. > > Best, > Aaron > > On Thu, Apr 24, 2014 at 4:23 PM, Balint File > wrote: > > Dear Fieldtrip experts, > > > > Recently I started to apply the spatial dimension (electrode > neighborhood) > > of the cluster based permutation test. My question is: it?s a valid way > to > > choose a more permissive threshold (cfg.clusteralpha) at the level of the > > clusters identifying t-tests? According to the publication of Maris et > al., > > 2007 (?this threshold does not affect the FA rate of the statistical > test. > > However, this threshold does affect the sensitivity of the test. For > > example, weak but long-lasting effects are not detected when the > threshold > > is large?) it seems to me, that this threshold depends on the nature of > the > > data. For lower cfg.clusteralpha threshold (<0.15) I get more extensive > > (and more explainable) results and the clusters still show high > > significance (<<0.025) at the permutation test. > > > > Thanks in advance for your help. > > > > Best regards, > > > > B?lint File > > > > > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > -- > Aaron Schurger, PhD > Senior researcher > Laboratory of Cognitive Neuroscience > Brain-Mind Institute, Department of Life Sciences > ?cole Polytechnique F?d?rale de Lausanne > Station 19, AI 2101 > 1015 Lausanne, Switzerland > +41 21 693 1771 > aaron.schurger at epfl.ch > http://lnco.epfl.ch/ > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 33 > ***************************************** > -- Haiteng Jiang PhD candidate Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Visiting address Room 2.32 Donders Centre for Cognitive Neuroimaging Kapittelweg 29 6525 EN Nijmegen the Netherlands Tel.: +31 (0)243668291 Web: https://sites.google.com/site/haitengjiang/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From pgoodin at swin.edu.au Mon Apr 28 13:12:03 2014 From: pgoodin at swin.edu.au (Peter Goodin) Date: Mon, 28 Apr 2014 11:12:03 +0000 Subject: [FieldTrip] Sizing problems using SPM'd cortex mesh Message-ID: Dear Fieldtrippers, I've been using SPM to make the tessellated cortex mesh and then trying to use the outputted cortex gifti file as the source model. I've been making the head model via the method outlined in the tutorial (segmented MRI image etc). Everything appears to go fine except the size of the source model is slightly smaller than the head model (see attached image). I'm not really sure how to get around this or how much it'll affect the accuracy of the localisation Any help would be greatly appreciated! Peter __________________________ Peter Goodin, BSc (Hons), Ph.D Candidate. Brain and Psychological Sciences Research Centre (BPsych) Swinburne University, Hawthorn, Vic, 3122 http://www.swinburne.edu.au/swinburneresearchers/index.php?fuseaction=profile&pid=4149 Monash Alfred Psychiatry Research Centre (MAPrc) Level 4, 607 St Kilda Road, Melbourne 3004 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: small_brain.tif Type: image/tiff Size: 83960 bytes Desc: small_brain.tif URL: From elisa at csl.psychol.cam.ac.uk Mon Apr 28 16:52:56 2014 From: elisa at csl.psychol.cam.ac.uk (Elisa Carrus) Date: Mon, 28 Apr 2014 15:52:56 +0100 Subject: [FieldTrip] problem with ft_resampledata after ft_preprocessing (inc. Hilbert) Message-ID: <535E6B48.4050401@csl.psychol.cam.ac.uk> Hi FT users, I am having some problems with resampling (downsampling) the data. Here is what I'm doing: I preprocess the continuous data to obtain band-pass filtered signal in several frequencies (4-8,8-12,12-30, etc), also taking the abs value of the Hilbert transform. The absolute value of the Hilbert is ultimately what I need. I have used the following code: / //cfg = [];// //cfg.channel = 'MEG';// //cfg.demean = 'yes';// //cfg.detrend = 'yes';// //cfg.lpfilter = 'yes';// //cfg.hilbert = 'abs';// //cfg.hpfilter = 'yes';// //cfg.hilbert = 'abs';// //cfg.lpfreq = 30;// //cfg.hpfreq = 12;// //cfg.dataset = '0061_syntask_02_raw_ssst_td.fif';// //cfg.continuous = 'yes';// //beta = ft_preprocessing(cfg);// / After this, I epoch the data as follows /cfg = [];// //cfg.trl = trl2; % this is a trial definition previously created// //beta_ep = ft_redefinetrial(cfg,beta);/ and then I downsample as follows: /cfg = [];// //cfg.resamplefs = 500;// //beta_epdw = ft_resampledata(cfg, beta_ep)/ I don't encounter any errors, but the strange thing is that the data looks fine up to before I downsample (i.e.g. if I plot one trial, it's all positive values, as I would expect from the abs of the Hilbert), but if I plot the downsampled data, the signal has both negative and positive values. Is there something I'm missing? Thanks a lot if you can help, Elisa -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.keil at gmail.com Mon Apr 28 17:32:07 2014 From: julian.keil at gmail.com (Julian Keil) Date: Mon, 28 Apr 2014 17:32:07 +0200 Subject: [FieldTrip] problem with ft_resampledata after ft_preprocessing (inc. Hilbert) In-Reply-To: <535E6B48.4050401@csl.psychol.cam.ac.uk> References: <535E6B48.4050401@csl.psychol.cam.ac.uk> Message-ID: Hi Elisa, did you check your .cfg of the output for demean and detrend? Depending on the FT-Version you use, the defaults may be to demean and detrend your data which might center the data around 0. See the help of your fr_resampledata-function for more info. Best, Julian ******************** Dr. Julian Keil AG Multisensorische Integration Psychiatrische Universitätsklinik der Charité im St. Hedwig-Krankenhaus Große Hamburger Straße 5-11, Raum E 307 10115 Berlin Telefon: +49-30-2311-1879 Fax: +49-30-2311-2209 http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration Am 28.04.2014 um 16:52 schrieb Elisa Carrus: > Hi FT users, > > I am having some problems with resampling (downsampling) the data. > > Here is what I'm doing: > > I preprocess the continuous data to obtain band-pass filtered signal in several frequencies (4-8,8-12,12-30, etc), also taking the abs value of the Hilbert transform. The absolute value of the Hilbert is ultimately what I need. > > I have used the following code: > > cfg = []; > cfg.channel = 'MEG'; > cfg.demean = 'yes'; > cfg.detrend = 'yes'; > cfg.lpfilter = 'yes'; > cfg.hilbert = 'abs'; > cfg.hpfilter = 'yes'; > cfg.hilbert = 'abs'; > cfg.lpfreq = 30; > cfg.hpfreq = 12; > cfg.dataset = '0061_syntask_02_raw_ssst_td.fif'; > cfg.continuous = 'yes'; > beta = ft_preprocessing(cfg); > > After this, I epoch the data as follows > > cfg = []; > cfg.trl = trl2; % this is a trial definition previously created > beta_ep = ft_redefinetrial(cfg,beta); > > and then I downsample as follows: > > cfg = []; > cfg.resamplefs = 500; > beta_epdw = ft_resampledata(cfg, beta_ep) > > I don't encounter any errors, but the strange thing is that the data looks fine up to before I downsample (i.e.g. if I plot one trial, it's all positive values, as I would expect from the abs of the Hilbert), but if I plot the downsampled data, the signal has both negative and positive values. > > Is there something I'm missing? > > Thanks a lot if you can help, > > Elisa > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From elisa at csl.psychol.cam.ac.uk Mon Apr 28 17:45:28 2014 From: elisa at csl.psychol.cam.ac.uk (Elisa Carrus) Date: Mon, 28 Apr 2014 16:45:28 +0100 Subject: [FieldTrip] problem with ft_resampledata after ft_preprocessing (inc. Hilbert) In-Reply-To: References: <535E6B48.4050401@csl.psychol.cam.ac.uk> Message-ID: <535E7798.8090201@csl.psychol.cam.ac.uk> Ah, that's it! I should have set demean to 'no'. Thanks! On 28/04/2014 16:32, Julian Keil wrote: > Hi Elisa, > > did you check your .cfg of the output for demean and detrend? > Depending on the FT-Version you use, the defaults may be to demean and > detrend your data which might center the data around 0. > > See the help of your fr_resampledata-function for more info. > > Best, > > Julian > > > ******************** > *Dr. Julian Keil* > * > * > AG Multisensorische Integration > Psychiatrische Universitätsklinik > der Charité im St. Hedwig-Krankenhaus > Große Hamburger Straße 5-11, Raum E 307 > 10115 Berlin > > Telefon: +49-30-2311-1879 > Fax: +49-30-2311-2209 > http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration > > Am 28.04.2014 um 16:52 schrieb Elisa Carrus: > >> Hi FT users, >> >> I am having some problems with resampling (downsampling) the data. >> >> Here is what I'm doing: >> >> I preprocess the continuous data to obtain band-pass filtered signal >> in several frequencies (4-8,8-12,12-30, etc), also taking the abs >> value of the Hilbert transform. The absolute value of the Hilbert is >> ultimately what I need. >> >> I have used the following code: >> / >> //cfg = [];// >> //cfg.channel = 'MEG';// >> //cfg.demean = 'yes';// >> //cfg.detrend = 'yes';// >> //cfg.lpfilter = 'yes';// >> //cfg.hilbert = 'abs';// >> //cfg.hpfilter = 'yes';// >> //cfg.hilbert = 'abs';// >> //cfg.lpfreq = 30;// >> //cfg.hpfreq = 12;// >> //cfg.dataset = '0061_syntask_02_raw_ssst_td.fif';// >> //cfg.continuous = 'yes';// >> //beta = ft_preprocessing(cfg);// >> / >> After this, I epoch the data as follows >> >> /cfg = [];// >> //cfg.trl = trl2; % this is a trial definition previously created// >> //beta_ep = ft_redefinetrial(cfg,beta);/ >> >> and then I downsample as follows: >> >> /cfg = [];// >> //cfg.resamplefs = 500;// >> //beta_epdw = ft_resampledata(cfg, beta_ep)/ >> >> I don't encounter any errors, but the strange thing is that the data >> looks fine up to before I downsample (i.e.g. if I plot one trial, >> it's all positive values, as I would expect from the abs of the >> Hilbert), but if I plot the downsampled data, the signal has both >> negative and positive values. >> >> Is there something I'm missing? >> >> Thanks a lot if you can help, >> >> Elisa >> >> >> >> >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From guofashou at gmail.com Tue Apr 29 04:15:15 2014 From: guofashou at gmail.com (guofa shou) Date: Mon, 28 Apr 2014 21:15:15 -0500 Subject: [FieldTrip] fieldtrip Digest, Vol 41, Issue 34 In-Reply-To: References: Message-ID: Thanks, Haiteng. And I have one more question about which coherence equation was used in Fieldtrip? I have checked the code, it seems it is different compared to the following equation (from Srinivasan, Ramesh, et al. "EEG and MEG coherence: measures of functional connectivity at distinct spatial scales of neocortical dynamics." *Journal of neuroscience methods* 166.1 (2007): 41-52.): [image: Inline image 2] [image: Inline image 1] Thanks, On Sat, Apr 26, 2014 at 5:00 AM, wrote: > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: between subject permutation test (guofa shou) (Haiteng Jiang) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 25 Apr 2014 13:35:40 +0200 > From: Haiteng Jiang > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] between subject permutation test (guofa shou) > Message-ID: > ESHa93x8hXXP2LaqRGrA at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi Guofa, > This is quite similar to between trial experiment ( > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq). In your > case, you could specify something like this: > > cfg.statistic = 'indepsamplesT'; > design = zeros(1,22); > design(1,10) = 1; % group 1 > design(1,11:22) = 2; % group 2 > cfg.design = design; > cfg.ivar = 1; > > Best, > > Haiteng > > > > > > > Message: 2 > > Date: Thu, 24 Apr 2014 09:54:10 -0500 > > From: guofa shou > > To: fieldtrip at science.ru.nl > > Subject: [FieldTrip] between subject permutation test > > Message-ID: > > < > > CAC4CbVLP176SnaPyBDfwqOkdO-jqQnMNFHRTytaQjk5Hsiuaog at mail.gmail.com> > > Content-Type: text/plain; charset="utf-8" > > > > Hi, Fieldtripers, > > I have a question about the parameters setting about running > > cluster-based permutation test on group-level frequency data. > Specifically, > > I have two groups, one is 12 subjects (i.e., 12 averaged powers), the > other > > is 10 subjects (10 averaged powers), I want to do comparison on the > sensor > > powers between these two groups. so how can I set cfg.statistic, > > cfg.design. > > Thanks! > > Guofa > > > > -- > > Guofa Shou PhD > > Research fellow, > > Computational Neuroimaging and Neuroengineering Laboratory, > > University of Oklahoma > > 3100 Monitor Ave. Suit 280 > > phone: 405-496-8661 > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: < > > > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140424/5199110d/attachment-0001.html > > > > > > > ------------------------------ > > > > Message: 3 > > Date: Thu, 24 Apr 2014 18:24:44 +0200 > > From: Aaron Schurger > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] cluster based permutation test - > > cfg.clusteralpha threshold > > Message-ID: > > > 8HFQpK3HHf6-Ba0g at mail.gmail.com> > > Content-Type: text/plain; charset=UTF-8 > > > > Dear Balint, > > It was difficult to parse your question: "it?s a valid way to choose a > > more permissive threshold (cfg.clusteralpha) at the level of the > > clusters identifying t-tests?" If you are asking whether or not it is > > valid to use a lower point-wise threshold, then it is technically > > valid, but if, for example, you try every possible point-wise > > threshold from 0.01 to 0.20 in steps of 0.01, and you manage to find > > one that gives you a significant result - well that should be avoided. > > Otherwise it is OK. You might also try this: > > http://www.biomedcentral.com/1471-2202/14/122 with code available > > here: https://bitbucket.org/emsf/emsf_matlab > > > > Instead of trying to find clusters of points that covary with an > > experimental effect, you try to find a temporo-spatial weighting that > > maximizes the experimental effect, and then look at the spatial > > patterns (clusters) that give you the effect. > > > > Best, > > Aaron > > > > On Thu, Apr 24, 2014 at 4:23 PM, Balint File > > wrote: > > > Dear Fieldtrip experts, > > > > > > Recently I started to apply the spatial dimension (electrode > > neighborhood) > > > of the cluster based permutation test. My question is: it?s a valid way > > to > > > choose a more permissive threshold (cfg.clusteralpha) at the level of > the > > > clusters identifying t-tests? According to the publication of Maris et > > al., > > > 2007 (?this threshold does not affect the FA rate of the statistical > > test. > > > However, this threshold does affect the sensitivity of the test. For > > > example, weak but long-lasting effects are not detected when the > > threshold > > > is large?) it seems to me, that this threshold depends on the nature of > > the > > > data. For lower cfg.clusteralpha threshold (<0.15) I get more > extensive > > > (and more explainable) results and the clusters still show high > > > significance (<<0.025) at the permutation test. > > > > > > Thanks in advance for your help. > > > > > > Best regards, > > > > > > B?lint File > > > > > > > > > > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > > > -- > > Aaron Schurger, PhD > > Senior researcher > > Laboratory of Cognitive Neuroscience > > Brain-Mind Institute, Department of Life Sciences > > ?cole Polytechnique F?d?rale de Lausanne > > Station 19, AI 2101 > > 1015 Lausanne, Switzerland > > +41 21 693 1771 > > aaron.schurger at epfl.ch > > http://lnco.epfl.ch/ > > > > > > > > ------------------------------ > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > End of fieldtrip Digest, Vol 41, Issue 33 > > ***************************************** > > > > > > -- > Haiteng Jiang > PhD candidate > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Visiting address > Room 2.32 > Donders Centre for Cognitive Neuroimaging > Kapittelweg 29 > 6525 EN Nijmegen > the Netherlands > > Tel.: +31 (0)243668291 > Web: https://sites.google.com/site/haitengjiang/ > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140425/3a4d8ea8/attachment-0001.html > > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 34 > ***************************************** > -- Guofa Shou PhD Research associate, Computational Neuroimaging and Neuroengineering Laboratory, University of Oklahoma 3100 Monitor Ave. Suit 280 phone: 405-443-0133 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 2394 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 3697 bytes Desc: not available URL: From mbj0310 at gmail.com Tue Apr 29 04:40:04 2014 From: mbj0310 at gmail.com (Beom Jun Min) Date: Tue, 29 Apr 2014 11:40:04 +0900 Subject: [FieldTrip] Clustering analysis with One way ANOVA design Message-ID: Dear trippers, I am not sure about my script for one-way ANOVA design. I have searched in the discussion list, but I cannot find. What I want to compare is F-statistics with different three groups, not interaction effect by now. cfg = []; cfg.channel = 'all'; cfg.neighbours = neighbours; cfg.latency = [0.2 0.3]; cfg.trials = 'all'; cfg.frequency = [32 32]; cfg.avgoverchan = 'no'; cfg.avgovertime = 'no'; cfg.avgoverfreq = 'no'; cfg.parameter = 'powspctrm'; cfg.method = 'montecarlo'; cfg.statistic = 'indepsamplesF'; cfg.alpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfg.tail = 1; cfg.clustertail = 1; cfg.correctm = 'cluster'; cfg.numrandomization = 1000; cfg.design = [ones(1,36), ones(1,34)*2, ones(1,28)*3] ; % N x num of observations cfg.ivar = 1; stat = ft_freqstatistics(cfg, A_zscore{1:36}, B_zscore{1:34}, C_zscore{1:28}); Is that script right? Especially, I am not sure that the design, and tail parameters (right-sided tail in the code) are correct. With regards -- BeomJun Min, M.D. Department of Medical System Engineering (DMSE) Gwangju Institute of Science and Technology (GIST) 261 Cheomdan-gwagiro(Oryong-dong), Buk-gu, Gwangju 500-712, Republic of Korea (South) Phone: +82-62-715-3266 / Fax: +82-62-715-3244 E-mail: mbj0310 at gmail.com, http://bmssa.gist.ac.kr -------------- next part -------------- An HTML attachment was scrubbed... URL: From jm.horschig at donders.ru.nl Tue Apr 29 11:17:20 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 29 Apr 2014 11:17:20 +0200 Subject: [FieldTrip] problem with ft_resampledata after ft_preprocessing (inc. Hilbert) In-Reply-To: <535E7798.8090201@csl.psychol.cam.ac.uk> References: <535E6B48.4050401@csl.psychol.cam.ac.uk> <535E7798.8090201@csl.psychol.cam.ac.uk> Message-ID: <535F6E20.1070006@donders.ru.nl> Hi Elisa, please note the following things: 1) Using an up-to-date version is always good (in a more recent FT version, you are forced to specify cfg.detrend when applying ft_resampledata). 2) Find out whether the version you are using detrending is applied by default (it used to be, but we changed this default. If you want to know why, check the help of ft_resampledata in one of the newer versions). 3) In ft_resampledata, we now suggest to apply demeaning before resampling. You can always add back the mean after resampling (given that you saved it beforehands) Best, Jörn On 4/28/2014 5:45 PM, Elisa Carrus wrote: > Ah, that's it! I should have set demean to 'no'. > > Thanks! > > On 28/04/2014 16:32, Julian Keil wrote: >> Hi Elisa, >> >> did you check your .cfg of the output for demean and detrend? >> Depending on the FT-Version you use, the defaults may be to demean >> and detrend your data which might center the data around 0. >> >> See the help of your fr_resampledata-function for more info. >> >> Best, >> >> Julian >> >> >> ******************** >> *Dr. Julian Keil* >> * >> * >> AG Multisensorische Integration >> Psychiatrische Universitätsklinik >> der Charité im St. Hedwig-Krankenhaus >> Große Hamburger Straße 5-11, Raum E 307 >> 10115 Berlin >> >> Telefon: +49-30-2311-1879 >> Fax: +49-30-2311-2209 >> http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration >> >> Am 28.04.2014 um 16:52 schrieb Elisa Carrus: >> >>> Hi FT users, >>> >>> I am having some problems with resampling (downsampling) the data. >>> >>> Here is what I'm doing: >>> >>> I preprocess the continuous data to obtain band-pass filtered signal >>> in several frequencies (4-8,8-12,12-30, etc), also taking the abs >>> value of the Hilbert transform. The absolute value of the Hilbert is >>> ultimately what I need. >>> >>> I have used the following code: >>> / >>> //cfg = [];// >>> //cfg.channel = 'MEG';// >>> //cfg.demean = 'yes';// >>> //cfg.detrend = 'yes';// >>> //cfg.lpfilter = 'yes';// >>> //cfg.hilbert = 'abs';// >>> //cfg.hpfilter = 'yes';// >>> //cfg.hilbert = 'abs';// >>> //cfg.lpfreq = 30;// >>> //cfg.hpfreq = 12;// >>> //cfg.dataset = '0061_syntask_02_raw_ssst_td.fif';// >>> //cfg.continuous = 'yes';// >>> //beta = ft_preprocessing(cfg);// >>> / >>> After this, I epoch the data as follows >>> >>> /cfg = [];// >>> //cfg.trl = trl2; % this is a trial definition previously created// >>> //beta_ep = ft_redefinetrial(cfg,beta);/ >>> >>> and then I downsample as follows: >>> >>> /cfg = [];// >>> //cfg.resamplefs = 500;// >>> //beta_epdw = ft_resampledata(cfg, beta_ep)/ >>> >>> I don't encounter any errors, but the strange thing is that the data >>> looks fine up to before I downsample (i.e.g. if I plot one trial, >>> it's all positive values, as I would expect from the abs of the >>> Hilbert), but if I plot the downsampled data, the signal has both >>> negative and positive values. >>> >>> Is there something I'm missing? >>> >>> Thanks a lot if you can help, >>> >>> Elisa >>> >>> >>> >>> >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Tue Apr 29 11:32:35 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 29 Apr 2014 11:32:35 +0200 Subject: [FieldTrip] fieldtrip Digest, Vol 41, Issue 34 In-Reply-To: References: Message-ID: <535F71B3.6020703@donders.ru.nl> Hi Guofa, What you copied looks to me like squared coherence, whereas FieldTrip computes absolute coherence. In essence, there is not much difference (as you can probably infer from the name). In my opinion, it depends mostly on what statistics you are using and what other methods to find out what makes most sense. Most papers that I know report coherence, so I personally prefer coherence because I know what values do make sense. But that's a matter of choice. You can check Maris, Schoffelen & Oostenveld, 2007 in JNM for formula that Fieldtrip uses (see also http://fieldtrip.fcdonders.nl/references_to_implemented_methods) Best, Jörn On 4/29/2014 4:15 AM, guofa shou wrote: > Thanks, Haiteng. > And I have one more question about which coherence equation was used > in Fieldtrip? I have checked the code, it seems it is different > compared to the following equation (from Srinivasan, Ramesh, et al. > "EEG and MEG coherence: measures of functional connectivity at > distinct spatial scales of neocortical dynamics." /Journal of > neuroscience methods/ 166.1 (2007): 41-52.): > Inline image 2 > Inline image 1 > Thanks, > > > > On Sat, Apr 26, 2014 at 5:00 AM, > wrote: > > Send fieldtrip mailing list submissions to > fieldtrip at science.ru.nl > > To subscribe or unsubscribe via the World Wide Web, visit > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > or, via email, send a message with subject or body 'help' to > fieldtrip-request at science.ru.nl > > > You can reach the person managing the list at > fieldtrip-owner at science.ru.nl > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of fieldtrip digest..." > > > Today's Topics: > > 1. Re: between subject permutation test (guofa shou) (Haiteng > Jiang) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 25 Apr 2014 13:35:40 +0200 > From: Haiteng Jiang > > To: fieldtrip at science.ru.nl > Subject: Re: [FieldTrip] between subject permutation test (guofa shou) > Message-ID: > > > > Content-Type: text/plain; charset="utf-8" > > Hi Guofa, > This is quite similar to between trial experiment ( > http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq). > In your > case, you could specify something like this: > > cfg.statistic = 'indepsamplesT'; > design = zeros(1,22); > design(1,10) = 1; % group 1 > design(1,11:22) = 2; % group 2 > cfg.design = design; > cfg.ivar = 1; > > Best, > > Haiteng > > > > > > > Message: 2 > > Date: Thu, 24 Apr 2014 09:54:10 -0500 > > From: guofa shou > > > To: fieldtrip at science.ru.nl > > Subject: [FieldTrip] between subject permutation test > > Message-ID: > > < > > > CAC4CbVLP176SnaPyBDfwqOkdO-jqQnMNFHRTytaQjk5Hsiuaog at mail.gmail.com > > > > Content-Type: text/plain; charset="utf-8" > > > > Hi, Fieldtripers, > > I have a question about the parameters setting about running > > cluster-based permutation test on group-level frequency data. > Specifically, > > I have two groups, one is 12 subjects (i.e., 12 averaged > powers), the other > > is 10 subjects (10 averaged powers), I want to do comparison on > the sensor > > powers between these two groups. so how can I set cfg.statistic, > > cfg.design. > > Thanks! > > Guofa > > > > -- > > Guofa Shou PhD > > Research fellow, > > Computational Neuroimaging and Neuroengineering Laboratory, > > University of Oklahoma > > 3100 Monitor Ave. Suit 280 > > phone: 405-496-8661 > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: < > > > http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140424/5199110d/attachment-0001.html > > > > > > > ------------------------------ > > > > Message: 3 > > Date: Thu, 24 Apr 2014 18:24:44 +0200 > > From: Aaron Schurger > > > To: FieldTrip discussion list > > > Subject: Re: [FieldTrip] cluster based permutation test - > > cfg.clusteralpha threshold > > Message-ID: > > > 8HFQpK3HHf6-Ba0g at mail.gmail.com > > > > Content-Type: text/plain; charset=UTF-8 > > > > Dear Balint, > > It was difficult to parse your question: "it?s a valid way to > choose a > > more permissive threshold (cfg.clusteralpha) at the level of the > > clusters identifying t-tests?" If you are asking whether or not > it is > > valid to use a lower point-wise threshold, then it is technically > > valid, but if, for example, you try every possible point-wise > > threshold from 0.01 to 0.20 in steps of 0.01, and you manage to find > > one that gives you a significant result - well that should be > avoided. > > Otherwise it is OK. You might also try this: > > http://www.biomedcentral.com/1471-2202/14/122 with code available > > here: https://bitbucket.org/emsf/emsf_matlab > > > > Instead of trying to find clusters of points that covary with an > > experimental effect, you try to find a temporo-spatial weighting > that > > maximizes the experimental effect, and then look at the spatial > > patterns (clusters) that give you the effect. > > > > Best, > > Aaron > > > > On Thu, Apr 24, 2014 at 4:23 PM, Balint File > > > > wrote: > > > Dear Fieldtrip experts, > > > > > > Recently I started to apply the spatial dimension (electrode > > neighborhood) > > > of the cluster based permutation test. My question is: it?s a > valid way > > to > > > choose a more permissive threshold (cfg.clusteralpha) at the > level of the > > > clusters identifying t-tests? According to the publication of > Maris et > > al., > > > 2007 (?this threshold does not affect the FA rate of the > statistical > > test. > > > However, this threshold does affect the sensitivity of the > test. For > > > example, weak but long-lasting effects are not detected when the > > threshold > > > is large?) it seems to me, that this threshold depends on the > nature of > > the > > > data. For lower cfg.clusteralpha threshold (<0.15) I get more > extensive > > > (and more explainable) results and the clusters still show high > > > significance (<<0.025) at the permutation test. > > > > > > Thanks in advance for your help. > > > > > > Best regards, > > > > > > B?lint File > > > > > > > > > > > > _______________________________________________ > > > fieldtrip mailing list > > > fieldtrip at donders.ru.nl > > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > > > > > -- > > Aaron Schurger, PhD > > Senior researcher > > Laboratory of Cognitive Neuroscience > > Brain-Mind Institute, Department of Life Sciences > > ?cole Polytechnique F?d?rale de Lausanne > > Station 19, AI 2101 > > 1015 Lausanne, Switzerland > > +41 21 693 1771 > > aaron.schurger at epfl.ch > > http://lnco.epfl.ch/ > > > > > > > > ------------------------------ > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > End of fieldtrip Digest, Vol 41, Issue 33 > > ***************************************** > > > > > > -- > Haiteng Jiang > PhD candidate > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Visiting address > Room 2.32 > Donders Centre for Cognitive Neuroimaging > Kapittelweg 29 > 6525 EN Nijmegen > the Netherlands > > Tel.: +31 (0)243668291 > Web: https://sites.google.com/site/haitengjiang/ > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > > ------------------------------ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > End of fieldtrip Digest, Vol 41, Issue 34 > ***************************************** > > > > > -- > Guofa Shou PhD > Research associate, > Computational Neuroimaging and Neuroengineering Laboratory, > University of Oklahoma > 3100 Monitor Ave. Suit 280 > phone: 405-443-0133 > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From jm.horschig at donders.ru.nl Tue Apr 29 15:28:04 2014 From: jm.horschig at donders.ru.nl (=?ISO-8859-1?Q?=22J=F6rn_M=2E_Horschig=22?=) Date: Tue, 29 Apr 2014 15:28:04 +0200 Subject: [FieldTrip] fieldtrip Digest, Vol 41, Issue 34 In-Reply-To: <535F71B3.6020703@donders.ru.nl> References: <535F71B3.6020703@donders.ru.nl> Message-ID: <535FA8E4.8010800@donders.ru.nl> whops, an important correction, I meant Maris, Schoffelen & Fries 2007, my bad On 4/29/2014 11:32 AM, "Jörn M. Horschig" wrote: > Hi Guofa, > > What you copied looks to me like squared coherence, whereas FieldTrip > computes absolute coherence. In essence, there is not much difference > (as you can probably infer from the name). In my opinion, it depends > mostly on what statistics you are using and what other methods to find > out what makes most sense. Most papers that I know report coherence, > so I personally prefer coherence because I know what values do make > sense. But that's a matter of choice. > > You can check Maris, Schoffelen & Oostenveld, 2007 in JNM for formula > that Fieldtrip uses (see also > http://fieldtrip.fcdonders.nl/references_to_implemented_methods) > > Best, > Jörn > > > On 4/29/2014 4:15 AM, guofa shou wrote: >> Thanks, Haiteng. >> And I have one more question about which coherence equation was used >> in Fieldtrip? I have checked the code, it seems it is different >> compared to the following equation (from Srinivasan, Ramesh, et al. >> "EEG and MEG coherence: measures of functional connectivity at >> distinct spatial scales of neocortical dynamics." /Journal of >> neuroscience methods/ 166.1 (2007): 41-52.): >> Inline image 2 >> Inline image 1 >> Thanks, >> >> >> >> On Sat, Apr 26, 2014 at 5:00 AM, > > wrote: >> >> Send fieldtrip mailing list submissions to >> fieldtrip at science.ru.nl >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> or, via email, send a message with subject or body 'help' to >> fieldtrip-request at science.ru.nl >> >> >> You can reach the person managing the list at >> fieldtrip-owner at science.ru.nl >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of fieldtrip digest..." >> >> >> Today's Topics: >> >> 1. Re: between subject permutation test (guofa shou) (Haiteng >> Jiang) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Fri, 25 Apr 2014 13:35:40 +0200 >> From: Haiteng Jiang > > >> To: fieldtrip at science.ru.nl >> Subject: Re: [FieldTrip] between subject permutation test (guofa >> shou) >> Message-ID: >> > > >> Content-Type: text/plain; charset="utf-8" >> >> Hi Guofa, >> This is quite similar to between trial experiment ( >> http://fieldtrip.fcdonders.nl/tutorial/cluster_permutation_freq). >> In your >> case, you could specify something like this: >> >> cfg.statistic = 'indepsamplesT'; >> design = zeros(1,22); >> design(1,10) = 1; % group 1 >> design(1,11:22) = 2; % group 2 >> cfg.design = design; >> cfg.ivar = 1; >> >> Best, >> >> Haiteng >> >> >> >> > >> > Message: 2 >> > Date: Thu, 24 Apr 2014 09:54:10 -0500 >> > From: guofa shou > > >> > To: fieldtrip at science.ru.nl >> > Subject: [FieldTrip] between subject permutation test >> > Message-ID: >> > < >> > >> CAC4CbVLP176SnaPyBDfwqOkdO-jqQnMNFHRTytaQjk5Hsiuaog at mail.gmail.com >> > >> > Content-Type: text/plain; charset="utf-8" >> > >> > Hi, Fieldtripers, >> > I have a question about the parameters setting about running >> > cluster-based permutation test on group-level frequency data. >> Specifically, >> > I have two groups, one is 12 subjects (i.e., 12 averaged >> powers), the other >> > is 10 subjects (10 averaged powers), I want to do comparison on >> the sensor >> > powers between these two groups. so how can I set cfg.statistic, >> > cfg.design. >> > Thanks! >> > Guofa >> > >> > -- >> > Guofa Shou PhD >> > Research fellow, >> > Computational Neuroimaging and Neuroengineering Laboratory, >> > University of Oklahoma >> > 3100 Monitor Ave. Suit 280 >> > phone: 405-496-8661 >> > -------------- next part -------------- >> > An HTML attachment was scrubbed... >> > URL: < >> > >> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140424/5199110d/attachment-0001.html >> > > >> > >> > ------------------------------ >> > >> > Message: 3 >> > Date: Thu, 24 Apr 2014 18:24:44 +0200 >> > From: Aaron Schurger > > >> > To: FieldTrip discussion list > > >> > Subject: Re: [FieldTrip] cluster based permutation test - >> > cfg.clusteralpha threshold >> > Message-ID: >> > > > 8HFQpK3HHf6-Ba0g at mail.gmail.com >> > >> > Content-Type: text/plain; charset=UTF-8 >> > >> > Dear Balint, >> > It was difficult to parse your question: "it?s a valid way to >> choose a >> > more permissive threshold (cfg.clusteralpha) at the level of the >> > clusters identifying t-tests?" If you are asking whether or not >> it is >> > valid to use a lower point-wise threshold, then it is technically >> > valid, but if, for example, you try every possible point-wise >> > threshold from 0.01 to 0.20 in steps of 0.01, and you manage to >> find >> > one that gives you a significant result - well that should be >> avoided. >> > Otherwise it is OK. You might also try this: >> > http://www.biomedcentral.com/1471-2202/14/122 with code available >> > here: https://bitbucket.org/emsf/emsf_matlab >> > >> > Instead of trying to find clusters of points that covary with an >> > experimental effect, you try to find a temporo-spatial weighting >> that >> > maximizes the experimental effect, and then look at the spatial >> > patterns (clusters) that give you the effect. >> > >> > Best, >> > Aaron >> > >> > On Thu, Apr 24, 2014 at 4:23 PM, Balint File >> > >> > wrote: >> > > Dear Fieldtrip experts, >> > > >> > > Recently I started to apply the spatial dimension (electrode >> > neighborhood) >> > > of the cluster based permutation test. My question is: it?s a >> valid way >> > to >> > > choose a more permissive threshold (cfg.clusteralpha) at the >> level of the >> > > clusters identifying t-tests? According to the publication of >> Maris et >> > al., >> > > 2007 (?this threshold does not affect the FA rate of the >> statistical >> > test. >> > > However, this threshold does affect the sensitivity of the >> test. For >> > > example, weak but long-lasting effects are not detected when the >> > threshold >> > > is large?) it seems to me, that this threshold depends on the >> nature of >> > the >> > > data. For lower cfg.clusteralpha threshold (<0.15) I get more >> extensive >> > > (and more explainable) results and the clusters still show high >> > > significance (<<0.025) at the permutation test. >> > > >> > > Thanks in advance for your help. >> > > >> > > Best regards, >> > > >> > > B?lint File >> > > >> > > >> > > >> > > _______________________________________________ >> > > fieldtrip mailing list >> > > fieldtrip at donders.ru.nl >> > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > >> > >> > -- >> > Aaron Schurger, PhD >> > Senior researcher >> > Laboratory of Cognitive Neuroscience >> > Brain-Mind Institute, Department of Life Sciences >> > ?cole Polytechnique F?d?rale de Lausanne >> > Station 19, AI 2101 >> > 1015 Lausanne, Switzerland >> > +41 21 693 1771 >> > aaron.schurger at epfl.ch >> > http://lnco.epfl.ch/ >> > >> > >> > >> > ------------------------------ >> > >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > >> > End of fieldtrip Digest, Vol 41, Issue 33 >> > ***************************************** >> > >> >> >> >> -- >> Haiteng Jiang >> PhD candidate >> Neuronal Oscillations Group >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognitive Neuroimaging >> Radboud University Nijmegen >> >> Visiting address >> Room 2.32 >> Donders Centre for Cognitive Neuroimaging >> Kapittelweg 29 >> 6525 EN Nijmegen >> the Netherlands >> >> Tel.: +31 (0)243668291 >> Web: https://sites.google.com/site/haitengjiang/ >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: >> >> >> ------------------------------ >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> End of fieldtrip Digest, Vol 41, Issue 34 >> ***************************************** >> >> >> >> >> -- >> Guofa Shou PhD >> Research associate, >> Computational Neuroimaging and Neuroengineering Laboratory, >> University of Oklahoma >> 3100 Monitor Ave. Suit 280 >> phone: 405-443-0133 >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- Jörn M. Horschig PhD Student Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen Neuronal Oscillations Group FieldTrip Development Team P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Contact: E-Mail: jm.horschig at donders.ru.nl Tel: +31-(0)24-36-68493 Web: http://www.ru.nl/donders Visiting address: Trigon, room 2.30 Kapittelweg 29 NL-6525 EN Nijmegen The Netherlands From marial.stavrinou at gmail.com Tue Apr 29 15:52:49 2014 From: marial.stavrinou at gmail.com (Maria L. Stavrinou) Date: Tue, 29 Apr 2014 15:52:49 +0200 Subject: [FieldTrip] simple sinusoidal signal as input to wavelet analysis Message-ID: Dear fieldtrip community, I am trying to import my own sinusoidal signal in order to make a wavelet analysis, get the result and find the total power. I cannot make the sinusoidal signal proper for the field trip. I get this message: Error using fixdimord (line 84) the data does not contain a dimord, but it also does not resemble raw or component data Error in ft_datatype_timelock (line 78) timelock = fixdimord(timelock); Error in ft_checkdata (line 207) data = ft_datatype_timelock(data); Error in ft_redefinetrial (line 104) data = ft_checkdata(data, 'datatype', 'raw', 'feedback', cfg.feedback); How should i do that? Best regards, Maria -- -- Maria L. Stavrinou MSc. PhD. Postdoc, Computational Neuroscience Norwegian University of Life Sciences, Ås, Norway http://compneuro.umb.no/ personal web-site: https://sites.google.com/site/marialstavrinou/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcgoiv0 at wfu.edu Tue Apr 29 17:36:55 2014 From: mcgoiv0 at wfu.edu (McGowin, Inna) Date: Tue, 29 Apr 2014 11:36:55 -0400 Subject: [FieldTrip] simple sinusoidal signal as input to wavelet analysis In-Reply-To: References: Message-ID: Hello Maria, I have an MEG data set measured from a current dipole energized by a generator with a sinusoidal signal at 7Hz. All waveforms look pretty sinusoidal on all channels. I was able to import the data into Matlab too. I can share the data if it helps. Thanks, Inna Inna McGowin On Tue, Apr 29, 2014 at 9:52 AM, Maria L. Stavrinou < marial.stavrinou at gmail.com> wrote: > Dear fieldtrip community, > I am trying to import my own sinusoidal signal in order to make a wavelet > analysis, get the result and find the total power. > I cannot make the sinusoidal signal proper for the field trip. I get this > message: > > Error using fixdimord (line 84) > the data does not contain a dimord, but it also does not resemble raw or > component data > > Error in ft_datatype_timelock (line 78) > timelock = fixdimord(timelock); > > Error in ft_checkdata (line 207) > data = ft_datatype_timelock(data); > > Error in ft_redefinetrial (line 104) > data = ft_checkdata(data, 'datatype', 'raw', 'feedback', cfg.feedback); > > How should i do that? > > > Best regards, > Maria > > -- > -- > Maria L. Stavrinou > MSc. PhD. > Postdoc, Computational Neuroscience > Norwegian University of Life Sciences, Ås, Norway > http://compneuro.umb.no/ > > personal web-site: https://sites.google.com/site/marialstavrinou/ > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at fcdonders.ru.nl Wed Apr 30 09:06:24 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Wed, 30 Apr 2014 09:06:24 +0200 (CEST) Subject: [FieldTrip] simple sinusoidal signal as input to wavelet analysis In-Reply-To: References: Message-ID: <013e01cf6442$b373e5d0$1a5bb170$@herring@fcdonders.ru.nl> Hi Maria, To be able to use your data in Fieldtrip you need to structure it in a certain way. Please have a look at http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat for an example. In short you will need to create a structure with a couple of fields that contain your raw data, sampling rate, etc. Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Maria L. Stavrinou Sent: dinsdag 29 april 2014 15:53 To: fieldtrip at science.ru.nl Subject: [FieldTrip] simple sinusoidal signal as input to wavelet analysis Dear fieldtrip community, I am trying to import my own sinusoidal signal in order to make a wavelet analysis, get the result and find the total power. I cannot make the sinusoidal signal proper for the field trip. I get this message: Error using fixdimord (line 84) the data does not contain a dimord, but it also does not resemble raw or component data Error in ft_datatype_timelock (line 78) timelock = fixdimord(timelock); Error in ft_checkdata (line 207) data = ft_datatype_timelock(data); Error in ft_redefinetrial (line 104) data = ft_checkdata(data, 'datatype', 'raw', 'feedback', cfg.feedback); How should i do that? Best regards, Maria -- -- Maria L. Stavrinou MSc. PhD. Postdoc, Computational Neuroscience Norwegian University of Life Sciences, Ås, Norway http://compneuro.umb.no/ personal web-site: https://sites.google.com/site/marialstavrinou/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From pierpaolo12croce at gmail.com Wed Apr 30 10:18:51 2014 From: pierpaolo12croce at gmail.com (Pierpaolo Croce) Date: Wed, 30 Apr 2014 10:18:51 +0200 Subject: [FieldTrip] txt file Message-ID: Dear Experts, i m a new ft user, i m writing to ask how open simple txt files with ft. this file is without any header. best -- PC -------------- next part -------------- An HTML attachment was scrubbed... URL: From elisa at csl.psychol.cam.ac.uk Wed Apr 30 12:38:01 2014 From: elisa at csl.psychol.cam.ac.uk (Elisa Carrus) Date: Wed, 30 Apr 2014 11:38:01 +0100 Subject: [FieldTrip] problem with ft_resampledata after ft_preprocessing (inc. Hilbert) In-Reply-To: <535F6E20.1070006@donders.ru.nl> References: <535E6B48.4050401@csl.psychol.cam.ac.uk> <535E7798.8090201@csl.psychol.cam.ac.uk> <535F6E20.1070006@donders.ru.nl> Message-ID: <5360D289.60907@csl.psychol.cam.ac.uk> Thanks Jörn, Yes, I have the latest version and I am forced to specify the detrend option. However, as for cfg.demean, I had done it when reading the continuous data with ft_preprocessing. Would you suggest doing it again then, when resampling the epoched data? It's because when I resample with 'cfg.demean = yes', my Hilbert values are centred around zero, i.e. I have both positive and negative values. Thanks, Elisa On 29/04/2014 10:17, "Jörn M. Horschig" wrote: > Hi Elisa, > > please note the following things: > 1) Using an up-to-date version is always good (in a more recent FT > version, you are forced to specify cfg.detrend when applying > ft_resampledata). > 2) Find out whether the version you are using detrending is applied by > default (it used to be, but we changed this default. If you want to > know why, check the help of ft_resampledata in one of the newer > versions). > 3) In ft_resampledata, we now suggest to apply demeaning before > resampling. You can always add back the mean after resampling (given > that you saved it beforehands) > > Best, > Jörn > > > > On 4/28/2014 5:45 PM, Elisa Carrus wrote: >> Ah, that's it! I should have set demean to 'no'. >> >> Thanks! >> >> On 28/04/2014 16:32, Julian Keil wrote: >>> Hi Elisa, >>> >>> did you check your .cfg of the output for demean and detrend? >>> Depending on the FT-Version you use, the defaults may be to demean >>> and detrend your data which might center the data around 0. >>> >>> See the help of your fr_resampledata-function for more info. >>> >>> Best, >>> >>> Julian >>> >>> >>> ******************** >>> *Dr. Julian Keil* >>> * >>> * >>> AG Multisensorische Integration >>> Psychiatrische Universitätsklinik >>> der Charité im St. Hedwig-Krankenhaus >>> Große Hamburger Straße 5-11, Raum E 307 >>> 10115 Berlin >>> >>> Telefon: +49-30-2311-1879 >>> Fax: +49-30-2311-2209 >>> http://psy-ccm.charite.de/forschung/bildgebung/ag_multisensorische_integration >>> >>> >>> Am 28.04.2014 um 16:52 schrieb Elisa Carrus: >>> >>>> Hi FT users, >>>> >>>> I am having some problems with resampling (downsampling) the data. >>>> >>>> Here is what I'm doing: >>>> >>>> I preprocess the continuous data to obtain band-pass filtered >>>> signal in several frequencies (4-8,8-12,12-30, etc), also taking >>>> the abs value of the Hilbert transform. The absolute value of the >>>> Hilbert is ultimately what I need. >>>> >>>> I have used the following code: >>>> / >>>> //cfg = [];// >>>> //cfg.channel = 'MEG';// >>>> //cfg.demean = 'yes';// >>>> //cfg.detrend = 'yes';// >>>> //cfg.lpfilter = 'yes';// >>>> //cfg.hilbert = 'abs';// >>>> //cfg.hpfilter = 'yes';// >>>> //cfg.hilbert = 'abs';// >>>> //cfg.lpfreq = 30;// >>>> //cfg.hpfreq = 12;// >>>> //cfg.dataset = '0061_syntask_02_raw_ssst_td.fif';// >>>> //cfg.continuous = 'yes';// >>>> //beta = ft_preprocessing(cfg);// >>>> / >>>> After this, I epoch the data as follows >>>> >>>> /cfg = [];// >>>> //cfg.trl = trl2; % this is a trial definition previously created// >>>> //beta_ep = ft_redefinetrial(cfg,beta);/ >>>> >>>> and then I downsample as follows: >>>> >>>> /cfg = [];// >>>> //cfg.resamplefs = 500;// >>>> //beta_epdw = ft_resampledata(cfg, beta_ep)/ >>>> >>>> I don't encounter any errors, but the strange thing is that the >>>> data looks fine up to before I downsample (i.e.g. if I plot one >>>> trial, it's all positive values, as I would expect from the abs of >>>> the Hilbert), but if I plot the downsampled data, the signal has >>>> both negative and positive values. >>>> >>>> Is there something I'm missing? >>>> >>>> Thanks a lot if you can help, >>>> >>>> Elisa >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> fieldtrip mailing list >>>> fieldtrip at donders.ru.nl >>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >>> >>> >>> >>> _______________________________________________ >>> fieldtrip mailing list >>> fieldtrip at donders.ru.nl >>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > From spa268 at nyu.edu Wed Apr 30 13:33:30 2014 From: spa268 at nyu.edu (Stephen Politzer-Ahles) Date: Wed, 30 Apr 2014 15:33:30 +0400 Subject: [FieldTrip] txt file Message-ID: Hello Pierpaolo, Have you tried this? http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat Best, Steve Stephen Politzer-Ahles New York University, Abu Dhabi Neuroscience of Language Lab http://www.nyu.edu/projects/politzer-ahles/ Message: 5 Date: Wed, 30 Apr 2014 10:18:51 +0200 From: Pierpaolo Croce To: fieldtrip at science.ru.nl Subject: [FieldTrip] txt file Message-ID: Content-Type: text/plain; charset="utf-8" Dear Experts, i m a new ft user, i m writing to ask how open simple txt files with ft. this file is without any header. best -- PC -------------- next part -------------- An HTML attachment was scrubbed... URL: